Skip to content

Commit

Permalink
Update StatsTableUtils.ts (#2568)
Browse files Browse the repository at this point in the history
  • Loading branch information
tongyu-microsoft authored May 21, 2024
1 parent 12a678e commit 6898acd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function generateCohortsStatsTable(
let countMinCohortName = "";
let countMaxCohortName = "";
cohorts.forEach((errorCohort, cohortIndex) => {
const labeledStat = labeledStatistics[cohortIndex].find(
const labeledStat = labeledStatistics[cohortIndex]?.find(
(labeledStat) => labeledStat.key === TotalCohortSamples
);
if (labeledStat) {
Expand Down Expand Up @@ -104,7 +104,7 @@ export function generateCohortsStatsTable(
let metricMax = Number.MIN_SAFE_INTEGER;
let metricMaxCohortName = "";
cohorts.forEach((errorCohort, cohortIndex) => {
const labeledStat = labeledStatistics[cohortIndex].find(
const labeledStat = labeledStatistics[cohortIndex]?.find(
(labeledStat) => labeledStat.key === metricOption.key
);
if (labeledStat) {
Expand Down Expand Up @@ -134,7 +134,7 @@ export function generateCohortsStatsTable(
};
fairnessStats.push(metricFairnessStats);
cohorts.forEach((_errorCohort, cohortIndex) => {
const labeledStat = labeledStatistics[cohortIndex].find(
const labeledStat = labeledStatistics[cohortIndex]?.find(
(labeledStat) => labeledStat.key === metricOption.key
);
if (labeledStat && !Number.isNaN(labeledStat.stat)) {
Expand Down

0 comments on commit 6898acd

Please sign in to comment.