-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): add reference multiclass model quality (#69)
* feat(ui): add reference multiclass model quality * feat(ui): fix background style of multiclass table
- Loading branch information
Showing
8 changed files
with
220 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...dels/Details/multi-classification/reference/model-quality/class-table-metrics/columns.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { CHART_COLOR } from '@Helpers/common-chart-options'; | ||
import { numberFormatter } from '@Src/constants'; | ||
|
||
export default [ | ||
{ | ||
title: '', | ||
key: 'className', | ||
dataIndex: 'className', | ||
render: (label) => <div className="font-[var(--coo-font-weight-bold)]">{label}</div>, | ||
}, | ||
{ | ||
title: 'Reference Precision', | ||
key: 'precision', | ||
dataIndex: 'precision', | ||
align: 'right', | ||
width: '10rem', | ||
onCell: () => ({ style: { background: CHART_COLOR.REFERENCE_LIGHT } }), | ||
render: (precision) => numberFormatter().format(precision), | ||
}, | ||
{ | ||
title: 'Reference Recall', | ||
key: 'recall', | ||
dataIndex: 'recall', | ||
align: 'right', | ||
width: '10rem', | ||
onCell: () => ({ style: { background: CHART_COLOR.REFERENCE_LIGHT } }), | ||
render: (recall) => numberFormatter().format(recall), | ||
}, | ||
{ | ||
title: 'Reference F1-Score', | ||
key: 'fMeasure', | ||
dataIndex: 'fMeasure', | ||
align: 'right', | ||
width: '10rem', | ||
onCell: () => ({ style: { background: CHART_COLOR.REFERENCE_LIGHT } }), | ||
render: (fMeasure) => numberFormatter().format(fMeasure), | ||
}, | ||
{ | ||
title: 'Reference True Positive Rate', | ||
key: 'truePositiveRate', | ||
dataIndex: 'truePositiveRate', | ||
align: 'right', | ||
width: '10rem', | ||
onCell: () => ({ style: { background: CHART_COLOR.REFERENCE_LIGHT } }), | ||
render: (truePositiveRate) => numberFormatter().format(truePositiveRate), | ||
}, | ||
{ | ||
title: 'Reference False Positive Rate', | ||
key: 'falsePositiveRate', | ||
dataIndex: 'falsePositiveRate', | ||
align: 'right', | ||
width: '10rem', | ||
onCell: () => ({ style: { background: CHART_COLOR.REFERENCE_LIGHT } }), | ||
render: (falsePositiveRate) => numberFormatter().format(falsePositiveRate), | ||
}, | ||
]; |
33 changes: 33 additions & 0 deletions
33
...models/Details/multi-classification/reference/model-quality/class-table-metrics/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useGetReferenceModelQualityQueryWithPolling } from '@Src/store/state/models/polling-hook'; | ||
import { DataTable } from '@radicalbit/radicalbit-design-system'; | ||
import columns from './columns.jsx'; | ||
|
||
function ClassTableMetrics() { | ||
const { data } = useGetReferenceModelQualityQueryWithPolling(); | ||
const classMetrics = data?.modelQuality.classMetrics.map(({ | ||
className, metrics: { | ||
precision, falsePositiveRate, recall, truePositiveRate, fMeasure, | ||
}, | ||
}) => ({ | ||
className, | ||
precision, | ||
falsePositiveRate, | ||
truePositiveRate, | ||
recall, | ||
fMeasure, | ||
})) ?? []; | ||
|
||
return ( | ||
<DataTable | ||
columns={columns} | ||
dataSource={classMetrics} | ||
modifier="m-4" | ||
pagination={false} | ||
rowKey={({ label }) => label} | ||
scroll={{ y: '32rem' }} | ||
size="small" | ||
/> | ||
); | ||
} | ||
|
||
export default ClassTableMetrics; |
17 changes: 0 additions & 17 deletions
17
ui/src/container/models/Details/multi-classification/reference/model-quality/columns.jsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters