File size: 1,177 Bytes
fc0f7bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
export interface IDatasetSummary {
    featureNames?: string[];
    classNames?: string[];
    categoricalMap?: {[key: number]: string[]};
}

export enum PredictionTypes {
    binaryClassification = "binaryClassification",
    regression = "regression",
    probability = "probability"
}

export type PredictionType = 
    PredictionTypes.binaryClassification |
    PredictionTypes.probability |
    PredictionTypes.regression;

export interface IMetricResponse {
    global?: number;
    bins?: number[];
}

export interface IMetricRequest {
    metricKey: string;
    binVector: number[];
    modelIndex: number;
}

export interface IFairnessProps {
    dataSummary: IDatasetSummary;
    testData: any[][];
    predictionType?: PredictionTypes;
    // One array per each model;
    predictedY: number[][];
    modelNames?: string[]
    trueY: number[];
    theme?: any;
    stringParams?: any;
    supportedBinaryClassificationAccuracyKeys: string[];
    supportedRegressionAccuracyKeys: string[];
    supportedProbabilityAccuracyKeys: string[];
    // The request hook
    requestMetrics: ( request: IMetricRequest, abortSignal?: AbortSignal) =>  Promise<IMetricResponse>;
}