Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix heatmap by removing erroneous color configuration #2201

Merged
merged 7 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/dashboard/src/model-assessment-vision/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ export class App extends React.Component<IAppProps> {
TestReq: [{ displayText: "TestReq", format: "text" }]
};

public async generateRandomObjectDetectionMetrics(
selectionIndexes: number[][],
className: string
): Promise<any[]> {
const returnedValues: any[] = [];
selectionIndexes.forEach(() => {
returnedValues.push([Math.random(), Math.random(), Math.random()]);
});
await new Promise((resolve) => setTimeout(resolve, 1000));
return [returnedValues, [className]];
}

public render(): React.ReactNode {
if (this.props.modelExplanationData) {
for (const exp of this.props.modelExplanationData) {
Expand All @@ -39,6 +51,8 @@ export class App extends React.Component<IAppProps> {
...this.props,
locale: this.props.language,
localUrl: "https://www.bing.com/",
requestObjectDetectionMetrics: (selectionIndexes, _, className) =>
this.generateRandomObjectDetectionMetrics(selectionIndexes, className),
stringParams: { contextualHelp: this.messages },
theme: this.props.theme
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ export class CohortStatsHeatmap extends React.Component<
dataLabels: {
enabled: true,
nullFormat: "N/A",
style: {
color: theme.semanticColors.bodyText
},
...colorConfig
},
name: "Metrics",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,7 @@ export class FairnessMetricTable extends React.Component<
data: items,
dataLabels: {
color: theme.semanticColors.bodyText,
enabled: true,
style: {
color: theme.semanticColors.bodyText
}
enabled: true
},
name: "Metrics",
type: "heatmap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,11 @@ export class ModelOverview extends React.Component<
labeledStatistics={this.state.datasetCohortLabeledStatistics}
selectableMetrics={selectableMetrics}
selectedMetrics={this.state.selectedMetrics}
showHeatmapColors={this.state.showHeatmapColors}
showHeatmapColors={
this.state.showHeatmapColors &&
this.context.dataset.task_type !==
DatasetTaskType.ObjectDetection
}
/>
) : (
<>
Expand Down Expand Up @@ -474,7 +478,11 @@ export class ModelOverview extends React.Component<
selectedMetrics={this.state.selectedMetrics}
selectedFeatures={this.state.selectedFeatures}
featureBasedCohorts={this.state.featureBasedCohorts}
showHeatmapColors={this.state.showHeatmapColors}
showHeatmapColors={
this.state.showHeatmapColors &&
this.context.dataset.task_type !==
DatasetTaskType.ObjectDetection
}
/>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ export function generateCohortsStatsTable(
// only 1 unique value in the set, set color to 0
colorValue = 0;
}
const colorConfig = { color: "transparent" };
Advitya17 marked this conversation as resolved.
Show resolved Hide resolved
items.push({
...colorConfig,
colorValue,
value: Number(labeledStat.stat.toFixed(3)),
x: metricIndex + 1,
Expand Down
Loading