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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more