forked from opendatahub-io/odh-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explainability: Fairness and Bias Metrics (Phase 0) (opendatahub-io#1001
) (opendatahub-io#1006) (opendatahub-io#1007) (opendatahub-io#1008) - Initial feature set for TrustyAI related UI functionality - Adds tab based navigation to modelServing screen - Adds a bias metrics tab with charts for visualising SPD and DIR metrics - Enhances prometheus query features for accessing TrustyAI data - Enhacements to MetricsChart component making it more configurable
- Loading branch information
1 parent
dfe7ecf
commit d4f90f6
Showing
22 changed files
with
499 additions
and
46 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
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
25 changes: 25 additions & 0 deletions
25
frontend/src/pages/modelServing/screens/metrics/BiasTab.tsx
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,25 @@ | ||
import React from 'react'; | ||
import { PageSection, Stack, StackItem } from '@patternfly/react-core'; | ||
import DIRGraph from '~/pages/modelServing/screens/metrics/DIRChart'; | ||
import MetricsPageToolbar from './MetricsPageToolbar'; | ||
import SPDChart from './SPDChart'; | ||
|
||
const BiasTab = () => ( | ||
<Stack> | ||
<StackItem> | ||
<MetricsPageToolbar /> | ||
</StackItem> | ||
<PageSection isFilled> | ||
<Stack hasGutter> | ||
<StackItem> | ||
<SPDChart /> | ||
</StackItem> | ||
<StackItem> | ||
<DIRGraph /> | ||
</StackItem> | ||
</Stack> | ||
</PageSection> | ||
</Stack> | ||
); | ||
|
||
export default BiasTab; |
40 changes: 40 additions & 0 deletions
40
frontend/src/pages/modelServing/screens/metrics/DIRChart.tsx
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,40 @@ | ||
import React from 'react'; | ||
import { Stack, StackItem } from '@patternfly/react-core'; | ||
import { InferenceMetricType } from '~/pages/modelServing/screens/metrics/ModelServingMetricsContext'; | ||
import TrustyChart from '~/pages/modelServing/screens/metrics/TrustyChart'; | ||
import { DomainCalculator, MetricsChartTypes } from '~/pages/modelServing/screens/metrics/types'; | ||
|
||
const DIRChart = () => { | ||
const DEFAULT_MAX_THRESHOLD = 1.2; | ||
const DEFAULT_MIN_THRESHOLD = 0.8; | ||
|
||
const domainCalc: DomainCalculator = (maxYValue) => ({ | ||
y: maxYValue > 1.2 ? [0, maxYValue + 0.1] : [0, 1.3], | ||
}); | ||
|
||
return ( | ||
<TrustyChart | ||
title="Disparate Impact Ratio" | ||
abbreviation="DIR" | ||
metricType={InferenceMetricType.TRUSTY_AI_DIR} | ||
tooltip={ | ||
<Stack hasGutter> | ||
<StackItem> | ||
Disparate Impact Ratio (DIR) measures imbalances in classifications by calculating the | ||
ratio between the proportion of the majority and protected classes getting a particular | ||
outcome. | ||
</StackItem> | ||
<StackItem> | ||
Typically, the further away the DIR is from 1, the more unfair the model. A DIR equal to | ||
1 indicates a perfectly fair model for the groups and outcomes in question. | ||
</StackItem> | ||
</Stack> | ||
} | ||
domain={domainCalc} | ||
thresholds={[DEFAULT_MAX_THRESHOLD, DEFAULT_MIN_THRESHOLD]} | ||
type={MetricsChartTypes.LINE} | ||
/> | ||
); | ||
}; | ||
|
||
export default DIRChart; |
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
Oops, something went wrong.