h2o-library 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/dist/charts/charts/src/chart/chart.d.ts +1 -1
- package/dist/charts/charts/src/waterfall/chart-waterfall.d.ts +27 -7
- package/dist/charts/index.cjs.js +1 -1
- package/dist/charts/index.js +1 -1
- package/dist/charts/src/chart/chart.d.ts +1 -1
- package/dist/charts/src/waterfall/chart-waterfall.d.ts +27 -7
- package/dist/esm/charts/src/chart/chart.d.ts +1 -1
- package/dist/esm/charts/src/waterfall/chart-waterfall.d.ts +27 -7
- package/dist/hooks/charts/src/chart/chart.d.ts +1 -1
- package/dist/hooks/charts/src/waterfall/chart-waterfall.d.ts +27 -7
- package/dist/types/charts/src/chart/chart.d.ts +1 -1
- package/dist/types/charts/src/waterfall/chart-waterfall.d.ts +27 -7
- package/dist/utils/charts/src/chart/chart.d.ts +1 -1
- package/dist/utils/charts/src/waterfall/chart-waterfall.d.ts +27 -7
- package/package.json +1 -1
|
@@ -12,7 +12,31 @@ export interface WaterfallFeature {
|
|
|
12
12
|
value?: number | string;
|
|
13
13
|
contribution: number;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
/** One feature entry inside a {@link ShapExplanation}. */
|
|
16
|
+
export interface ShapFeature {
|
|
17
|
+
name: string;
|
|
18
|
+
prob: number;
|
|
19
|
+
value?: number | string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The structured SHAP explanation object. Passed straight to
|
|
23
|
+
* {@link WaterfallChartProps.data} with no transform.
|
|
24
|
+
*/
|
|
25
|
+
export interface ShapExplanation {
|
|
26
|
+
recordId?: number;
|
|
27
|
+
losRecordId?: number;
|
|
28
|
+
probabilityDischargeNext2Days?: number;
|
|
29
|
+
/** f(x) — model output probability. */
|
|
30
|
+
fx: number;
|
|
31
|
+
/** E(f(x)) — baseline (expected) probability. */
|
|
32
|
+
efx: number;
|
|
33
|
+
/** Summed contribution of all features not individually listed. */
|
|
34
|
+
otherFactorsProb?: number;
|
|
35
|
+
/** Count of features grouped into otherFactors. */
|
|
36
|
+
otherFactorsValue?: number;
|
|
37
|
+
text?: string;
|
|
38
|
+
features: ShapFeature[];
|
|
39
|
+
}
|
|
16
40
|
export interface WaterfallColors {
|
|
17
41
|
positive?: string;
|
|
18
42
|
negative?: string;
|
|
@@ -25,16 +49,12 @@ export interface WaterfallBarDatum {
|
|
|
25
49
|
contribution: number;
|
|
26
50
|
}
|
|
27
51
|
export interface WaterfallChartProps {
|
|
28
|
-
data:
|
|
29
|
-
baseValue?: number;
|
|
30
|
-
prediction?: number;
|
|
52
|
+
data: ShapExplanation;
|
|
31
53
|
maxFeatures?: number;
|
|
32
54
|
colors?: WaterfallColors;
|
|
33
55
|
compact?: boolean;
|
|
34
56
|
height?: number;
|
|
35
57
|
className?: string;
|
|
36
|
-
probSuffix?: string;
|
|
37
|
-
valueSuffix?: string;
|
|
38
58
|
onBarClick?: (datum: WaterfallBarDatum, index: number, event: React.MouseEvent<SVGElement>) => void;
|
|
39
59
|
}
|
|
40
|
-
export declare const WaterfallChart: ({ data,
|
|
60
|
+
export declare const WaterfallChart: ({ data, maxFeatures, colors, compact, height, className, onBarClick, }: WaterfallChartProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -29,7 +29,7 @@ type BarChartSpecificProps = {
|
|
|
29
29
|
layout?: "single" | "grouped" | "stacked" | "grouped-stacked";
|
|
30
30
|
orientation?: "vertical" | "horizontal";
|
|
31
31
|
};
|
|
32
|
-
type WaterfallSpecificProps = Pick<WaterfallChartProps, "
|
|
32
|
+
type WaterfallSpecificProps = Pick<WaterfallChartProps, "maxFeatures" | "colors" | "compact" | "onBarClick">;
|
|
33
33
|
type ChartTypeSpecificProps<T extends ChartType> = T extends "bar" ? BarChartSpecificProps : T extends "waterfall" ? WaterfallSpecificProps : Record<string, never>;
|
|
34
34
|
export type ChartProps<T extends ChartType> = BaseChartProps & {
|
|
35
35
|
data: BaseChartData[T];
|
|
@@ -12,7 +12,31 @@ export interface WaterfallFeature {
|
|
|
12
12
|
value?: number | string;
|
|
13
13
|
contribution: number;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
/** One feature entry inside a {@link ShapExplanation}. */
|
|
16
|
+
export interface ShapFeature {
|
|
17
|
+
name: string;
|
|
18
|
+
prob: number;
|
|
19
|
+
value?: number | string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The structured SHAP explanation object. Passed straight to
|
|
23
|
+
* {@link WaterfallChartProps.data} with no transform.
|
|
24
|
+
*/
|
|
25
|
+
export interface ShapExplanation {
|
|
26
|
+
recordId?: number;
|
|
27
|
+
losRecordId?: number;
|
|
28
|
+
probabilityDischargeNext2Days?: number;
|
|
29
|
+
/** f(x) — model output probability. */
|
|
30
|
+
fx: number;
|
|
31
|
+
/** E(f(x)) — baseline (expected) probability. */
|
|
32
|
+
efx: number;
|
|
33
|
+
/** Summed contribution of all features not individually listed. */
|
|
34
|
+
otherFactorsProb?: number;
|
|
35
|
+
/** Count of features grouped into otherFactors. */
|
|
36
|
+
otherFactorsValue?: number;
|
|
37
|
+
text?: string;
|
|
38
|
+
features: ShapFeature[];
|
|
39
|
+
}
|
|
16
40
|
export interface WaterfallColors {
|
|
17
41
|
positive?: string;
|
|
18
42
|
negative?: string;
|
|
@@ -25,16 +49,12 @@ export interface WaterfallBarDatum {
|
|
|
25
49
|
contribution: number;
|
|
26
50
|
}
|
|
27
51
|
export interface WaterfallChartProps {
|
|
28
|
-
data:
|
|
29
|
-
baseValue?: number;
|
|
30
|
-
prediction?: number;
|
|
52
|
+
data: ShapExplanation;
|
|
31
53
|
maxFeatures?: number;
|
|
32
54
|
colors?: WaterfallColors;
|
|
33
55
|
compact?: boolean;
|
|
34
56
|
height?: number;
|
|
35
57
|
className?: string;
|
|
36
|
-
probSuffix?: string;
|
|
37
|
-
valueSuffix?: string;
|
|
38
58
|
onBarClick?: (datum: WaterfallBarDatum, index: number, event: React.MouseEvent<SVGElement>) => void;
|
|
39
59
|
}
|
|
40
|
-
export declare const WaterfallChart: ({ data,
|
|
60
|
+
export declare const WaterfallChart: ({ data, maxFeatures, colors, compact, height, className, onBarClick, }: WaterfallChartProps) => import("react/jsx-runtime").JSX.Element;
|