@zukhruf/evals 0.8.7 → 0.8.9
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/README.md +106 -37
- package/dist/classification/all-class-matches.d.ts +1 -1
- package/dist/classification/all-class-matches.d.ts.map +1 -1
- package/dist/classification/all-class-matches.js +8 -4
- package/dist/classification/all-class-matches.js.map +1 -1
- package/dist/classification/average.d.ts +1 -2
- package/dist/classification/average.d.ts.map +1 -1
- package/dist/classification/binary-average.d.ts +2 -2
- package/dist/classification/binary-average.d.ts.map +1 -1
- package/dist/classification/binary-average.js +13 -12
- package/dist/classification/binary-average.js.map +1 -1
- package/dist/classification/class-counts.d.ts +5 -4
- package/dist/classification/class-counts.d.ts.map +1 -1
- package/dist/classification/class-counts.js +41 -33
- package/dist/classification/class-counts.js.map +1 -1
- package/dist/classification/label-comparer.d.ts +4 -0
- package/dist/classification/label-comparer.d.ts.map +1 -1
- package/dist/classification/label-comparer.js +10 -2
- package/dist/classification/label-comparer.js.map +1 -1
- package/dist/classification/label-comparison.d.ts +4 -2
- package/dist/classification/label-comparison.d.ts.map +1 -1
- package/dist/classification/label-comparison.js +11 -6
- package/dist/classification/label-comparison.js.map +1 -1
- package/dist/classification/macro-average.d.ts +1 -1
- package/dist/classification/macro-average.d.ts.map +1 -1
- package/dist/classification/macro-average.js +3 -3
- package/dist/classification/macro-average.js.map +1 -1
- package/dist/classification/micro-average.d.ts +1 -1
- package/dist/classification/micro-average.d.ts.map +1 -1
- package/dist/classification/micro-average.js +4 -4
- package/dist/classification/micro-average.js.map +1 -1
- package/dist/classification/per-class.d.ts +0 -6
- package/dist/classification/per-class.d.ts.map +1 -1
- package/dist/classification/per-class.js +4 -10
- package/dist/classification/per-class.js.map +1 -1
- package/dist/classification/weighted-average.d.ts +1 -1
- package/dist/classification/weighted-average.d.ts.map +1 -1
- package/dist/classification/weighted-average.js +3 -3
- package/dist/classification/weighted-average.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/promptfoo/failed-call.d.ts +13 -0
- package/dist/promptfoo/failed-call.d.ts.map +1 -0
- package/dist/promptfoo/failed-call.js +24 -0
- package/dist/promptfoo/failed-call.js.map +1 -0
- package/dist/promptfoo/index.d.ts +1 -0
- package/dist/promptfoo/index.d.ts.map +1 -1
- package/dist/promptfoo/index.js +1 -0
- package/dist/promptfoo/index.js.map +1 -1
- package/dist/scoring/grouped.d.ts +3 -3
- package/dist/scoring/grouped.d.ts.map +1 -1
- package/dist/scoring/grouped.js +7 -4
- package/dist/scoring/grouped.js.map +1 -1
- package/dist/scoring/paired-bootstrap.d.ts +24 -0
- package/dist/scoring/paired-bootstrap.d.ts.map +1 -0
- package/dist/scoring/paired-bootstrap.js +94 -0
- package/dist/scoring/paired-bootstrap.js.map +1 -0
- package/dist/scoring/run.d.ts +7 -0
- package/dist/scoring/run.d.ts.map +1 -0
- package/dist/scoring/run.js +19 -0
- package/dist/scoring/run.js.map +1 -0
- package/dist/scoring/scorer-set.d.ts +1 -1
- package/dist/scoring/scorer-set.d.ts.map +1 -1
- package/dist/scoring/scorer-set.js.map +1 -1
- package/dist/scoring/test-epochs.d.ts +11 -0
- package/dist/scoring/test-epochs.d.ts.map +1 -0
- package/dist/scoring/test-epochs.js +25 -0
- package/dist/scoring/test-epochs.js.map +1 -0
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-counts.js","sourceRoot":"","sources":["../../src/classification/class-counts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EACL,UAAU,GAEX,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAA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EAAE,YAAY,GAAG,CAAC,EAAgB,EAC3C,KAA6C;QAE7C,OAAO,OAAO,CAAC,EAAE,CACf;YACE,MAAM,EAAE,IAAI,GAAG,CACb,IAAI,CAAC,QAAQ;iBACV,OAAO,EAAE;iBACT,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CACpD;YACD,UAAU,EAAE,IAAI,CAAC,WAAW;SAC7B,EACD,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,YAAY,CAC1C,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { Comparer } from '../scoring/comparer.ts';
|
|
2
2
|
import type { LabelCase } from './label-case.ts';
|
|
3
3
|
import { LabelComparison } from './label-comparison.ts';
|
|
4
|
+
import { type Label } from './label.ts';
|
|
4
5
|
export declare class LabelComparer implements Comparer<LabelCase, LabelComparison> {
|
|
5
6
|
#private;
|
|
7
|
+
constructor({ labels }: {
|
|
8
|
+
readonly labels: readonly Label[];
|
|
9
|
+
});
|
|
6
10
|
compare(stated: unknown, testCase: LabelCase): LabelComparison;
|
|
7
11
|
}
|
|
8
12
|
//# sourceMappingURL=label-comparer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-comparer.d.ts","sourceRoot":"","sources":["../../src/classification/label-comparer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"label-comparer.d.ts","sourceRoot":"","sources":["../../src/classification/label-comparer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,KAAK,KAAK,EAAW,MAAM,YAAY,CAAC;AAUjD,qBAAa,aAAc,YAAW,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;;gBAG5D,EAAE,MAAM,EAAE,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAA;KAAE;IAI7D,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,GAAG,eAAe;CAoC/D"}
|
|
@@ -5,14 +5,22 @@ import { isLabel } from "./label.js";
|
|
|
5
5
|
// a JSON array of labels gives those labels; a number gives a number label
|
|
6
6
|
// only when each expected label of the case is a number; any other text,
|
|
7
7
|
// without its white space at the start and the end, is one string label.
|
|
8
|
+
// Its comparisons hold the class set: the classes of the task, in the order
|
|
9
|
+
// that the caller gives (scikit-learn's labels). The answers never add a
|
|
10
|
+
// class.
|
|
8
11
|
export class LabelComparer {
|
|
12
|
+
#labels;
|
|
13
|
+
constructor({ labels }) {
|
|
14
|
+
this.#labels = labels;
|
|
15
|
+
}
|
|
9
16
|
compare(stated, testCase) {
|
|
10
17
|
return new LabelComparison({
|
|
11
|
-
stated: new Set(LabelComparer.#
|
|
18
|
+
stated: new Set(LabelComparer.#stated(stated, testCase)),
|
|
12
19
|
expected: testCase.expected,
|
|
20
|
+
labels: this.#labels,
|
|
13
21
|
});
|
|
14
22
|
}
|
|
15
|
-
static #
|
|
23
|
+
static #stated(stated, testCase) {
|
|
16
24
|
if (Array.isArray(stated) && stated.every(isLabel))
|
|
17
25
|
return stated;
|
|
18
26
|
if (typeof stated === 'number' && isLabel(stated))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-comparer.js","sourceRoot":"","sources":["../../src/classification/label-comparer.ts"],"names":[],"m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|
|
4
5
|
readonly expected: ReadonlySet<Label>;
|
|
5
|
-
constructor({ stated, expected, }: {
|
|
6
|
+
constructor({ stated, expected, labels, }: {
|
|
6
7
|
readonly stated: ReadonlySet<Label>;
|
|
7
8
|
readonly expected: ReadonlySet<Label>;
|
|
9
|
+
readonly labels: readonly Label[];
|
|
8
10
|
});
|
|
9
11
|
labels(): Label[];
|
|
10
12
|
only(label: Label): LabelComparison;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-comparison.d.ts","sourceRoot":"","sources":["../../src/classification/label-comparison.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"label-comparison.d.ts","sourceRoot":"","sources":["../../src/classification/label-comparison.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAKxC,qBAAa,eAAe;;IAC1B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;gBAG1B,EACV,MAAM,EACN,QAAQ,EACR,MAAM,GACP,EAAE;QACD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;QACpC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;QACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;KACnC;IAOD,MAAM,IAAI,KAAK,EAAE;IAMjB,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe;CAQpC"}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
1
|
+
// The stated labels of one answer, the expected labels of its case, and the
|
|
2
|
+
// class set: the classes of the task, in the order that the caller gives
|
|
3
|
+
// (scikit-learn's labels). A label outside the class set counts in no class.
|
|
3
4
|
export class LabelComparison {
|
|
4
5
|
stated;
|
|
5
6
|
expected;
|
|
6
|
-
|
|
7
|
+
#labels;
|
|
8
|
+
constructor({ stated, expected, labels, }) {
|
|
7
9
|
this.stated = stated;
|
|
8
10
|
this.expected = expected;
|
|
11
|
+
this.#labels = labels;
|
|
9
12
|
}
|
|
10
|
-
// The
|
|
13
|
+
// The class set, in the order that the caller gives.
|
|
11
14
|
labels() {
|
|
12
|
-
return [...this
|
|
15
|
+
return [...this.#labels];
|
|
13
16
|
}
|
|
14
|
-
// The comparison of one class:
|
|
17
|
+
// The comparison of one class: its class set is [label], and each side
|
|
18
|
+
// keeps the label when it has it.
|
|
15
19
|
only(label) {
|
|
16
20
|
const one = new Set([label]);
|
|
17
21
|
return new LabelComparison({
|
|
18
22
|
stated: this.stated.intersection(one),
|
|
19
23
|
expected: this.expected.intersection(one),
|
|
24
|
+
labels: [label],
|
|
20
25
|
});
|
|
21
26
|
}
|
|
22
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label-comparison.js","sourceRoot":"","sources":["../../src/classification/label-comparison.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"label-comparison.js","sourceRoot":"","sources":["../../src/classification/label-comparison.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,MAAM,OAAO,eAAe;IACjB,MAAM,CAAqB;IAC3B,QAAQ,CAAqB;IAC7B,OAAO,CAAmB;IAEnC,YAAY,EACV,MAAM,EACN,QAAQ,EACR,MAAM,GAKP;QACC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,qDAAqD;IACrD,MAAM;QACJ,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,uEAAuE;IACvE,kCAAkC;IAClC,IAAI,CAAC,KAAY;QACf,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7B,OAAO,IAAI,eAAe,CAAC;YACzB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC;YACrC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC;YACzC,MAAM,EAAE,CAAC,KAAK,CAAC;SAChB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Counts } from '../aggregation/counts.ts';
|
|
2
2
|
import type { Average, Classes } from './average.ts';
|
|
3
3
|
export declare class MacroAverage implements Average {
|
|
4
|
-
of(
|
|
4
|
+
of(classes: Classes, score: (counts: Counts) => number): number;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=macro-average.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macro-average.d.ts","sourceRoot":"","sources":["../../src/classification/macro-average.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKrD,qBAAa,YAAa,YAAW,OAAO;IAC1C,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"macro-average.d.ts","sourceRoot":"","sources":["../../src/classification/macro-average.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKrD,qBAAa,YAAa,YAAW,OAAO;IAC1C,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM;CAOhE"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { sum } from '@zukhruf/statistics';
|
|
2
|
-
// average='macro': the mean of the scores of the
|
|
2
|
+
// average='macro': the mean of the scores of the classes, as
|
|
3
3
|
// numpy's nanmean gives it: a NaN score (zeroDivision NaN) adds 0 and is not
|
|
4
4
|
// counted, and the mean of no score is NaN.
|
|
5
5
|
export class MacroAverage {
|
|
6
|
-
of(
|
|
7
|
-
const scores = [...
|
|
6
|
+
of(classes, score) {
|
|
7
|
+
const scores = [...classes.counts.values()].map(score);
|
|
8
8
|
const counted = scores.filter((value) => !Number.isNaN(value)).length;
|
|
9
9
|
if (counted === 0)
|
|
10
10
|
return Number.NaN;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macro-average.js","sourceRoot":"","sources":["../../src/classification/macro-average.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAK1C,
|
|
1
|
+
{"version":3,"file":"macro-average.js","sourceRoot":"","sources":["../../src/classification/macro-average.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAK1C,6DAA6D;AAC7D,6EAA6E;AAC7E,4CAA4C;AAC5C,MAAM,OAAO,YAAY;IACvB,EAAE,CAAC,OAAgB,EAAE,KAAiC;QACpD,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACtE,IAAI,OAAO,KAAK,CAAC;YAAE,OAAO,MAAM,CAAC,GAAG,CAAC;QACrC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACxE,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Counts } from '../aggregation/counts.ts';
|
|
2
2
|
import type { Average, Classes } from './average.ts';
|
|
3
3
|
export declare class MicroAverage implements Average {
|
|
4
|
-
of(
|
|
4
|
+
of(classes: Classes, score: (counts: Counts) => number): number;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=micro-average.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"micro-average.d.ts","sourceRoot":"","sources":["../../src/classification/micro-average.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIrD,qBAAa,YAAa,YAAW,OAAO;IAC1C,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"micro-average.d.ts","sourceRoot":"","sources":["../../src/classification/micro-average.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIrD,qBAAa,YAAa,YAAW,OAAO;IAC1C,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM;CAWhE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { sum } from '@zukhruf/statistics';
|
|
2
2
|
import { Counts } from "../aggregation/counts.js";
|
|
3
|
-
// average='micro': the counts of the
|
|
3
|
+
// average='micro': the counts of the classes are added, with numpy's
|
|
4
4
|
// pairwise sum, and scored once.
|
|
5
5
|
export class MicroAverage {
|
|
6
|
-
of(
|
|
7
|
-
const
|
|
8
|
-
const total = (count) => sum(
|
|
6
|
+
of(classes, score) {
|
|
7
|
+
const each = [...classes.counts.values()];
|
|
8
|
+
const total = (count) => sum(each.map(count));
|
|
9
9
|
return score(new Counts({
|
|
10
10
|
hits: total(({ hits }) => hits),
|
|
11
11
|
stated: total(({ stated }) => stated),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"micro-average.js","sourceRoot":"","sources":["../../src/classification/micro-average.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,
|
|
1
|
+
{"version":3,"file":"micro-average.js","sourceRoot":"","sources":["../../src/classification/micro-average.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,qEAAqE;AACrE,iCAAiC;AACjC,MAAM,OAAO,YAAY;IACvB,EAAE,CAAC,OAAgB,EAAE,KAAiC;QACpD,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAG,CAAC,KAAiC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1E,OAAO,KAAK,CACV,IAAI,MAAM,CAAC;YACT,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;YAC/B,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC;YACrC,QAAQ,EAAE,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC;SAC5C,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type { Scorer } from '../scorers/scorer.ts';
|
|
2
1
|
import { Grouped } from '../scoring/grouped.ts';
|
|
3
2
|
import type { LabelComparison } from './label-comparison.ts';
|
|
4
|
-
import type { Label } from './label.ts';
|
|
5
3
|
export declare class PerClass extends Grouped<LabelComparison> {
|
|
6
|
-
#private;
|
|
7
|
-
constructor(scorer: Scorer<LabelComparison>, { labels }?: {
|
|
8
|
-
readonly labels?: readonly Label[];
|
|
9
|
-
});
|
|
10
4
|
protected groups(comparison: LabelComparison): Iterable<[string, LabelComparison]>;
|
|
11
5
|
}
|
|
12
6
|
//# sourceMappingURL=per-class.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"per-class.d.ts","sourceRoot":"","sources":["../../src/classification/per-class.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"per-class.d.ts","sourceRoot":"","sources":["../../src/classification/per-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK7D,qBAAa,QAAS,SAAQ,OAAO,CAAC,eAAe,CAAC;IACpD,SAAS,CAAE,MAAM,CACf,UAAU,EAAE,eAAe,GAC1B,QAAQ,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAIvC"}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { Grouped } from "../scoring/grouped.js";
|
|
2
|
-
// A scorer for each class of a comparison: in a ScorerSet,
|
|
3
|
-
// of its scorer on the comparison of each class, under the
|
|
4
|
-
// `${class} ${label}
|
|
5
|
-
// sides of the answer; with labels, only those classes.
|
|
2
|
+
// A scorer for each class of the class set of a comparison: in a ScorerSet,
|
|
3
|
+
// it gives the ratio of its scorer on the comparison of each class, under the
|
|
4
|
+
// label `${class} ${label}`, in the order of the class set.
|
|
6
5
|
export class PerClass extends Grouped {
|
|
7
|
-
#labels;
|
|
8
|
-
constructor(scorer, { labels } = {}) {
|
|
9
|
-
super(scorer);
|
|
10
|
-
this.#labels = labels;
|
|
11
|
-
}
|
|
12
6
|
*groups(comparison) {
|
|
13
|
-
for (const label of
|
|
7
|
+
for (const label of comparison.labels())
|
|
14
8
|
yield [`${label}`, comparison.only(label)];
|
|
15
9
|
}
|
|
16
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"per-class.js","sourceRoot":"","sources":["../../src/classification/per-class.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"per-class.js","sourceRoot":"","sources":["../../src/classification/per-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD,4EAA4E;AAC5E,8EAA8E;AAC9E,4DAA4D;AAC5D,MAAM,OAAO,QAAS,SAAQ,OAAwB;IAC1C,CAAC,MAAM,CACf,UAA2B;QAE3B,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,MAAM,EAAE;YACrC,MAAM,CAAC,GAAG,KAAK,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Counts } from '../aggregation/counts.ts';
|
|
2
2
|
import type { Average, Classes } from './average.ts';
|
|
3
3
|
export declare class WeightedAverage implements Average {
|
|
4
|
-
of(
|
|
4
|
+
of(classes: Classes, score: (counts: Counts) => number): number;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=weighted-average.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weighted-average.d.ts","sourceRoot":"","sources":["../../src/classification/weighted-average.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAMrD,qBAAa,eAAgB,YAAW,OAAO;IAC7C,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"weighted-average.d.ts","sourceRoot":"","sources":["../../src/classification/weighted-average.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAMrD,qBAAa,eAAgB,YAAW,OAAO;IAC7C,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM;CAShE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { sum } from '@zukhruf/statistics';
|
|
2
|
-
// average='weighted': the mean of the scores of the
|
|
2
|
+
// average='weighted': the mean of the scores of the classes, each
|
|
3
3
|
// weighted by its true count, as scikit-learn's _nanaverage gives it: a NaN
|
|
4
4
|
// score is dropped with its weight, the mean of no score is NaN, and when the
|
|
5
5
|
// weights add up to 0 it is the plain mean.
|
|
6
6
|
export class WeightedAverage {
|
|
7
|
-
of(
|
|
8
|
-
const kept = [...
|
|
7
|
+
of(classes, score) {
|
|
8
|
+
const kept = [...classes.counts.values()]
|
|
9
9
|
.map((counts) => ({ value: score(counts), weight: counts.expected }))
|
|
10
10
|
.filter(({ value }) => !Number.isNaN(value));
|
|
11
11
|
if (kept.length === 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weighted-average.js","sourceRoot":"","sources":["../../src/classification/weighted-average.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAK1C,
|
|
1
|
+
{"version":3,"file":"weighted-average.js","sourceRoot":"","sources":["../../src/classification/weighted-average.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAK1C,kEAAkE;AAClE,4EAA4E;AAC5E,8EAA8E;AAC9E,4CAA4C;AAC5C,MAAM,OAAO,eAAe;IAC1B,EAAE,CAAC,OAAgB,EAAE,KAAiC;QACpD,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;aACtC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;aACpE,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,MAAM,CAAC,GAAG,CAAC;QACzC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACtD,IAAI,OAAO,KAAK,CAAC;YAAE,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAC5E,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;IACxE,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export type { Check, Scorecard } from './scoring/scorecard.ts';
|
|
|
6
6
|
export type { CaseReader, ScorecardScorer, Weighted, } from './scoring/scorecard-scorer.ts';
|
|
7
7
|
export { Totals } from './scoring/totals.ts';
|
|
8
8
|
export { Bootstrap, type WeightedScorecard } from './scoring/bootstrap.ts';
|
|
9
|
+
export { Run } from './scoring/run.ts';
|
|
10
|
+
export { PairedBootstrap, type Verdict } from './scoring/paired-bootstrap.ts';
|
|
9
11
|
export type { Scorer } from './scorers/scorer.ts';
|
|
10
12
|
export type { Matches } from './scorers/matches.ts';
|
|
11
13
|
export { Precision } from './scorers/precision.ts';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EACL,UAAU,EACV,KAAK,YAAY,EACjB,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EACV,UAAU,EACV,eAAe,EACf,QAAQ,GACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,SAAS,EAA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AO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,YAAY,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,8 @@ export { Counts } from "./aggregation/counts.js";
|
|
|
4
4
|
export { CountsForm, PrecisionRecallForm, } from "./aggregation/f-measure-form.js";
|
|
5
5
|
export { Totals } from "./scoring/totals.js";
|
|
6
6
|
export { Bootstrap } from "./scoring/bootstrap.js";
|
|
7
|
+
export { Run } from "./scoring/run.js";
|
|
8
|
+
export { PairedBootstrap } from "./scoring/paired-bootstrap.js";
|
|
7
9
|
export { Precision } from "./scorers/precision.js";
|
|
8
10
|
export { Recall } from "./scorers/recall.js";
|
|
9
11
|
export { FBeta } from "./scorers/f-beta.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAA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AAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class FailedCall {
|
|
2
|
+
static readonly answer = "null";
|
|
3
|
+
readonly reason: string;
|
|
4
|
+
constructor(reason: string);
|
|
5
|
+
response(metadata?: Readonly<Record<string, unknown>>): FailedCallResponse;
|
|
6
|
+
}
|
|
7
|
+
export type FailedCallResponse = {
|
|
8
|
+
readonly output: typeof FailedCall.answer;
|
|
9
|
+
readonly metadata: Readonly<Record<string, unknown>> & {
|
|
10
|
+
readonly failed: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=failed-call.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failed-call.d.ts","sourceRoot":"","sources":["../../src/promptfoo/failed-call.ts"],"names":[],"mappings":"AAQA,qBAAa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,MAAM,UAAU;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;IAM1B,QAAQ,CACN,QAAQ,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM,GAC/C,kBAAkB;CAMtB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO,UAAU,CAAC,MAAM,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;QACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// What a provider returns for a model call that failed for its one test,
|
|
2
|
+
// also after its retries (ADR 0005): the answer null. promptfoo 0.125.1
|
|
3
|
+
// grades no result whose provider gave an error or no output
|
|
4
|
+
// (dist/src/evaluator-BxCmvGtv.js:7940-7952), so that case would add nothing
|
|
5
|
+
// to the wholes and the recall would go up. promptfoo grades the answer null,
|
|
6
|
+
// and each family reads it as no answer. A failure of the run, such as a 401,
|
|
7
|
+
// is thrown instead, so the result stays an error result that promptfoo
|
|
8
|
+
// retry runs again.
|
|
9
|
+
export class FailedCall {
|
|
10
|
+
static answer = 'null';
|
|
11
|
+
reason;
|
|
12
|
+
constructor(reason) {
|
|
13
|
+
this.reason = reason;
|
|
14
|
+
}
|
|
15
|
+
// promptfoo's ProviderResponse of the failed call: the answer null, and the
|
|
16
|
+
// metadata of the provider with the reason under `failed`.
|
|
17
|
+
response(metadata = {}) {
|
|
18
|
+
return {
|
|
19
|
+
output: FailedCall.answer,
|
|
20
|
+
metadata: { ...metadata, failed: this.reason },
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=failed-call.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failed-call.js","sourceRoot":"","sources":["../../src/promptfoo/failed-call.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,6DAA6D;AAC7D,6EAA6E;AAC7E,8EAA8E;AAC9E,8EAA8E;AAC9E,wEAAwE;AACxE,oBAAoB;AACpB,MAAM,OAAO,UAAU;IACrB,MAAM,CAAU,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,CAAS;IAExB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,4EAA4E;IAC5E,2DAA2D;IAC3D,QAAQ,CACN,WAA8C,EAAE;QAEhD,OAAO;YACL,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SAC/C,CAAC;IACJ,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { AssertionModule, type FileAssertion, type ModuleAssertion, type VarsContext, } from './assertion-module.ts';
|
|
2
2
|
export { type AssertionContext, type GradingResult, PromptfooAssertion, } from './promptfoo-assertion.ts';
|
|
3
3
|
export { ScorerAssertion } from './scorer-assertion.ts';
|
|
4
|
+
export { FailedCall, type FailedCallResponse } from './failed-call.ts';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/promptfoo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/promptfoo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/promptfoo/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/promptfoo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/promptfoo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAA2B,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Ratio } from '../aggregation/ratio.ts';
|
|
2
2
|
import type { Scorer } from '../scorers/scorer.ts';
|
|
3
|
-
export declare abstract class Grouped<Input> {
|
|
3
|
+
export declare abstract class Grouped<Input, Group = Input> {
|
|
4
4
|
#private;
|
|
5
|
-
constructor(scorer: Scorer<
|
|
6
|
-
protected abstract groups(input: Input): Iterable<[string,
|
|
5
|
+
constructor(scorer: Scorer<Group>);
|
|
6
|
+
protected abstract groups(input: Input): Iterable<[string, Group]>;
|
|
7
7
|
ratios(input: Input, label: string): [string, Ratio][];
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=grouped.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouped.d.ts","sourceRoot":"","sources":["../../src/scoring/grouped.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"grouped.d.ts","sourceRoot":"","sources":["../../src/scoring/grouped.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAUnD,8BAAsB,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;;gBAGpC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;IAIjC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAElE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;CAQvD"}
|
package/dist/scoring/grouped.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
// A scorer for each group of an input: in a ScorerSet, it gives the ratio of
|
|
2
|
-
// its scorer on each group, under the label `${group} ${label}
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
2
|
+
// its scorer on each group, under the label `${group} ${label}`, and stays
|
|
3
|
+
// out of the score of the record, as a breakdown is not a score of its own.
|
|
4
|
+
// A subclass gives the groups (Template Method): a part of the input, such as
|
|
5
|
+
// one class, or a projection of it, such as the stated items of one kind. A
|
|
6
|
+
// group gives no ratio when the scorer counts nothing in it (the whole 0): a
|
|
7
|
+
// ratio with the whole 0 adds nothing to a ratio of sums, so the totals stay
|
|
8
|
+
// the same.
|
|
6
9
|
export class Grouped {
|
|
7
10
|
#scorer;
|
|
8
11
|
constructor(scorer) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouped.js","sourceRoot":"","sources":["../../src/scoring/grouped.ts"],"names":[],"mappings":"AAGA,6EAA6E;AAC7E,4EAA4E;AAC5E,
|
|
1
|
+
{"version":3,"file":"grouped.js","sourceRoot":"","sources":["../../src/scoring/grouped.ts"],"names":[],"mappings":"AAGA,6EAA6E;AAC7E,2EAA2E;AAC3E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,YAAY;AACZ,MAAM,OAAgB,OAAO;IAClB,OAAO,CAAgB;IAEhC,YAAY,MAAqB;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAID,MAAM,CAAC,KAAY,EAAE,KAAa;QAChC,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC3B,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,EAAmB,EAAE,CAAC;YACvC,GAAG,KAAK,IAAI,KAAK,EAAE;YACnB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;SACzB,CAAC;aACD,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ConfidenceIntervalMethod, DifferenceInterval } from '@zukhruf/statistics';
|
|
2
|
+
import { type Run } from './run.ts';
|
|
3
|
+
export type Verdict = {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly result: 'better' | 'worse' | 'inconclusive';
|
|
6
|
+
readonly difference: DifferenceInterval;
|
|
7
|
+
readonly p: number;
|
|
8
|
+
readonly improvements: number;
|
|
9
|
+
readonly regressions: number;
|
|
10
|
+
readonly ties: number;
|
|
11
|
+
readonly tests: number;
|
|
12
|
+
};
|
|
13
|
+
export declare class PairedBootstrap {
|
|
14
|
+
#private;
|
|
15
|
+
constructor({ nResamples, randomIndex, interval, }: {
|
|
16
|
+
readonly nResamples: number;
|
|
17
|
+
readonly randomIndex: (n: number) => number;
|
|
18
|
+
readonly interval: ConfidenceIntervalMethod;
|
|
19
|
+
});
|
|
20
|
+
verdict(baseline: Run, change: Run, name: string, { higherIsBetter }: {
|
|
21
|
+
readonly higherIsBetter: boolean;
|
|
22
|
+
}): Verdict;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=paired-bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paired-bootstrap.d.ts","sourceRoot":"","sources":["../../src/scoring/paired-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,kBAAkB,EAEnB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,UAAU,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,GAAG,cAAc,CAAC;IAErD,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IAExC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAgBF,qBAAa,eAAe;;gBAKd,EACV,UAAU,EACV,WAAW,EACX,QAAQ,GACT,EAAE;QACD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;QAC5C,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;KAC7C;IAMD,OAAO,CACL,QAAQ,EAAE,GAAG,EACb,MAAM,EAAE,GAAG,EACX,IAAI,EAAE,MAAM,EACZ,EAAE,cAAc,EAAE,EAAE;QAAE,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;KAAE,GACvD,OAAO;CA8GX"}
|