license import { getDrawArea } from '../render/render_utils' ; import { table } from '../render/table' ; import { Drawable } from '../types' ; param container param classAccuracy param classLabels export async function showPerClassAccuracy ( container , classAccuracy , classLabels ? ) { const drawArea = getDrawArea ( container ) ; const headers = [ 'Class' , 'Accuracy' , '# Samples' , ] ; const values = [ ] ; for ( let i = 0 ; i < classAccuracy . length ; i ++ ) { const label = classLabels ? classLabels [ i ] : i . toString ( ) ; const classAcc = classAccuracy [ i ] ; values . push ( [ label , classAcc . accuracy , classAcc . count ] ) ; } return table ( drawArea , { headers , values } ) ; }