Skip to content

Commit

Permalink
feat(ui): add logLoss to modelQuality binary (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvalleri authored Jul 25, 2024
1 parent 1bd820d commit c9d407a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,31 @@ function AreaUnderPrChart() {
return false;
}

function LogLossChart() {
const { uuid } = useParams();
const { data: currentData } = useGetCurrentModelQualityQueryWithPolling();
const { data: referenceData } = useGetReferenceModelQualityQuery({ uuid });

const referenceAreaUnderPr = referenceData?.modelQuality?.logLoss;
const currentSeries = currentData?.modelQuality?.groupedMetrics?.logLoss;

if (currentSeries && currentSeries !== null) {
const referenceSeries = currentSeries.map((o) => ({ ...o, value: referenceAreaUnderPr }));

return (
<LineChart
color={CHART_COLOR.CURRENT}
currentData={currentSeries}
referenceData={referenceSeries}
title={MODEL_QUALITY_FIELD.LOG_LOSS}
/>
);
}
return false;
}

export {
AccuracyChart, AreaUnderPrChart, AreaUnderRocChart, F1Chart,
FalsePositiveRateChart, PrecisionChart,
RecallChart, TruePositiveRateChart,
RecallChart, TruePositiveRateChart, LogLossChart,
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default [
key: 'currentValue',
dataIndex: 'currentValue',
align: 'right',
render: (currentValue) => numberFormatter().format(currentValue),
render: (currentValue) => (currentValue) ? numberFormatter().format(currentValue) : '--',
},
{
title: 'Reference',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
AreaUnderRocChart,
F1Chart,
FalsePositiveRateChart,
LogLossChart,
PrecisionChart,
RecallChart,
TruePositiveRateChart,
Expand Down Expand Up @@ -70,6 +71,8 @@ function BinaryClassificationModelQualityMetrics() {

<FalsePositiveRateChart />

<LogLossChart />

<ConfusionMatrix
colors={[CHART_COLOR.WHITE, CHART_COLOR.CURRENT]}
dataset={confusionMatrixData}
Expand Down Expand Up @@ -101,6 +104,7 @@ function PerformanceBoard() {
const referenceTruePositiveRate = referenceData?.modelQuality?.truePositiveRate;
const referenceAreaUnderRoc = referenceData?.modelQuality?.areaUnderRoc;
const referenceAreaUnderPr = referenceData?.modelQuality?.areaUnderPr;
const referenceLogLoss = referenceData?.modelQuality?.logLoss;

const leftTableData = currentData ? [
{
Expand Down Expand Up @@ -136,6 +140,12 @@ function PerformanceBoard() {
referenceValue: referenceTruePositiveRate,
currentValue: currentData.modelQuality.globalMetrics.truePositiveRate,
},
{
label: MODEL_QUALITY_FIELD.LOG_LOSS,
referenceValue: referenceLogLoss,
currentValue: currentData.modelQuality.globalMetrics.logLoss,
},

] : [];

const rightTableData = currentData ? [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export default [
key: 'value',
dataIndex: 'value',
align: 'right',
render: (value) => numberFormatter().format(value),
render: (value) => (value) ? numberFormatter().format(value) : '--',
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function BinaryClassificationModelQualityMetrics() {
const centerTableData = data ? [
{ label: 'False positive rate', value: data.modelQuality.falsePositiveRate },
{ label: 'True positive rate', value: data.modelQuality.truePositiveRate },
{ label: 'Log loss', value: data.modelQuality.logLoss },
] : [];

const rightTableData = data ? [
Expand Down
1 change: 1 addition & 0 deletions ui/src/container/models/Details/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const MODEL_QUALITY_FIELD = {
R2: 'R-squared',
ADJ_R2: 'Adjusted R-squared',
VARIANCE: 'Variance',
LOG_LOSS: 'Log loss',
};

export const TABLE_COLOR = {
Expand Down

0 comments on commit c9d407a

Please sign in to comment.