Public
Edited
Feb 11, 2022
Insert cell
Insert cell
workbook = FileAttachment("google://behaviour_analysis_score_evaluation").xlsx()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
color_config = ({
legend: true,
domain: ['FP', 'MM', 'TN', 'TP', 'FN'],
range: [color[1], color[2], color[3], color[4], color[5]]
})
Insert cell
color = d3.schemeTableau10
Insert cell
Insert cell
data = result_sheets.map(sheet => {
return workbook.sheet(sheet.index, {
headers: true,
// range: "A1:J10"
}).map(d => ({...d, case: sheet.name.replace('Results_',''), score: d.score ? d.score : 0.0}))
}).flat()
Insert cell
Insert cell
parameters = workbook.sheet(parameters_sheet.index, {
headers: true,
range: "A1:Z2"
})[0]
Insert cell
get_accuracy = (verdict_name) => {
const stat = Object.fromEntries( d3.groups(data, d => d[verdict_name]).map(d => [d[0], d[1].length]) )
return (stat.TP + stat.TN) / (stat.TP + stat.TN + stat.FP + stat.FN + stat.MM)
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more