deepbox 0.1.0
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/LICENSE +21 -0
- package/README.md +344 -0
- package/dist/CSRMatrix-CwGwQRea.d.cts +219 -0
- package/dist/CSRMatrix-KzNt6QpS.d.ts +219 -0
- package/dist/Tensor-BQLk1ltW.d.cts +147 -0
- package/dist/Tensor-g8mUClel.d.ts +147 -0
- package/dist/chunk-4S73VUBD.js +677 -0
- package/dist/chunk-4S73VUBD.js.map +1 -0
- package/dist/chunk-5R4S63PF.js +2925 -0
- package/dist/chunk-5R4S63PF.js.map +1 -0
- package/dist/chunk-6AE5FKKQ.cjs +9264 -0
- package/dist/chunk-6AE5FKKQ.cjs.map +1 -0
- package/dist/chunk-AD436M45.js +3854 -0
- package/dist/chunk-AD436M45.js.map +1 -0
- package/dist/chunk-ALS7ETWZ.cjs +4263 -0
- package/dist/chunk-ALS7ETWZ.cjs.map +1 -0
- package/dist/chunk-AU7XHGKJ.js +2092 -0
- package/dist/chunk-AU7XHGKJ.js.map +1 -0
- package/dist/chunk-B5TNKUEY.js +1481 -0
- package/dist/chunk-B5TNKUEY.js.map +1 -0
- package/dist/chunk-BCR7G3A6.js +9136 -0
- package/dist/chunk-BCR7G3A6.js.map +1 -0
- package/dist/chunk-C4PKXY74.cjs +1917 -0
- package/dist/chunk-C4PKXY74.cjs.map +1 -0
- package/dist/chunk-DWZY6PIP.cjs +6400 -0
- package/dist/chunk-DWZY6PIP.cjs.map +1 -0
- package/dist/chunk-E3EU5FZO.cjs +2113 -0
- package/dist/chunk-E3EU5FZO.cjs.map +1 -0
- package/dist/chunk-F3JWBINJ.js +1054 -0
- package/dist/chunk-F3JWBINJ.js.map +1 -0
- package/dist/chunk-FJYLIGJX.js +1940 -0
- package/dist/chunk-FJYLIGJX.js.map +1 -0
- package/dist/chunk-JSCDE774.cjs +729 -0
- package/dist/chunk-JSCDE774.cjs.map +1 -0
- package/dist/chunk-LWECRCW2.cjs +2412 -0
- package/dist/chunk-LWECRCW2.cjs.map +1 -0
- package/dist/chunk-MLBMYKCG.js +6379 -0
- package/dist/chunk-MLBMYKCG.js.map +1 -0
- package/dist/chunk-OX6QXFMV.cjs +3874 -0
- package/dist/chunk-OX6QXFMV.cjs.map +1 -0
- package/dist/chunk-PHV2DKRS.cjs +1072 -0
- package/dist/chunk-PHV2DKRS.cjs.map +1 -0
- package/dist/chunk-PL7TAYKI.js +4056 -0
- package/dist/chunk-PL7TAYKI.js.map +1 -0
- package/dist/chunk-PR647I7R.js +1898 -0
- package/dist/chunk-PR647I7R.js.map +1 -0
- package/dist/chunk-QERHVCHC.cjs +2960 -0
- package/dist/chunk-QERHVCHC.cjs.map +1 -0
- package/dist/chunk-XEG44RF6.cjs +1514 -0
- package/dist/chunk-XEG44RF6.cjs.map +1 -0
- package/dist/chunk-XMWVME2W.js +2377 -0
- package/dist/chunk-XMWVME2W.js.map +1 -0
- package/dist/chunk-ZB75FESB.cjs +1979 -0
- package/dist/chunk-ZB75FESB.cjs.map +1 -0
- package/dist/chunk-ZLW62TJG.cjs +4061 -0
- package/dist/chunk-ZLW62TJG.cjs.map +1 -0
- package/dist/chunk-ZXKBDFP3.js +4235 -0
- package/dist/chunk-ZXKBDFP3.js.map +1 -0
- package/dist/core/index.cjs +204 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +2 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -0
- package/dist/dataframe/index.cjs +22 -0
- package/dist/dataframe/index.cjs.map +1 -0
- package/dist/dataframe/index.d.cts +3 -0
- package/dist/dataframe/index.d.ts +3 -0
- package/dist/dataframe/index.js +5 -0
- package/dist/dataframe/index.js.map +1 -0
- package/dist/datasets/index.cjs +134 -0
- package/dist/datasets/index.cjs.map +1 -0
- package/dist/datasets/index.d.cts +3 -0
- package/dist/datasets/index.d.ts +3 -0
- package/dist/datasets/index.js +5 -0
- package/dist/datasets/index.js.map +1 -0
- package/dist/index-74AB8Cyh.d.cts +1126 -0
- package/dist/index-9oQx1HgV.d.cts +1180 -0
- package/dist/index-BJY2SI4i.d.ts +483 -0
- package/dist/index-BWGhrDlr.d.ts +733 -0
- package/dist/index-B_DK4FKY.d.cts +242 -0
- package/dist/index-BbA2Gxfl.d.ts +456 -0
- package/dist/index-BgHYAoSS.d.cts +837 -0
- package/dist/index-BndMbqsM.d.ts +1439 -0
- package/dist/index-C1mfVYoo.d.ts +2517 -0
- package/dist/index-CCvlwAmL.d.cts +809 -0
- package/dist/index-CDw5CnOU.d.ts +785 -0
- package/dist/index-Cn3SdB0O.d.ts +1126 -0
- package/dist/index-CrqLlS-a.d.ts +776 -0
- package/dist/index-D61yaSMY.d.cts +483 -0
- package/dist/index-D9Loo1_A.d.cts +2517 -0
- package/dist/index-DIT_OO9C.d.cts +785 -0
- package/dist/index-DIp_RrRt.d.ts +242 -0
- package/dist/index-DbultU6X.d.cts +1427 -0
- package/dist/index-DmEg_LCm.d.cts +776 -0
- package/dist/index-DoPWVxPo.d.cts +1439 -0
- package/dist/index-DuCxd-8d.d.ts +837 -0
- package/dist/index-Dx42TZaY.d.ts +809 -0
- package/dist/index-DyZ4QQf5.d.cts +456 -0
- package/dist/index-GFAVyOWO.d.ts +1427 -0
- package/dist/index-WHQLn0e8.d.cts +733 -0
- package/dist/index-ZtI1Iy4L.d.ts +1180 -0
- package/dist/index-eJgeni9c.d.cts +1911 -0
- package/dist/index-tk4lSYod.d.ts +1911 -0
- package/dist/index.cjs +72 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/linalg/index.cjs +86 -0
- package/dist/linalg/index.cjs.map +1 -0
- package/dist/linalg/index.d.cts +3 -0
- package/dist/linalg/index.d.ts +3 -0
- package/dist/linalg/index.js +5 -0
- package/dist/linalg/index.js.map +1 -0
- package/dist/metrics/index.cjs +158 -0
- package/dist/metrics/index.cjs.map +1 -0
- package/dist/metrics/index.d.cts +3 -0
- package/dist/metrics/index.d.ts +3 -0
- package/dist/metrics/index.js +5 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/ml/index.cjs +87 -0
- package/dist/ml/index.cjs.map +1 -0
- package/dist/ml/index.d.cts +3 -0
- package/dist/ml/index.d.ts +3 -0
- package/dist/ml/index.js +6 -0
- package/dist/ml/index.js.map +1 -0
- package/dist/ndarray/index.cjs +501 -0
- package/dist/ndarray/index.cjs.map +1 -0
- package/dist/ndarray/index.d.cts +5 -0
- package/dist/ndarray/index.d.ts +5 -0
- package/dist/ndarray/index.js +4 -0
- package/dist/ndarray/index.js.map +1 -0
- package/dist/nn/index.cjs +142 -0
- package/dist/nn/index.cjs.map +1 -0
- package/dist/nn/index.d.cts +6 -0
- package/dist/nn/index.d.ts +6 -0
- package/dist/nn/index.js +5 -0
- package/dist/nn/index.js.map +1 -0
- package/dist/optim/index.cjs +77 -0
- package/dist/optim/index.cjs.map +1 -0
- package/dist/optim/index.d.cts +4 -0
- package/dist/optim/index.d.ts +4 -0
- package/dist/optim/index.js +4 -0
- package/dist/optim/index.js.map +1 -0
- package/dist/plot/index.cjs +114 -0
- package/dist/plot/index.cjs.map +1 -0
- package/dist/plot/index.d.cts +6 -0
- package/dist/plot/index.d.ts +6 -0
- package/dist/plot/index.js +5 -0
- package/dist/plot/index.js.map +1 -0
- package/dist/preprocess/index.cjs +82 -0
- package/dist/preprocess/index.cjs.map +1 -0
- package/dist/preprocess/index.d.cts +4 -0
- package/dist/preprocess/index.d.ts +4 -0
- package/dist/preprocess/index.js +5 -0
- package/dist/preprocess/index.js.map +1 -0
- package/dist/random/index.cjs +74 -0
- package/dist/random/index.cjs.map +1 -0
- package/dist/random/index.d.cts +3 -0
- package/dist/random/index.d.ts +3 -0
- package/dist/random/index.js +5 -0
- package/dist/random/index.js.map +1 -0
- package/dist/stats/index.cjs +142 -0
- package/dist/stats/index.cjs.map +1 -0
- package/dist/stats/index.d.cts +3 -0
- package/dist/stats/index.d.ts +3 -0
- package/dist/stats/index.js +5 -0
- package/dist/stats/index.js.map +1 -0
- package/dist/tensor-B96jjJLQ.d.cts +205 -0
- package/dist/tensor-B96jjJLQ.d.ts +205 -0
- package/package.json +226 -0
|
@@ -0,0 +1,1514 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk6AE5FKKQ_cjs = require('./chunk-6AE5FKKQ.cjs');
|
|
4
|
+
var chunkJSCDE774_cjs = require('./chunk-JSCDE774.cjs');
|
|
5
|
+
|
|
6
|
+
// src/datasets/index.ts
|
|
7
|
+
var datasets_exports = {};
|
|
8
|
+
chunkJSCDE774_cjs.__export(datasets_exports, {
|
|
9
|
+
DataLoader: () => DataLoader,
|
|
10
|
+
loadBreastCancer: () => loadBreastCancer,
|
|
11
|
+
loadConcentricRings: () => loadConcentricRings,
|
|
12
|
+
loadCropYield: () => loadCropYield,
|
|
13
|
+
loadCustomerSegments: () => loadCustomerSegments,
|
|
14
|
+
loadDiabetes: () => loadDiabetes,
|
|
15
|
+
loadDigits: () => loadDigits,
|
|
16
|
+
loadEnergyEfficiency: () => loadEnergyEfficiency,
|
|
17
|
+
loadFitnessScores: () => loadFitnessScores,
|
|
18
|
+
loadFlowersExtended: () => loadFlowersExtended,
|
|
19
|
+
loadFruitQuality: () => loadFruitQuality,
|
|
20
|
+
loadGaussianIslands: () => loadGaussianIslands,
|
|
21
|
+
loadHousingMini: () => loadHousingMini,
|
|
22
|
+
loadIris: () => loadIris,
|
|
23
|
+
loadLeafShapes: () => loadLeafShapes,
|
|
24
|
+
loadLinnerud: () => loadLinnerud,
|
|
25
|
+
loadMoonsMulti: () => loadMoonsMulti,
|
|
26
|
+
loadPerfectlySeparable: () => loadPerfectlySeparable,
|
|
27
|
+
loadPlantGrowth: () => loadPlantGrowth,
|
|
28
|
+
loadSeedMorphology: () => loadSeedMorphology,
|
|
29
|
+
loadSensorStates: () => loadSensorStates,
|
|
30
|
+
loadSpiralArms: () => loadSpiralArms,
|
|
31
|
+
loadStudentPerformance: () => loadStudentPerformance,
|
|
32
|
+
loadTrafficConditions: () => loadTrafficConditions,
|
|
33
|
+
loadWeatherOutcomes: () => loadWeatherOutcomes,
|
|
34
|
+
makeBlobs: () => makeBlobs,
|
|
35
|
+
makeCircles: () => makeCircles,
|
|
36
|
+
makeClassification: () => makeClassification,
|
|
37
|
+
makeGaussianQuantiles: () => makeGaussianQuantiles,
|
|
38
|
+
makeMoons: () => makeMoons,
|
|
39
|
+
makeRegression: () => makeRegression
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// src/datasets/utils.ts
|
|
43
|
+
function assertPositiveInt(name, value) {
|
|
44
|
+
if (!Number.isInteger(value) || value <= 0 || !Number.isSafeInteger(value)) {
|
|
45
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
46
|
+
`${name} must be a positive safe integer; received ${value}`,
|
|
47
|
+
name,
|
|
48
|
+
value
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function assertBoolean(name, value) {
|
|
53
|
+
if (typeof value !== "boolean") {
|
|
54
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
55
|
+
`${name} must be a boolean; received ${String(value)}`,
|
|
56
|
+
name,
|
|
57
|
+
value
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function normalizeOptionalSeed(name, value) {
|
|
62
|
+
if (value === void 0) {
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
if (!Number.isFinite(value) || !Number.isInteger(value) || !Number.isSafeInteger(value)) {
|
|
66
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
67
|
+
`${name} must be a finite safe integer; received ${value}`,
|
|
68
|
+
name,
|
|
69
|
+
value
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
function createRng(seed) {
|
|
75
|
+
if (seed === void 0) return () => Math.random();
|
|
76
|
+
let state = (seed ^ 2654435769) >>> 0;
|
|
77
|
+
return () => {
|
|
78
|
+
state = state * 1664525 + 1013904223 >>> 0;
|
|
79
|
+
return state / 2 ** 32;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function normal01(rng) {
|
|
83
|
+
const u1 = Math.max(rng(), Number.EPSILON);
|
|
84
|
+
const u2 = rng();
|
|
85
|
+
return Math.sqrt(-2 * Math.log(u1)) * Math.cos(2 * Math.PI * u2);
|
|
86
|
+
}
|
|
87
|
+
function shuffleInPlace(array, rng) {
|
|
88
|
+
if (array.length <= 1) return;
|
|
89
|
+
for (let i = array.length - 1; i > 0; i--) {
|
|
90
|
+
const j = Math.floor(rng() * (i + 1));
|
|
91
|
+
const tmp = array[i];
|
|
92
|
+
const swap = array[j];
|
|
93
|
+
if (tmp === void 0 || swap === void 0) {
|
|
94
|
+
throw new chunkJSCDE774_cjs.DeepboxError(
|
|
95
|
+
`Internal error: shuffle index out of bounds (i=${i}, j=${j}, len=${array.length})`
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
array[i] = swap;
|
|
99
|
+
array[j] = tmp;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function shufflePairedInPlace(left, right, rng) {
|
|
103
|
+
if (left.length !== right.length) {
|
|
104
|
+
throw new chunkJSCDE774_cjs.DeepboxError(
|
|
105
|
+
`Internal error: array length mismatch during shuffle (${left.length} vs ${right.length})`
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
if (left.length <= 1) return;
|
|
109
|
+
for (let i = left.length - 1; i > 0; i--) {
|
|
110
|
+
const j = Math.floor(rng() * (i + 1));
|
|
111
|
+
const leftTmp = left[i];
|
|
112
|
+
const leftSwap = left[j];
|
|
113
|
+
if (leftTmp === void 0 || leftSwap === void 0) {
|
|
114
|
+
throw new chunkJSCDE774_cjs.DeepboxError(
|
|
115
|
+
`Internal error: shuffle index out of bounds (i=${i}, j=${j}, len=${left.length})`
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
left[i] = leftSwap;
|
|
119
|
+
left[j] = leftTmp;
|
|
120
|
+
const rightTmp = right[i];
|
|
121
|
+
const rightSwap = right[j];
|
|
122
|
+
if (rightTmp === void 0 || rightSwap === void 0) {
|
|
123
|
+
throw new chunkJSCDE774_cjs.DeepboxError(
|
|
124
|
+
`Internal error: shuffle index out of bounds (i=${i}, j=${j}, len=${right.length})`
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
right[i] = rightSwap;
|
|
128
|
+
right[j] = rightTmp;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// src/datasets/DataLoader.ts
|
|
133
|
+
var DataLoader = class {
|
|
134
|
+
X;
|
|
135
|
+
y;
|
|
136
|
+
batchSize;
|
|
137
|
+
shuffle;
|
|
138
|
+
dropLast;
|
|
139
|
+
indices;
|
|
140
|
+
seed;
|
|
141
|
+
nSamples;
|
|
142
|
+
constructor(X, yOrOptions, options) {
|
|
143
|
+
this.X = X;
|
|
144
|
+
let rawOpts;
|
|
145
|
+
if (yOrOptions instanceof chunk6AE5FKKQ_cjs.Tensor) {
|
|
146
|
+
this.y = yOrOptions;
|
|
147
|
+
rawOpts = options;
|
|
148
|
+
} else {
|
|
149
|
+
this.y = void 0;
|
|
150
|
+
rawOpts = yOrOptions === void 0 ? options : yOrOptions;
|
|
151
|
+
}
|
|
152
|
+
if (rawOpts !== void 0) {
|
|
153
|
+
if (rawOpts === null || typeof rawOpts !== "object" || Array.isArray(rawOpts)) {
|
|
154
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
155
|
+
"options must be an object when provided",
|
|
156
|
+
"options",
|
|
157
|
+
rawOpts
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const opts = rawOpts ?? {};
|
|
162
|
+
this.batchSize = opts.batchSize ?? 1;
|
|
163
|
+
this.shuffle = opts.shuffle ?? false;
|
|
164
|
+
this.dropLast = opts.dropLast ?? false;
|
|
165
|
+
this.seed = normalizeOptionalSeed("seed", opts.seed);
|
|
166
|
+
assertPositiveInt("batchSize", this.batchSize);
|
|
167
|
+
if (opts.shuffle !== void 0) assertBoolean("shuffle", this.shuffle);
|
|
168
|
+
if (opts.dropLast !== void 0) assertBoolean("dropLast", this.dropLast);
|
|
169
|
+
if (this.X.ndim === 0) {
|
|
170
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError("X must have at least 1 dimension (samples axis)", "X");
|
|
171
|
+
}
|
|
172
|
+
const nSamples = this.X.shape[0];
|
|
173
|
+
if (nSamples === void 0 || nSamples === 0) {
|
|
174
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError("X must have at least 1 sample", "X", nSamples);
|
|
175
|
+
}
|
|
176
|
+
const y = this.y;
|
|
177
|
+
if (y !== void 0) {
|
|
178
|
+
if (y.ndim === 0) {
|
|
179
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError("y must have at least 1 dimension (samples axis)", "y");
|
|
180
|
+
}
|
|
181
|
+
const ySamples = y.shape[0];
|
|
182
|
+
if (ySamples !== nSamples) {
|
|
183
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
184
|
+
`X and y must have the same number of samples; X has ${nSamples}, y has ${ySamples}`,
|
|
185
|
+
"y",
|
|
186
|
+
ySamples
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
this.nSamples = nSamples;
|
|
191
|
+
this.indices = Array.from({ length: nSamples }, (_, i) => i);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Number of batches in the data loader.
|
|
195
|
+
*/
|
|
196
|
+
get length() {
|
|
197
|
+
return this.dropLast ? Math.floor(this.nSamples / this.batchSize) : Math.ceil(this.nSamples / this.batchSize);
|
|
198
|
+
}
|
|
199
|
+
[Symbol.iterator]() {
|
|
200
|
+
return this.y === void 0 ? this.iterateX() : this.iterateXY();
|
|
201
|
+
}
|
|
202
|
+
prepareIteration() {
|
|
203
|
+
const indices = [...this.indices];
|
|
204
|
+
if (this.shuffle) {
|
|
205
|
+
const rng = createRng(this.seed);
|
|
206
|
+
shuffleInPlace(indices, rng);
|
|
207
|
+
}
|
|
208
|
+
const nBatches = this.dropLast ? Math.floor(this.nSamples / this.batchSize) : Math.ceil(this.nSamples / this.batchSize);
|
|
209
|
+
return { indices, nBatches };
|
|
210
|
+
}
|
|
211
|
+
*iterateX() {
|
|
212
|
+
const { indices, nBatches } = this.prepareIteration();
|
|
213
|
+
for (let i = 0; i < nBatches; i++) {
|
|
214
|
+
const start = i * this.batchSize;
|
|
215
|
+
const end = Math.min(start + this.batchSize, this.nSamples);
|
|
216
|
+
const batchIndices = indices.slice(start, end);
|
|
217
|
+
const indexTensor = chunk6AE5FKKQ_cjs.tensor(batchIndices, { dtype: "int32" });
|
|
218
|
+
const xBatch = chunk6AE5FKKQ_cjs.gather(this.X, indexTensor, 0);
|
|
219
|
+
yield [xBatch];
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
*iterateXY() {
|
|
223
|
+
const { indices, nBatches } = this.prepareIteration();
|
|
224
|
+
const y = this.y;
|
|
225
|
+
if (y === void 0) {
|
|
226
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError("Internal error: expected y to be defined", "y");
|
|
227
|
+
}
|
|
228
|
+
for (let i = 0; i < nBatches; i++) {
|
|
229
|
+
const start = i * this.batchSize;
|
|
230
|
+
const end = Math.min(start + this.batchSize, this.nSamples);
|
|
231
|
+
const batchIndices = indices.slice(start, end);
|
|
232
|
+
const indexTensor = chunk6AE5FKKQ_cjs.tensor(batchIndices, { dtype: "int32" });
|
|
233
|
+
const xBatch = chunk6AE5FKKQ_cjs.gather(this.X, indexTensor, 0);
|
|
234
|
+
const yBatch = chunk6AE5FKKQ_cjs.gather(y, indexTensor, 0);
|
|
235
|
+
yield [xBatch, yBatch];
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// src/datasets/generators.ts
|
|
241
|
+
function readAt(arr, index, label) {
|
|
242
|
+
if (!Number.isInteger(index) || index < 0 || index >= arr.length) {
|
|
243
|
+
throw new chunkJSCDE774_cjs.DeepboxError(`Internal error: ${label}[${index}] is out of bounds`);
|
|
244
|
+
}
|
|
245
|
+
const v = arr[index];
|
|
246
|
+
if (v === void 0) {
|
|
247
|
+
throw new chunkJSCDE774_cjs.DeepboxError(`Internal error: ${label}[${index}] is undefined`);
|
|
248
|
+
}
|
|
249
|
+
return v;
|
|
250
|
+
}
|
|
251
|
+
function readFiniteNumber(arr, index, label) {
|
|
252
|
+
const v = readAt(arr, index, label);
|
|
253
|
+
if (!Number.isFinite(v)) {
|
|
254
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError("Center coordinates must be finite", "centers", v);
|
|
255
|
+
}
|
|
256
|
+
return v;
|
|
257
|
+
}
|
|
258
|
+
function getRequired(arr, index, label) {
|
|
259
|
+
const v = arr[index];
|
|
260
|
+
if (v === void 0) {
|
|
261
|
+
throw new chunkJSCDE774_cjs.DeepboxError(`Internal error: ${label}[${index}] is undefined`);
|
|
262
|
+
}
|
|
263
|
+
return v;
|
|
264
|
+
}
|
|
265
|
+
function makeClassification(options = {}) {
|
|
266
|
+
const nSamples = options.nSamples ?? 100;
|
|
267
|
+
const nFeatures = options.nFeatures ?? 20;
|
|
268
|
+
const nInformative = options.nInformative ?? 2;
|
|
269
|
+
const nRedundant = options.nRedundant ?? 2;
|
|
270
|
+
const nClasses = options.nClasses ?? 2;
|
|
271
|
+
assertPositiveInt("nSamples", nSamples);
|
|
272
|
+
assertPositiveInt("nFeatures", nFeatures);
|
|
273
|
+
assertPositiveInt("nInformative", nInformative);
|
|
274
|
+
assertPositiveInt("nClasses", nClasses);
|
|
275
|
+
if (!Number.isInteger(nRedundant) || nRedundant < 0 || !Number.isSafeInteger(nRedundant)) {
|
|
276
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
277
|
+
`nRedundant must be a non-negative safe integer; received ${nRedundant}`,
|
|
278
|
+
"nRedundant",
|
|
279
|
+
nRedundant
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
if (nInformative > nFeatures) {
|
|
283
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
284
|
+
`nInformative (${nInformative}) cannot exceed nFeatures (${nFeatures})`,
|
|
285
|
+
"nInformative",
|
|
286
|
+
nInformative
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
if (nInformative + nRedundant > nFeatures) {
|
|
290
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
291
|
+
`nInformative + nRedundant (${nInformative + nRedundant}) cannot exceed nFeatures (${nFeatures})`,
|
|
292
|
+
"nRedundant",
|
|
293
|
+
nRedundant
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
const seed = normalizeOptionalSeed("randomState", options.randomState);
|
|
297
|
+
const rng = createRng(seed);
|
|
298
|
+
const classMeans = Array.from({ length: nClasses }, () => new Float64Array(nInformative));
|
|
299
|
+
for (let c = 0; c < nClasses; c++) {
|
|
300
|
+
const meanVec = getRequired(classMeans, c, "classMeans");
|
|
301
|
+
for (let k = 0; k < nInformative; k++) {
|
|
302
|
+
meanVec[k] = (rng() - 0.5) * 2 * nClasses;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
const weights = Array.from({ length: nRedundant }, () => new Float64Array(nInformative));
|
|
306
|
+
for (let j = 0; j < nRedundant; j++) {
|
|
307
|
+
const w = getRequired(weights, j, "weights");
|
|
308
|
+
for (let k = 0; k < nInformative; k++) {
|
|
309
|
+
w[k] = rng() - 0.5;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
const XData = new Array(nSamples);
|
|
313
|
+
const yData = new Array(nSamples);
|
|
314
|
+
const nNoise = nFeatures - nInformative - nRedundant;
|
|
315
|
+
for (let i = 0; i < nSamples; i++) {
|
|
316
|
+
const label = Math.floor(rng() * nClasses);
|
|
317
|
+
yData[i] = label;
|
|
318
|
+
const meanVec = getRequired(classMeans, label, "classMeans");
|
|
319
|
+
const row = [];
|
|
320
|
+
const informative = new Float64Array(nInformative);
|
|
321
|
+
for (let k = 0; k < nInformative; k++) {
|
|
322
|
+
const mean = readAt(meanVec, k, "meanVec");
|
|
323
|
+
const v = mean + normal01(rng);
|
|
324
|
+
informative[k] = v;
|
|
325
|
+
row.push(v);
|
|
326
|
+
}
|
|
327
|
+
for (let j = 0; j < nRedundant; j++) {
|
|
328
|
+
const w = getRequired(weights, j, "weights");
|
|
329
|
+
let val = 0;
|
|
330
|
+
for (let k = 0; k < nInformative; k++) {
|
|
331
|
+
val += readAt(informative, k, "informative") * readAt(w, k, "weights");
|
|
332
|
+
}
|
|
333
|
+
row.push(val + normal01(rng) * 0.01);
|
|
334
|
+
}
|
|
335
|
+
for (let j = 0; j < nNoise; j++) {
|
|
336
|
+
row.push(normal01(rng));
|
|
337
|
+
}
|
|
338
|
+
XData[i] = row;
|
|
339
|
+
}
|
|
340
|
+
return [chunk6AE5FKKQ_cjs.tensor(XData), chunk6AE5FKKQ_cjs.tensor(yData, { dtype: "int32" })];
|
|
341
|
+
}
|
|
342
|
+
function makeRegression(options = {}) {
|
|
343
|
+
const nSamples = options.nSamples ?? 100;
|
|
344
|
+
const nFeatures = options.nFeatures ?? 100;
|
|
345
|
+
const noiseStd = options.noise ?? 0;
|
|
346
|
+
assertPositiveInt("nSamples", nSamples);
|
|
347
|
+
assertPositiveInt("nFeatures", nFeatures);
|
|
348
|
+
if (!Number.isFinite(noiseStd) || noiseStd < 0) {
|
|
349
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
350
|
+
`noise must be a non-negative finite number; received ${noiseStd}`,
|
|
351
|
+
"noise",
|
|
352
|
+
noiseStd
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
const seed = normalizeOptionalSeed("randomState", options.randomState);
|
|
356
|
+
const rng = createRng(seed);
|
|
357
|
+
const weights = new Float64Array(nFeatures);
|
|
358
|
+
for (let j = 0; j < nFeatures; j++) {
|
|
359
|
+
weights[j] = normal01(rng);
|
|
360
|
+
}
|
|
361
|
+
const XData = new Array(nSamples);
|
|
362
|
+
const yData = new Array(nSamples);
|
|
363
|
+
for (let i = 0; i < nSamples; i++) {
|
|
364
|
+
const row = new Array(nFeatures);
|
|
365
|
+
let val = 0;
|
|
366
|
+
for (let j = 0; j < nFeatures; j++) {
|
|
367
|
+
const x = normal01(rng);
|
|
368
|
+
row[j] = x;
|
|
369
|
+
val += x * readAt(weights, j, "weights");
|
|
370
|
+
}
|
|
371
|
+
if (noiseStd > 0) val += normal01(rng) * noiseStd;
|
|
372
|
+
XData[i] = row;
|
|
373
|
+
yData[i] = val;
|
|
374
|
+
}
|
|
375
|
+
return [chunk6AE5FKKQ_cjs.tensor(XData), chunk6AE5FKKQ_cjs.tensor(yData)];
|
|
376
|
+
}
|
|
377
|
+
function makeBlobs(options = {}) {
|
|
378
|
+
const nSamples = options.nSamples ?? 100;
|
|
379
|
+
const clusterStd = options.clusterStd ?? 1;
|
|
380
|
+
const shuffle = options.shuffle ?? true;
|
|
381
|
+
assertPositiveInt("nSamples", nSamples);
|
|
382
|
+
if (!Number.isFinite(clusterStd) || clusterStd <= 0) {
|
|
383
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
384
|
+
`clusterStd must be positive; received ${clusterStd}`,
|
|
385
|
+
"clusterStd",
|
|
386
|
+
clusterStd
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
assertBoolean("shuffle", shuffle);
|
|
390
|
+
const centersInput = options.centers === void 0 ? 3 : options.centers;
|
|
391
|
+
const seed = normalizeOptionalSeed("randomState", options.randomState);
|
|
392
|
+
const rng = createRng(seed);
|
|
393
|
+
let nFeatures;
|
|
394
|
+
let centerLocations;
|
|
395
|
+
if (typeof centersInput === "number") {
|
|
396
|
+
assertPositiveInt("centers", centersInput);
|
|
397
|
+
const nFeat = options.nFeatures ?? 2;
|
|
398
|
+
assertPositiveInt("nFeatures", nFeat);
|
|
399
|
+
nFeatures = nFeat;
|
|
400
|
+
centerLocations = Array.from({ length: centersInput }, () => {
|
|
401
|
+
const c = new Float64Array(nFeat);
|
|
402
|
+
for (let j = 0; j < nFeat; j++) c[j] = (rng() - 0.5) * 20;
|
|
403
|
+
return c;
|
|
404
|
+
});
|
|
405
|
+
} else if (Array.isArray(centersInput)) {
|
|
406
|
+
if (centersInput.length === 0) {
|
|
407
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError("centers cannot be empty", "centers");
|
|
408
|
+
}
|
|
409
|
+
const firstCenter = centersInput[0];
|
|
410
|
+
if (!Array.isArray(firstCenter) || firstCenter.length === 0) {
|
|
411
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError("centers must be a non-empty array of arrays", "centers");
|
|
412
|
+
}
|
|
413
|
+
nFeatures = options.nFeatures ?? firstCenter.length;
|
|
414
|
+
assertPositiveInt("nFeatures", nFeatures);
|
|
415
|
+
centerLocations = centersInput.map((c) => {
|
|
416
|
+
if (!Array.isArray(c) || c.length !== nFeatures) {
|
|
417
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
418
|
+
`Center dimension mismatch. Expected ${nFeatures}; received ${Array.isArray(c) ? c.length : 0}`,
|
|
419
|
+
"centers",
|
|
420
|
+
c
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
const out = new Float64Array(nFeatures);
|
|
424
|
+
for (let j = 0; j < nFeatures; j++) {
|
|
425
|
+
out[j] = readFiniteNumber(c, j, "centers");
|
|
426
|
+
}
|
|
427
|
+
return out;
|
|
428
|
+
});
|
|
429
|
+
} else {
|
|
430
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError("centers must be an int or an array of arrays", "centers");
|
|
431
|
+
}
|
|
432
|
+
const nCenters = centerLocations.length;
|
|
433
|
+
const base = Math.floor(nSamples / nCenters);
|
|
434
|
+
const remainder = nSamples % nCenters;
|
|
435
|
+
const XData = [];
|
|
436
|
+
const yData = [];
|
|
437
|
+
for (let c = 0; c < nCenters; c++) {
|
|
438
|
+
const nC = base + (c < remainder ? 1 : 0);
|
|
439
|
+
const center = getRequired(centerLocations, c, "centerLocations");
|
|
440
|
+
for (let i = 0; i < nC; i++) {
|
|
441
|
+
const row = new Array(nFeatures);
|
|
442
|
+
for (let j = 0; j < nFeatures; j++) {
|
|
443
|
+
row[j] = readAt(center, j, "center") + normal01(rng) * clusterStd;
|
|
444
|
+
}
|
|
445
|
+
XData.push(row);
|
|
446
|
+
yData.push(c);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
if (shuffle) shufflePairedInPlace(XData, yData, rng);
|
|
450
|
+
return [chunk6AE5FKKQ_cjs.tensor(XData), chunk6AE5FKKQ_cjs.tensor(yData, { dtype: "int32" })];
|
|
451
|
+
}
|
|
452
|
+
function makeMoons(options = {}) {
|
|
453
|
+
const nSamples = options.nSamples ?? 100;
|
|
454
|
+
const noiseStd = options.noise ?? 0;
|
|
455
|
+
const shuffle = options.shuffle ?? true;
|
|
456
|
+
assertPositiveInt("nSamples", nSamples);
|
|
457
|
+
if (!Number.isFinite(noiseStd) || noiseStd < 0) {
|
|
458
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
459
|
+
`noise must be a non-negative finite number; received ${noiseStd}`,
|
|
460
|
+
"noise",
|
|
461
|
+
noiseStd
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
assertBoolean("shuffle", shuffle);
|
|
465
|
+
const seed = normalizeOptionalSeed("randomState", options.randomState);
|
|
466
|
+
const rng = createRng(seed);
|
|
467
|
+
const samplesFirst = Math.ceil(nSamples / 2);
|
|
468
|
+
const samplesSecond = nSamples - samplesFirst;
|
|
469
|
+
const XData = [];
|
|
470
|
+
const yData = [];
|
|
471
|
+
for (let i = 0; i < samplesFirst; i++) {
|
|
472
|
+
const angle = Math.PI * (i / samplesFirst);
|
|
473
|
+
const x = Math.cos(angle) + normal01(rng) * noiseStd;
|
|
474
|
+
const y = Math.sin(angle) + normal01(rng) * noiseStd;
|
|
475
|
+
XData.push([x, y]);
|
|
476
|
+
yData.push(0);
|
|
477
|
+
}
|
|
478
|
+
for (let i = 0; i < samplesSecond; i++) {
|
|
479
|
+
const angle = Math.PI * (i / samplesSecond);
|
|
480
|
+
const x = 1 - Math.cos(angle) + normal01(rng) * noiseStd;
|
|
481
|
+
const y = 0.5 - Math.sin(angle) + normal01(rng) * noiseStd;
|
|
482
|
+
XData.push([x, y]);
|
|
483
|
+
yData.push(1);
|
|
484
|
+
}
|
|
485
|
+
if (shuffle) shufflePairedInPlace(XData, yData, rng);
|
|
486
|
+
return [chunk6AE5FKKQ_cjs.tensor(XData), chunk6AE5FKKQ_cjs.tensor(yData, { dtype: "int32" })];
|
|
487
|
+
}
|
|
488
|
+
function makeCircles(options = {}) {
|
|
489
|
+
const nSamples = options.nSamples ?? 100;
|
|
490
|
+
const noiseStd = options.noise ?? 0;
|
|
491
|
+
const factor = options.factor ?? 0.8;
|
|
492
|
+
const shuffle = options.shuffle ?? true;
|
|
493
|
+
assertPositiveInt("nSamples", nSamples);
|
|
494
|
+
if (!Number.isFinite(noiseStd) || noiseStd < 0) {
|
|
495
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
496
|
+
`noise must be a non-negative finite number; received ${noiseStd}`,
|
|
497
|
+
"noise",
|
|
498
|
+
noiseStd
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
if (!Number.isFinite(factor) || factor <= 0 || factor >= 1) {
|
|
502
|
+
throw new chunkJSCDE774_cjs.InvalidParameterError(
|
|
503
|
+
`factor must be in (0, 1); received ${factor}`,
|
|
504
|
+
"factor",
|
|
505
|
+
factor
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
assertBoolean("shuffle", shuffle);
|
|
509
|
+
const seed = normalizeOptionalSeed("randomState", options.randomState);
|
|
510
|
+
const rng = createRng(seed);
|
|
511
|
+
const samplesOuter = Math.ceil(nSamples / 2);
|
|
512
|
+
const samplesInner = nSamples - samplesOuter;
|
|
513
|
+
const XData = [];
|
|
514
|
+
const yData = [];
|
|
515
|
+
for (let i = 0; i < samplesOuter; i++) {
|
|
516
|
+
const angle = 2 * Math.PI * (i / samplesOuter);
|
|
517
|
+
const x = Math.cos(angle) + normal01(rng) * noiseStd;
|
|
518
|
+
const y = Math.sin(angle) + normal01(rng) * noiseStd;
|
|
519
|
+
XData.push([x, y]);
|
|
520
|
+
yData.push(0);
|
|
521
|
+
}
|
|
522
|
+
for (let i = 0; i < samplesInner; i++) {
|
|
523
|
+
const angle = 2 * Math.PI * (i / samplesInner);
|
|
524
|
+
const x = factor * Math.cos(angle) + normal01(rng) * noiseStd;
|
|
525
|
+
const y = factor * Math.sin(angle) + normal01(rng) * noiseStd;
|
|
526
|
+
XData.push([x, y]);
|
|
527
|
+
yData.push(1);
|
|
528
|
+
}
|
|
529
|
+
if (shuffle) shufflePairedInPlace(XData, yData, rng);
|
|
530
|
+
return [chunk6AE5FKKQ_cjs.tensor(XData), chunk6AE5FKKQ_cjs.tensor(yData, { dtype: "int32" })];
|
|
531
|
+
}
|
|
532
|
+
function makeGaussianQuantiles(options = {}) {
|
|
533
|
+
const nSamples = options.nSamples ?? 100;
|
|
534
|
+
const nFeatures = options.nFeatures ?? 2;
|
|
535
|
+
const nClasses = options.nClasses ?? 3;
|
|
536
|
+
assertPositiveInt("nSamples", nSamples);
|
|
537
|
+
assertPositiveInt("nFeatures", nFeatures);
|
|
538
|
+
assertPositiveInt("nClasses", nClasses);
|
|
539
|
+
const seed = normalizeOptionalSeed("randomState", options.randomState);
|
|
540
|
+
const rng = createRng(seed);
|
|
541
|
+
const XData = new Array(nSamples);
|
|
542
|
+
const distances = new Array(nSamples);
|
|
543
|
+
for (let i = 0; i < nSamples; i++) {
|
|
544
|
+
const row = new Array(nFeatures);
|
|
545
|
+
let distSq = 0;
|
|
546
|
+
for (let j = 0; j < nFeatures; j++) {
|
|
547
|
+
const v = normal01(rng);
|
|
548
|
+
row[j] = v;
|
|
549
|
+
distSq += v * v;
|
|
550
|
+
}
|
|
551
|
+
XData[i] = row;
|
|
552
|
+
distances[i] = Math.sqrt(distSq);
|
|
553
|
+
}
|
|
554
|
+
const sortedDistances = [...distances].sort((a, b) => a - b);
|
|
555
|
+
const quantileBoundaries = [];
|
|
556
|
+
for (let c = 1; c < nClasses; c++) {
|
|
557
|
+
const idx = Math.floor(c * nSamples / nClasses);
|
|
558
|
+
quantileBoundaries.push(getRequired(sortedDistances, idx, "sortedDistances"));
|
|
559
|
+
}
|
|
560
|
+
const yData = new Array(nSamples);
|
|
561
|
+
for (let i = 0; i < nSamples; i++) {
|
|
562
|
+
const dist = getRequired(distances, i, "distances");
|
|
563
|
+
let label = 0;
|
|
564
|
+
for (const boundary of quantileBoundaries) {
|
|
565
|
+
if (dist > boundary) label++;
|
|
566
|
+
else break;
|
|
567
|
+
}
|
|
568
|
+
yData[i] = label;
|
|
569
|
+
}
|
|
570
|
+
return [chunk6AE5FKKQ_cjs.tensor(XData), chunk6AE5FKKQ_cjs.tensor(yData, { dtype: "int32" })];
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// src/datasets/loaders.ts
|
|
574
|
+
var SYNTHETIC_NOTE = "Synthetic (deterministic) dataset inspired by a common ML benchmark. Values are generated, not the original reference dataset.";
|
|
575
|
+
var __iris;
|
|
576
|
+
function getIrisData() {
|
|
577
|
+
if (__iris !== void 0) return __iris;
|
|
578
|
+
const rng = createRng(1337);
|
|
579
|
+
const data = [];
|
|
580
|
+
const target = [];
|
|
581
|
+
for (let i = 0; i < 50; i++) {
|
|
582
|
+
data.push([5 + rng() * 0.8, 3.4 + rng() * 0.4, 1.4 + rng() * 0.3, 0.2 + rng() * 0.2]);
|
|
583
|
+
target.push(0);
|
|
584
|
+
}
|
|
585
|
+
for (let i = 0; i < 50; i++) {
|
|
586
|
+
data.push([5.9 + rng() * 0.8, 2.8 + rng() * 0.4, 4.2 + rng() * 0.5, 1.3 + rng() * 0.3]);
|
|
587
|
+
target.push(1);
|
|
588
|
+
}
|
|
589
|
+
for (let i = 0; i < 50; i++) {
|
|
590
|
+
data.push([6.5 + rng() * 0.8, 3 + rng() * 0.4, 5.5 + rng() * 0.5, 2 + rng() * 0.4]);
|
|
591
|
+
target.push(2);
|
|
592
|
+
}
|
|
593
|
+
__iris = { data, target };
|
|
594
|
+
return __iris;
|
|
595
|
+
}
|
|
596
|
+
function loadIris() {
|
|
597
|
+
const { data, target } = getIrisData();
|
|
598
|
+
return {
|
|
599
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
600
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
601
|
+
featureNames: [
|
|
602
|
+
"sepal length (cm)",
|
|
603
|
+
"sepal width (cm)",
|
|
604
|
+
"petal length (cm)",
|
|
605
|
+
"petal width (cm)"
|
|
606
|
+
],
|
|
607
|
+
targetNames: ["setosa", "versicolor", "virginica"],
|
|
608
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 4 features, 3 classes.`
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
var __digits;
|
|
612
|
+
function getDigitsData() {
|
|
613
|
+
if (__digits !== void 0) return __digits;
|
|
614
|
+
const rng = createRng(7);
|
|
615
|
+
const data = [];
|
|
616
|
+
const target = [];
|
|
617
|
+
for (let digit = 0; digit < 10; digit++) {
|
|
618
|
+
const samplesPerDigit = digit === 9 ? 177 : 180;
|
|
619
|
+
for (let i = 0; i < samplesPerDigit; i++) {
|
|
620
|
+
const sample = [];
|
|
621
|
+
for (let j = 0; j < 64; j++) {
|
|
622
|
+
sample.push(Math.floor(rng() * 16));
|
|
623
|
+
}
|
|
624
|
+
data.push(sample);
|
|
625
|
+
target.push(digit);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
__digits = { data, target };
|
|
629
|
+
return __digits;
|
|
630
|
+
}
|
|
631
|
+
function loadDigits() {
|
|
632
|
+
const { data, target } = getDigitsData();
|
|
633
|
+
return {
|
|
634
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
635
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
636
|
+
featureNames: Array.from({ length: 64 }, (_, i) => `pixel_${i}`),
|
|
637
|
+
targetNames: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
638
|
+
description: `${SYNTHETIC_NOTE} 1797 samples, 64 features, 10 classes.`
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
var __breastCancer;
|
|
642
|
+
function getBreastCancerData() {
|
|
643
|
+
if (__breastCancer !== void 0) return __breastCancer;
|
|
644
|
+
const rng = createRng(99);
|
|
645
|
+
const data = [];
|
|
646
|
+
const target = [];
|
|
647
|
+
for (let i = 0; i < 212; i++) {
|
|
648
|
+
const sample = [];
|
|
649
|
+
for (let j = 0; j < 30; j++) {
|
|
650
|
+
sample.push(15 + rng() * 10);
|
|
651
|
+
}
|
|
652
|
+
data.push(sample);
|
|
653
|
+
target.push(0);
|
|
654
|
+
}
|
|
655
|
+
for (let i = 0; i < 357; i++) {
|
|
656
|
+
const sample = [];
|
|
657
|
+
for (let j = 0; j < 30; j++) {
|
|
658
|
+
sample.push(10 + rng() * 8);
|
|
659
|
+
}
|
|
660
|
+
data.push(sample);
|
|
661
|
+
target.push(1);
|
|
662
|
+
}
|
|
663
|
+
__breastCancer = { data, target };
|
|
664
|
+
return __breastCancer;
|
|
665
|
+
}
|
|
666
|
+
function loadBreastCancer() {
|
|
667
|
+
const { data, target } = getBreastCancerData();
|
|
668
|
+
return {
|
|
669
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
670
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
671
|
+
featureNames: [
|
|
672
|
+
"mean radius",
|
|
673
|
+
"mean texture",
|
|
674
|
+
"mean perimeter",
|
|
675
|
+
"mean area",
|
|
676
|
+
"mean smoothness",
|
|
677
|
+
"mean compactness",
|
|
678
|
+
"mean concavity",
|
|
679
|
+
"mean concave points",
|
|
680
|
+
"mean symmetry",
|
|
681
|
+
"mean fractal dimension",
|
|
682
|
+
"radius error",
|
|
683
|
+
"texture error",
|
|
684
|
+
"perimeter error",
|
|
685
|
+
"area error",
|
|
686
|
+
"smoothness error",
|
|
687
|
+
"compactness error",
|
|
688
|
+
"concavity error",
|
|
689
|
+
"concave points error",
|
|
690
|
+
"symmetry error",
|
|
691
|
+
"fractal dimension error",
|
|
692
|
+
"worst radius",
|
|
693
|
+
"worst texture",
|
|
694
|
+
"worst perimeter",
|
|
695
|
+
"worst area",
|
|
696
|
+
"worst smoothness",
|
|
697
|
+
"worst compactness",
|
|
698
|
+
"worst concavity",
|
|
699
|
+
"worst concave points",
|
|
700
|
+
"worst symmetry",
|
|
701
|
+
"worst fractal dimension"
|
|
702
|
+
],
|
|
703
|
+
targetNames: ["malignant", "benign"],
|
|
704
|
+
description: `${SYNTHETIC_NOTE} 569 samples, 30 features, 2 classes.`
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
var __diabetes;
|
|
708
|
+
function getDiabetesData() {
|
|
709
|
+
if (__diabetes !== void 0) return __diabetes;
|
|
710
|
+
const rng = createRng(123);
|
|
711
|
+
const data = [];
|
|
712
|
+
const target = [];
|
|
713
|
+
for (let i = 0; i < 442; i++) {
|
|
714
|
+
const sample = [];
|
|
715
|
+
for (let j = 0; j < 10; j++) {
|
|
716
|
+
sample.push(-0.1 + rng() * 0.2);
|
|
717
|
+
}
|
|
718
|
+
data.push(sample);
|
|
719
|
+
target.push(50 + rng() * 300);
|
|
720
|
+
}
|
|
721
|
+
__diabetes = { data, target };
|
|
722
|
+
return __diabetes;
|
|
723
|
+
}
|
|
724
|
+
function loadDiabetes() {
|
|
725
|
+
const { data, target } = getDiabetesData();
|
|
726
|
+
return {
|
|
727
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
728
|
+
target: chunk6AE5FKKQ_cjs.tensor(target),
|
|
729
|
+
featureNames: ["age", "sex", "bmi", "bp", "s1", "s2", "s3", "s4", "s5", "s6"],
|
|
730
|
+
description: `${SYNTHETIC_NOTE} 442 samples, 10 features (regression).`
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
var __linnerud;
|
|
734
|
+
function getLinnerudData() {
|
|
735
|
+
if (__linnerud !== void 0) return __linnerud;
|
|
736
|
+
const rng = createRng(555);
|
|
737
|
+
const data = [];
|
|
738
|
+
const target = [];
|
|
739
|
+
for (let i = 0; i < 20; i++) {
|
|
740
|
+
data.push([
|
|
741
|
+
5 + Math.floor(rng() * 15),
|
|
742
|
+
100 + Math.floor(rng() * 100),
|
|
743
|
+
50 + Math.floor(rng() * 200)
|
|
744
|
+
]);
|
|
745
|
+
target.push([170 + rng() * 30, 60 + rng() * 20, 50 + rng() * 20]);
|
|
746
|
+
}
|
|
747
|
+
__linnerud = { data, target };
|
|
748
|
+
return __linnerud;
|
|
749
|
+
}
|
|
750
|
+
function loadLinnerud() {
|
|
751
|
+
const { data, target } = getLinnerudData();
|
|
752
|
+
return {
|
|
753
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
754
|
+
target: chunk6AE5FKKQ_cjs.tensor(target),
|
|
755
|
+
featureNames: ["Chins", "Situps", "Jumps"],
|
|
756
|
+
targetNames: ["Weight", "Waist", "Pulse"],
|
|
757
|
+
description: `${SYNTHETIC_NOTE} 20 samples, 3 exercise features, 3 physiological targets.`
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
var __flowersExtended;
|
|
761
|
+
function getFlowersExtendedData() {
|
|
762
|
+
if (__flowersExtended !== void 0) return __flowersExtended;
|
|
763
|
+
const rng = createRng(3001);
|
|
764
|
+
const data = [];
|
|
765
|
+
const target = [];
|
|
766
|
+
for (let i = 0; i < 45; i++) {
|
|
767
|
+
data.push([
|
|
768
|
+
4.5 + rng() * 1,
|
|
769
|
+
3 + rng() * 0.8,
|
|
770
|
+
1 + rng() * 0.8,
|
|
771
|
+
0.1 + rng() * 0.4,
|
|
772
|
+
2 + rng() * 1.5,
|
|
773
|
+
1.5 + rng() * 1
|
|
774
|
+
]);
|
|
775
|
+
target.push(0);
|
|
776
|
+
}
|
|
777
|
+
for (let i = 0; i < 45; i++) {
|
|
778
|
+
data.push([
|
|
779
|
+
5.5 + rng() * 1.5,
|
|
780
|
+
2.5 + rng() * 0.8,
|
|
781
|
+
3.5 + rng() * 1.5,
|
|
782
|
+
1 + rng() * 0.8,
|
|
783
|
+
4 + rng() * 2,
|
|
784
|
+
2.5 + rng() * 1
|
|
785
|
+
]);
|
|
786
|
+
target.push(1);
|
|
787
|
+
}
|
|
788
|
+
for (let i = 0; i < 45; i++) {
|
|
789
|
+
data.push([
|
|
790
|
+
6 + rng() * 1.9,
|
|
791
|
+
2.8 + rng() * 0.8,
|
|
792
|
+
4.5 + rng() * 2,
|
|
793
|
+
1.5 + rng() * 1,
|
|
794
|
+
5 + rng() * 2,
|
|
795
|
+
3 + rng() * 1.5
|
|
796
|
+
]);
|
|
797
|
+
target.push(2);
|
|
798
|
+
}
|
|
799
|
+
for (let i = 0; i < 45; i++) {
|
|
800
|
+
data.push([
|
|
801
|
+
5 + rng() * 1.5,
|
|
802
|
+
2.2 + rng() * 0.8,
|
|
803
|
+
2.5 + rng() * 1.5,
|
|
804
|
+
0.8 + rng() * 0.6,
|
|
805
|
+
6 + rng() * 2.5,
|
|
806
|
+
2 + rng() * 1
|
|
807
|
+
]);
|
|
808
|
+
target.push(3);
|
|
809
|
+
}
|
|
810
|
+
__flowersExtended = { data, target };
|
|
811
|
+
return __flowersExtended;
|
|
812
|
+
}
|
|
813
|
+
function loadFlowersExtended() {
|
|
814
|
+
const { data, target } = getFlowersExtendedData();
|
|
815
|
+
return {
|
|
816
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
817
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
818
|
+
featureNames: [
|
|
819
|
+
"sepal length (cm)",
|
|
820
|
+
"sepal width (cm)",
|
|
821
|
+
"petal length (cm)",
|
|
822
|
+
"petal width (cm)",
|
|
823
|
+
"color intensity",
|
|
824
|
+
"stem thickness (mm)"
|
|
825
|
+
],
|
|
826
|
+
targetNames: ["setosa", "versicolor", "virginica", "chrysantha"],
|
|
827
|
+
description: `${SYNTHETIC_NOTE} 180 samples, 6 features, 4 species.`
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
var __leafShapes;
|
|
831
|
+
function getLeafShapesData() {
|
|
832
|
+
if (__leafShapes !== void 0) return __leafShapes;
|
|
833
|
+
const rng = createRng(3002);
|
|
834
|
+
const data = [];
|
|
835
|
+
const target = [];
|
|
836
|
+
for (let i = 0; i < 30; i++) {
|
|
837
|
+
data.push([
|
|
838
|
+
15 + rng() * 15,
|
|
839
|
+
25 + rng() * 20,
|
|
840
|
+
0.8 + rng() * 0.4,
|
|
841
|
+
0.3 + rng() * 0.3,
|
|
842
|
+
0.3 + rng() * 0.2,
|
|
843
|
+
0.5 + rng() * 0.3,
|
|
844
|
+
0.7 + rng() * 0.3,
|
|
845
|
+
0.6 + rng() * 0.2
|
|
846
|
+
]);
|
|
847
|
+
target.push(0);
|
|
848
|
+
}
|
|
849
|
+
for (let i = 0; i < 30; i++) {
|
|
850
|
+
data.push([
|
|
851
|
+
20 + rng() * 20,
|
|
852
|
+
30 + rng() * 20,
|
|
853
|
+
1 + rng() * 0.5,
|
|
854
|
+
0.2 + rng() * 0.3,
|
|
855
|
+
0.4 + rng() * 0.2,
|
|
856
|
+
0.3 + rng() * 0.3,
|
|
857
|
+
0.8 + rng() * 0.4,
|
|
858
|
+
0.7 + rng() * 0.2
|
|
859
|
+
]);
|
|
860
|
+
target.push(1);
|
|
861
|
+
}
|
|
862
|
+
for (let i = 0; i < 30; i++) {
|
|
863
|
+
data.push([
|
|
864
|
+
8 + rng() * 10,
|
|
865
|
+
15 + rng() * 15,
|
|
866
|
+
1.2 + rng() * 0.6,
|
|
867
|
+
0.1 + rng() * 0.2,
|
|
868
|
+
0.5 + rng() * 0.2,
|
|
869
|
+
0.1 + rng() * 0.2,
|
|
870
|
+
1 + rng() * 0.5,
|
|
871
|
+
0.8 + rng() * 0.15
|
|
872
|
+
]);
|
|
873
|
+
target.push(2);
|
|
874
|
+
}
|
|
875
|
+
for (let i = 0; i < 30; i++) {
|
|
876
|
+
data.push([
|
|
877
|
+
5 + rng() * 7,
|
|
878
|
+
20 + rng() * 15,
|
|
879
|
+
3 + rng() * 2,
|
|
880
|
+
0.05 + rng() * 0.15,
|
|
881
|
+
0.2 + rng() * 0.2,
|
|
882
|
+
0.05 + rng() * 0.1,
|
|
883
|
+
2 + rng() * 1.5,
|
|
884
|
+
0.85 + rng() * 0.13
|
|
885
|
+
]);
|
|
886
|
+
target.push(3);
|
|
887
|
+
}
|
|
888
|
+
for (let i = 0; i < 30; i++) {
|
|
889
|
+
data.push([
|
|
890
|
+
10 + rng() * 12,
|
|
891
|
+
18 + rng() * 14,
|
|
892
|
+
0.9 + rng() * 0.4,
|
|
893
|
+
0.15 + rng() * 0.2,
|
|
894
|
+
0.5 + rng() * 0.2,
|
|
895
|
+
0.15 + rng() * 0.2,
|
|
896
|
+
0.8 + rng() * 0.3,
|
|
897
|
+
0.75 + rng() * 0.15
|
|
898
|
+
]);
|
|
899
|
+
target.push(4);
|
|
900
|
+
}
|
|
901
|
+
__leafShapes = { data, target };
|
|
902
|
+
return __leafShapes;
|
|
903
|
+
}
|
|
904
|
+
function loadLeafShapes() {
|
|
905
|
+
const { data, target } = getLeafShapesData();
|
|
906
|
+
return {
|
|
907
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
908
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
909
|
+
featureNames: [
|
|
910
|
+
"area (cm\xB2)",
|
|
911
|
+
"perimeter (cm)",
|
|
912
|
+
"aspect ratio",
|
|
913
|
+
"curvature",
|
|
914
|
+
"compactness",
|
|
915
|
+
"lobedness",
|
|
916
|
+
"elongation",
|
|
917
|
+
"solidity"
|
|
918
|
+
],
|
|
919
|
+
targetNames: ["maple", "oak", "birch", "willow", "ginkgo"],
|
|
920
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 8 geometric features, 5 plant species.`
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
var __fruitQuality;
|
|
924
|
+
function getFruitQualityData() {
|
|
925
|
+
if (__fruitQuality !== void 0) return __fruitQuality;
|
|
926
|
+
const rng = createRng(3003);
|
|
927
|
+
const data = [];
|
|
928
|
+
const target = [];
|
|
929
|
+
for (let i = 0; i < 50; i++) {
|
|
930
|
+
data.push([150 + rng() * 70, 11 + rng() * 3, 3.2 + rng() * 0.6, 6 + rng() * 3, 5 + rng() * 3]);
|
|
931
|
+
target.push(0);
|
|
932
|
+
}
|
|
933
|
+
for (let i = 0; i < 50; i++) {
|
|
934
|
+
data.push([130 + rng() * 70, 9 + rng() * 3, 3 + rng() * 0.5, 3 + rng() * 3, 6 + rng() * 3]);
|
|
935
|
+
target.push(1);
|
|
936
|
+
}
|
|
937
|
+
for (let i = 0; i < 50; i++) {
|
|
938
|
+
data.push([100 + rng() * 50, 14 + rng() * 6, 4.5 + rng() * 1, 1 + rng() * 3, 4 + rng() * 3]);
|
|
939
|
+
target.push(2);
|
|
940
|
+
}
|
|
941
|
+
__fruitQuality = { data, target };
|
|
942
|
+
return __fruitQuality;
|
|
943
|
+
}
|
|
944
|
+
function loadFruitQuality() {
|
|
945
|
+
const { data, target } = getFruitQualityData();
|
|
946
|
+
return {
|
|
947
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
948
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
949
|
+
featureNames: [
|
|
950
|
+
"weight (g)",
|
|
951
|
+
"sugar content (Brix)",
|
|
952
|
+
"acidity (pH)",
|
|
953
|
+
"firmness (N)",
|
|
954
|
+
"color score"
|
|
955
|
+
],
|
|
956
|
+
targetNames: ["apple", "orange", "banana"],
|
|
957
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 5 features, 3 fruit classes.`
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
var __seedMorphology;
|
|
961
|
+
function getSeedMorphologyData() {
|
|
962
|
+
if (__seedMorphology !== void 0) return __seedMorphology;
|
|
963
|
+
const rng = createRng(3005);
|
|
964
|
+
const data = [];
|
|
965
|
+
const target = [];
|
|
966
|
+
for (let i = 0; i < 50; i++) {
|
|
967
|
+
data.push([5.5 + rng() * 2, 2.8 + rng() * 1, 0.75 + rng() * 0.17, 1.3 + rng() * 0.2]);
|
|
968
|
+
target.push(0);
|
|
969
|
+
}
|
|
970
|
+
for (let i = 0; i < 50; i++) {
|
|
971
|
+
data.push([6 + rng() * 3, 1.8 + rng() * 0.7, 0.3 + rng() * 0.2, 1.1 + rng() * 0.2]);
|
|
972
|
+
target.push(1);
|
|
973
|
+
}
|
|
974
|
+
for (let i = 0; i < 50; i++) {
|
|
975
|
+
data.push([8 + rng() * 5, 4 + rng() * 3, 0.55 + rng() * 0.2, 0.9 + rng() * 0.2]);
|
|
976
|
+
target.push(2);
|
|
977
|
+
}
|
|
978
|
+
__seedMorphology = { data, target };
|
|
979
|
+
return __seedMorphology;
|
|
980
|
+
}
|
|
981
|
+
function loadSeedMorphology() {
|
|
982
|
+
const { data, target } = getSeedMorphologyData();
|
|
983
|
+
return {
|
|
984
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
985
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
986
|
+
featureNames: ["length (mm)", "width (mm)", "roundness", "density (g/cm\xB3)"],
|
|
987
|
+
targetNames: ["wheat", "rice", "sunflower"],
|
|
988
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 4 features, 3 seed types.`
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
var __moonsMulti;
|
|
992
|
+
function getMoonsMultiData() {
|
|
993
|
+
if (__moonsMulti !== void 0) return __moonsMulti;
|
|
994
|
+
const rng = createRng(3006);
|
|
995
|
+
const data = [];
|
|
996
|
+
const target = [];
|
|
997
|
+
for (let c = 0; c < 3; c++) {
|
|
998
|
+
const rotation = c * 2 * Math.PI / 3;
|
|
999
|
+
const cosR = Math.cos(rotation);
|
|
1000
|
+
const sinR = Math.sin(rotation);
|
|
1001
|
+
for (let j = 0; j < 50; j++) {
|
|
1002
|
+
const t = Math.PI * (j / 50);
|
|
1003
|
+
const baseX = Math.cos(t);
|
|
1004
|
+
const baseY = Math.sin(t);
|
|
1005
|
+
const x = baseX * cosR - baseY * sinR;
|
|
1006
|
+
const y = baseX * sinR + baseY * cosR;
|
|
1007
|
+
data.push([x + normal01(rng) * 0.08, y + normal01(rng) * 0.08]);
|
|
1008
|
+
target.push(c);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
__moonsMulti = { data, target };
|
|
1012
|
+
return __moonsMulti;
|
|
1013
|
+
}
|
|
1014
|
+
function loadMoonsMulti() {
|
|
1015
|
+
const { data, target } = getMoonsMultiData();
|
|
1016
|
+
return {
|
|
1017
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1018
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
1019
|
+
featureNames: ["x", "y"],
|
|
1020
|
+
targetNames: ["moon_0", "moon_1", "moon_2"],
|
|
1021
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 2D, 3 interleaving moon classes.`
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
var __concentricRings;
|
|
1025
|
+
function getConcentricRingsData() {
|
|
1026
|
+
if (__concentricRings !== void 0) return __concentricRings;
|
|
1027
|
+
const rng = createRng(3007);
|
|
1028
|
+
const data = [];
|
|
1029
|
+
const target = [];
|
|
1030
|
+
for (let c = 0; c < 3; c++) {
|
|
1031
|
+
const radius = 1 + c * 1.5;
|
|
1032
|
+
for (let j = 0; j < 50; j++) {
|
|
1033
|
+
const angle = 2 * Math.PI * (j / 50);
|
|
1034
|
+
data.push([
|
|
1035
|
+
radius * Math.cos(angle) + normal01(rng) * 0.15,
|
|
1036
|
+
radius * Math.sin(angle) + normal01(rng) * 0.15
|
|
1037
|
+
]);
|
|
1038
|
+
target.push(c);
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
__concentricRings = { data, target };
|
|
1042
|
+
return __concentricRings;
|
|
1043
|
+
}
|
|
1044
|
+
function loadConcentricRings() {
|
|
1045
|
+
const { data, target } = getConcentricRingsData();
|
|
1046
|
+
return {
|
|
1047
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1048
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
1049
|
+
featureNames: ["x", "y"],
|
|
1050
|
+
targetNames: ["inner", "middle", "outer"],
|
|
1051
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 2D, 3 concentric circle classes.`
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
var __spiralArms;
|
|
1055
|
+
function getSpiralArmsData() {
|
|
1056
|
+
if (__spiralArms !== void 0) return __spiralArms;
|
|
1057
|
+
const rng = createRng(3008);
|
|
1058
|
+
const data = [];
|
|
1059
|
+
const target = [];
|
|
1060
|
+
for (let c = 0; c < 3; c++) {
|
|
1061
|
+
const offset = c * 2 * Math.PI / 3;
|
|
1062
|
+
for (let j = 0; j < 50; j++) {
|
|
1063
|
+
const t = j / 50 * 3 * Math.PI;
|
|
1064
|
+
const r = 0.5 + t * 0.15;
|
|
1065
|
+
const angle = t + offset;
|
|
1066
|
+
data.push([
|
|
1067
|
+
r * Math.cos(angle) + normal01(rng) * 0.1,
|
|
1068
|
+
r * Math.sin(angle) + normal01(rng) * 0.1
|
|
1069
|
+
]);
|
|
1070
|
+
target.push(c);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
__spiralArms = { data, target };
|
|
1074
|
+
return __spiralArms;
|
|
1075
|
+
}
|
|
1076
|
+
function loadSpiralArms() {
|
|
1077
|
+
const { data, target } = getSpiralArmsData();
|
|
1078
|
+
return {
|
|
1079
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1080
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
1081
|
+
featureNames: ["x", "y"],
|
|
1082
|
+
targetNames: ["arm_0", "arm_1", "arm_2"],
|
|
1083
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 2D, 3 spiral classes.`
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
var __gaussianIslands;
|
|
1087
|
+
function getGaussianIslandsData() {
|
|
1088
|
+
if (__gaussianIslands !== void 0) return __gaussianIslands;
|
|
1089
|
+
const rng = createRng(3009);
|
|
1090
|
+
const data = [];
|
|
1091
|
+
const target = [];
|
|
1092
|
+
const centers = [
|
|
1093
|
+
[3, 3, 3],
|
|
1094
|
+
[-3, 3, -3],
|
|
1095
|
+
[-3, -3, 3],
|
|
1096
|
+
[3, -3, -3]
|
|
1097
|
+
];
|
|
1098
|
+
let c = 0;
|
|
1099
|
+
for (const center of centers) {
|
|
1100
|
+
for (let i = 0; i < 50; i++) {
|
|
1101
|
+
data.push([
|
|
1102
|
+
center[0] + normal01(rng) * 0.8,
|
|
1103
|
+
center[1] + normal01(rng) * 0.8,
|
|
1104
|
+
center[2] + normal01(rng) * 0.8
|
|
1105
|
+
]);
|
|
1106
|
+
target.push(c);
|
|
1107
|
+
}
|
|
1108
|
+
c++;
|
|
1109
|
+
}
|
|
1110
|
+
__gaussianIslands = { data, target };
|
|
1111
|
+
return __gaussianIslands;
|
|
1112
|
+
}
|
|
1113
|
+
function loadGaussianIslands() {
|
|
1114
|
+
const { data, target } = getGaussianIslandsData();
|
|
1115
|
+
return {
|
|
1116
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1117
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
1118
|
+
featureNames: ["x", "y", "z"],
|
|
1119
|
+
targetNames: ["island_0", "island_1", "island_2", "island_3"],
|
|
1120
|
+
description: `${SYNTHETIC_NOTE} 200 samples, 3D, 4 separated Gaussian clusters.`
|
|
1121
|
+
};
|
|
1122
|
+
}
|
|
1123
|
+
var __plantGrowth;
|
|
1124
|
+
function getPlantGrowthData() {
|
|
1125
|
+
if (__plantGrowth !== void 0) return __plantGrowth;
|
|
1126
|
+
const rng = createRng(3010);
|
|
1127
|
+
const data = [];
|
|
1128
|
+
const target = [];
|
|
1129
|
+
for (let i = 0; i < 200; i++) {
|
|
1130
|
+
const sunlight = 4 + rng() * 8;
|
|
1131
|
+
const water = 100 + rng() * 400;
|
|
1132
|
+
const soilQuality = rng() * 10;
|
|
1133
|
+
data.push([sunlight, water, soilQuality]);
|
|
1134
|
+
const height = 5 + 2.5 * sunlight + 0.02 * water + 3 * soilQuality + (rng() - 0.5) * 10;
|
|
1135
|
+
target.push(height);
|
|
1136
|
+
}
|
|
1137
|
+
__plantGrowth = { data, target };
|
|
1138
|
+
return __plantGrowth;
|
|
1139
|
+
}
|
|
1140
|
+
function loadPlantGrowth() {
|
|
1141
|
+
const { data, target } = getPlantGrowthData();
|
|
1142
|
+
return {
|
|
1143
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1144
|
+
target: chunk6AE5FKKQ_cjs.tensor(target),
|
|
1145
|
+
featureNames: ["sunlight (hours/day)", "water (mL/day)", "soil quality (0-10)"],
|
|
1146
|
+
description: `${SYNTHETIC_NOTE} 200 samples, 3 features, target: height (cm) after 30 days.`
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
var __housingMini;
|
|
1150
|
+
function getHousingMiniData() {
|
|
1151
|
+
if (__housingMini !== void 0) return __housingMini;
|
|
1152
|
+
const rng = createRng(3011);
|
|
1153
|
+
const data = [];
|
|
1154
|
+
const target = [];
|
|
1155
|
+
for (let i = 0; i < 200; i++) {
|
|
1156
|
+
const size = 30 + rng() * 170;
|
|
1157
|
+
const rooms = 1 + Math.floor(rng() * 6);
|
|
1158
|
+
const age = rng() * 50;
|
|
1159
|
+
const distance = 0.5 + rng() * 29.5;
|
|
1160
|
+
data.push([size, rooms, age, distance]);
|
|
1161
|
+
const price = 80 + 2 * size + 15 * rooms - 0.5 * age - 1.5 * distance + (rng() - 0.5) * 30;
|
|
1162
|
+
target.push(price);
|
|
1163
|
+
}
|
|
1164
|
+
__housingMini = { data, target };
|
|
1165
|
+
return __housingMini;
|
|
1166
|
+
}
|
|
1167
|
+
function loadHousingMini() {
|
|
1168
|
+
const { data, target } = getHousingMiniData();
|
|
1169
|
+
return {
|
|
1170
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1171
|
+
target: chunk6AE5FKKQ_cjs.tensor(target),
|
|
1172
|
+
featureNames: ["size (sqm)", "rooms", "age (years)", "distance to center (km)"],
|
|
1173
|
+
description: `${SYNTHETIC_NOTE} 200 samples, 4 features, target: price (thousands).`
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
var __energyEfficiency;
|
|
1177
|
+
function getEnergyEfficiencyData() {
|
|
1178
|
+
if (__energyEfficiency !== void 0) return __energyEfficiency;
|
|
1179
|
+
const rng = createRng(3012);
|
|
1180
|
+
const data = [];
|
|
1181
|
+
const target = [];
|
|
1182
|
+
for (let i = 0; i < 200; i++) {
|
|
1183
|
+
const insulation = 1 + rng() * 7;
|
|
1184
|
+
const windowArea = 5 + rng() * 25;
|
|
1185
|
+
const orientation = rng() * 360;
|
|
1186
|
+
data.push([insulation, windowArea, orientation]);
|
|
1187
|
+
const orientationRad = orientation * (Math.PI / 180);
|
|
1188
|
+
const energy = 250 - 20 * insulation + 4 * windowArea + 15 * Math.cos(orientationRad) + (rng() - 0.5) * 20;
|
|
1189
|
+
target.push(energy);
|
|
1190
|
+
}
|
|
1191
|
+
__energyEfficiency = { data, target };
|
|
1192
|
+
return __energyEfficiency;
|
|
1193
|
+
}
|
|
1194
|
+
function loadEnergyEfficiency() {
|
|
1195
|
+
const { data, target } = getEnergyEfficiencyData();
|
|
1196
|
+
return {
|
|
1197
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1198
|
+
target: chunk6AE5FKKQ_cjs.tensor(target),
|
|
1199
|
+
featureNames: ["insulation (R-value)", "window area (sqm)", "orientation (degrees)"],
|
|
1200
|
+
description: `${SYNTHETIC_NOTE} 200 samples, 3 features, target: energy usage (kWh).`
|
|
1201
|
+
};
|
|
1202
|
+
}
|
|
1203
|
+
var __cropYield;
|
|
1204
|
+
function getCropYieldData() {
|
|
1205
|
+
if (__cropYield !== void 0) return __cropYield;
|
|
1206
|
+
const rng = createRng(3013);
|
|
1207
|
+
const data = [];
|
|
1208
|
+
const target = [];
|
|
1209
|
+
for (let i = 0; i < 200; i++) {
|
|
1210
|
+
const rainfall = 200 + rng() * 600;
|
|
1211
|
+
const fertilizer = 50 + rng() * 250;
|
|
1212
|
+
const temperature = 15 + rng() * 20;
|
|
1213
|
+
data.push([rainfall, fertilizer, temperature]);
|
|
1214
|
+
const tempEffect = -0.015 * (temperature - 25) * (temperature - 25);
|
|
1215
|
+
const yieldVal = 2 + 5e-3 * rainfall + 8e-3 * fertilizer + tempEffect + (rng() - 0.5) * 1;
|
|
1216
|
+
target.push(yieldVal);
|
|
1217
|
+
}
|
|
1218
|
+
__cropYield = { data, target };
|
|
1219
|
+
return __cropYield;
|
|
1220
|
+
}
|
|
1221
|
+
function loadCropYield() {
|
|
1222
|
+
const { data, target } = getCropYieldData();
|
|
1223
|
+
return {
|
|
1224
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1225
|
+
target: chunk6AE5FKKQ_cjs.tensor(target),
|
|
1226
|
+
featureNames: ["rainfall (mm)", "fertilizer (kg/ha)", "temperature (\xB0C)"],
|
|
1227
|
+
description: `${SYNTHETIC_NOTE} 200 samples, 3 features, target: yield (tons/ha).`
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
var __customerSegments;
|
|
1231
|
+
function getCustomerSegmentsData() {
|
|
1232
|
+
if (__customerSegments !== void 0) return __customerSegments;
|
|
1233
|
+
const rng = createRng(3014);
|
|
1234
|
+
const data = [];
|
|
1235
|
+
const target = [];
|
|
1236
|
+
for (let i = 0; i < 50; i++) {
|
|
1237
|
+
data.push([25 + normal01(rng) * 3, 30 + normal01(rng) * 5, 70 + normal01(rng) * 8]);
|
|
1238
|
+
target.push(0);
|
|
1239
|
+
}
|
|
1240
|
+
for (let i = 0; i < 50; i++) {
|
|
1241
|
+
data.push([30 + normal01(rng) * 4, 80 + normal01(rng) * 8, 85 + normal01(rng) * 6]);
|
|
1242
|
+
target.push(1);
|
|
1243
|
+
}
|
|
1244
|
+
for (let i = 0; i < 50; i++) {
|
|
1245
|
+
data.push([55 + normal01(rng) * 5, 50 + normal01(rng) * 8, 40 + normal01(rng) * 8]);
|
|
1246
|
+
target.push(2);
|
|
1247
|
+
}
|
|
1248
|
+
for (let i = 0; i < 50; i++) {
|
|
1249
|
+
data.push([60 + normal01(rng) * 4, 90 + normal01(rng) * 7, 30 + normal01(rng) * 7]);
|
|
1250
|
+
target.push(3);
|
|
1251
|
+
}
|
|
1252
|
+
__customerSegments = { data, target };
|
|
1253
|
+
return __customerSegments;
|
|
1254
|
+
}
|
|
1255
|
+
function loadCustomerSegments() {
|
|
1256
|
+
const { data, target } = getCustomerSegmentsData();
|
|
1257
|
+
return {
|
|
1258
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1259
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
1260
|
+
featureNames: ["age", "income (thousands)", "spending score (0-100)"],
|
|
1261
|
+
targetNames: ["young_budget", "young_premium", "mature_moderate", "mature_saver"],
|
|
1262
|
+
description: `${SYNTHETIC_NOTE} 200 samples, 3 features, 4 natural clusters.`
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
var __sensorStates;
|
|
1266
|
+
function getSensorStatesData() {
|
|
1267
|
+
if (__sensorStates !== void 0) return __sensorStates;
|
|
1268
|
+
const rng = createRng(3015);
|
|
1269
|
+
const data = [];
|
|
1270
|
+
const target = [];
|
|
1271
|
+
for (let i = 0; i < 60; i++) {
|
|
1272
|
+
data.push([
|
|
1273
|
+
50 + rng() * 10,
|
|
1274
|
+
1013 + rng() * 5,
|
|
1275
|
+
60 + rng() * 10,
|
|
1276
|
+
220 + rng() * 5,
|
|
1277
|
+
3 + rng() * 0.5,
|
|
1278
|
+
0.5 + rng() * 0.3
|
|
1279
|
+
]);
|
|
1280
|
+
target.push(0);
|
|
1281
|
+
}
|
|
1282
|
+
for (let i = 0; i < 60; i++) {
|
|
1283
|
+
data.push([
|
|
1284
|
+
80 + rng() * 15,
|
|
1285
|
+
1010 + rng() * 8,
|
|
1286
|
+
40 + rng() * 15,
|
|
1287
|
+
218 + rng() * 8,
|
|
1288
|
+
5 + rng() * 1,
|
|
1289
|
+
0.8 + rng() * 0.4
|
|
1290
|
+
]);
|
|
1291
|
+
target.push(1);
|
|
1292
|
+
}
|
|
1293
|
+
for (let i = 0; i < 60; i++) {
|
|
1294
|
+
data.push([
|
|
1295
|
+
30 + rng() * 40,
|
|
1296
|
+
1e3 + rng() * 20,
|
|
1297
|
+
20 + rng() * 60,
|
|
1298
|
+
200 + rng() * 30,
|
|
1299
|
+
1 + rng() * 8,
|
|
1300
|
+
0.2 + rng() * 1.5
|
|
1301
|
+
]);
|
|
1302
|
+
target.push(2);
|
|
1303
|
+
}
|
|
1304
|
+
__sensorStates = { data, target };
|
|
1305
|
+
return __sensorStates;
|
|
1306
|
+
}
|
|
1307
|
+
function loadSensorStates() {
|
|
1308
|
+
const { data, target } = getSensorStatesData();
|
|
1309
|
+
return {
|
|
1310
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1311
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
1312
|
+
featureNames: [
|
|
1313
|
+
"temperature (\xB0C)",
|
|
1314
|
+
"pressure (hPa)",
|
|
1315
|
+
"humidity (%)",
|
|
1316
|
+
"voltage (V)",
|
|
1317
|
+
"vibration (mm/s)",
|
|
1318
|
+
"current (A)"
|
|
1319
|
+
],
|
|
1320
|
+
targetNames: ["normal", "heating", "fault"],
|
|
1321
|
+
description: `${SYNTHETIC_NOTE} 180 samples, 6 sensor readings, 3 hidden operating modes.`
|
|
1322
|
+
};
|
|
1323
|
+
}
|
|
1324
|
+
var __studentPerformance;
|
|
1325
|
+
function getStudentPerformanceData() {
|
|
1326
|
+
if (__studentPerformance !== void 0) return __studentPerformance;
|
|
1327
|
+
const rng = createRng(3016);
|
|
1328
|
+
const data = [];
|
|
1329
|
+
const target = [];
|
|
1330
|
+
for (let i = 0; i < 50; i++) {
|
|
1331
|
+
data.push([Math.floor(rng() * 6), 8 + Math.floor(rng() * 8), 20 + Math.floor(rng() * 30)]);
|
|
1332
|
+
target.push(0);
|
|
1333
|
+
}
|
|
1334
|
+
for (let i = 0; i < 50; i++) {
|
|
1335
|
+
data.push([4 + Math.floor(rng() * 8), 3 + Math.floor(rng() * 6), 45 + Math.floor(rng() * 30)]);
|
|
1336
|
+
target.push(1);
|
|
1337
|
+
}
|
|
1338
|
+
for (let i = 0; i < 50; i++) {
|
|
1339
|
+
data.push([10 + Math.floor(rng() * 11), Math.floor(rng() * 4), 70 + Math.floor(rng() * 31)]);
|
|
1340
|
+
target.push(2);
|
|
1341
|
+
}
|
|
1342
|
+
__studentPerformance = { data, target };
|
|
1343
|
+
return __studentPerformance;
|
|
1344
|
+
}
|
|
1345
|
+
function loadStudentPerformance() {
|
|
1346
|
+
const { data, target } = getStudentPerformanceData();
|
|
1347
|
+
return {
|
|
1348
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1349
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
1350
|
+
featureNames: ["study hours (per week)", "absences", "quiz score (0-100)"],
|
|
1351
|
+
targetNames: ["fail", "pass", "excellent"],
|
|
1352
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 3 integer features, 3 outcome classes.`
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
var __trafficConditions;
|
|
1356
|
+
function getTrafficConditionsData() {
|
|
1357
|
+
if (__trafficConditions !== void 0) return __trafficConditions;
|
|
1358
|
+
const rng = createRng(3017);
|
|
1359
|
+
const data = [];
|
|
1360
|
+
const target = [];
|
|
1361
|
+
for (let i = 0; i < 50; i++) {
|
|
1362
|
+
data.push([Math.floor(rng() * 10), 50 + Math.floor(rng() * 40), 5 + Math.floor(rng() * 20)]);
|
|
1363
|
+
target.push(0);
|
|
1364
|
+
}
|
|
1365
|
+
for (let i = 0; i < 50; i++) {
|
|
1366
|
+
data.push([
|
|
1367
|
+
8 + Math.floor(rng() * 8),
|
|
1368
|
+
25 + Math.floor(rng() * 30),
|
|
1369
|
+
20 + Math.floor(rng() * 30)
|
|
1370
|
+
]);
|
|
1371
|
+
target.push(1);
|
|
1372
|
+
}
|
|
1373
|
+
for (let i = 0; i < 50; i++) {
|
|
1374
|
+
data.push([
|
|
1375
|
+
15 + Math.floor(rng() * 8),
|
|
1376
|
+
5 + Math.floor(rng() * 25),
|
|
1377
|
+
45 + Math.floor(rng() * 45)
|
|
1378
|
+
]);
|
|
1379
|
+
target.push(2);
|
|
1380
|
+
}
|
|
1381
|
+
__trafficConditions = { data, target };
|
|
1382
|
+
return __trafficConditions;
|
|
1383
|
+
}
|
|
1384
|
+
function loadTrafficConditions() {
|
|
1385
|
+
const { data, target } = getTrafficConditionsData();
|
|
1386
|
+
return {
|
|
1387
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1388
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
1389
|
+
featureNames: ["time of day (hour)", "speed (km/h)", "density (vehicles/km)"],
|
|
1390
|
+
targetNames: ["light", "moderate", "heavy"],
|
|
1391
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 3 features, 3 traffic level classes.`
|
|
1392
|
+
};
|
|
1393
|
+
}
|
|
1394
|
+
var __fitnessScores;
|
|
1395
|
+
function getFitnessScoresData() {
|
|
1396
|
+
if (__fitnessScores !== void 0) return __fitnessScores;
|
|
1397
|
+
const rng = createRng(3018);
|
|
1398
|
+
const data = [];
|
|
1399
|
+
const target = [];
|
|
1400
|
+
for (let i = 0; i < 100; i++) {
|
|
1401
|
+
const duration = 20 + rng() * 70;
|
|
1402
|
+
const intensity = 1 + rng() * 9;
|
|
1403
|
+
const frequency = 1 + rng() * 6;
|
|
1404
|
+
data.push([duration, intensity, frequency]);
|
|
1405
|
+
target.push([
|
|
1406
|
+
10 + 0.3 * duration + 5 * intensity + 3 * frequency + (rng() - 0.5) * 8,
|
|
1407
|
+
15 + 0.5 * duration + 2 * intensity + 5 * frequency + (rng() - 0.5) * 8,
|
|
1408
|
+
30 + 0.4 * duration + 1 * intensity + 2 * frequency + (rng() - 0.5) * 8
|
|
1409
|
+
]);
|
|
1410
|
+
}
|
|
1411
|
+
__fitnessScores = { data, target };
|
|
1412
|
+
return __fitnessScores;
|
|
1413
|
+
}
|
|
1414
|
+
function loadFitnessScores() {
|
|
1415
|
+
const { data, target } = getFitnessScoresData();
|
|
1416
|
+
return {
|
|
1417
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1418
|
+
target: chunk6AE5FKKQ_cjs.tensor(target),
|
|
1419
|
+
featureNames: ["exercise duration (min)", "intensity (1-10)", "frequency (times/week)"],
|
|
1420
|
+
targetNames: ["strength", "endurance", "flexibility"],
|
|
1421
|
+
description: `${SYNTHETIC_NOTE} 100 samples, 3 exercise features, 3 fitness targets (multi-output).`
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
var __weatherOutcomes;
|
|
1425
|
+
function getWeatherOutcomesData() {
|
|
1426
|
+
if (__weatherOutcomes !== void 0) return __weatherOutcomes;
|
|
1427
|
+
const rng = createRng(3019);
|
|
1428
|
+
const data = [];
|
|
1429
|
+
const target = [];
|
|
1430
|
+
for (let i = 0; i < 150; i++) {
|
|
1431
|
+
const humidity = 20 + rng() * 80;
|
|
1432
|
+
const pressure = 990 + rng() * 50;
|
|
1433
|
+
const temperature = -5 + rng() * 40;
|
|
1434
|
+
data.push([humidity, pressure, temperature]);
|
|
1435
|
+
const rawRain = 0.01 * humidity - 3e-3 * (pressure - 1e3) + 5e-3 * temperature - 0.3 + (rng() - 0.5) * 0.1;
|
|
1436
|
+
const rainProb = Math.max(0, Math.min(1, rawRain));
|
|
1437
|
+
const windSpeed = 8 + 0.5 * Math.abs(pressure - 1013) + 0.3 * temperature + (rng() - 0.5) * 6;
|
|
1438
|
+
target.push([rainProb, Math.max(0, windSpeed)]);
|
|
1439
|
+
}
|
|
1440
|
+
__weatherOutcomes = { data, target };
|
|
1441
|
+
return __weatherOutcomes;
|
|
1442
|
+
}
|
|
1443
|
+
function loadWeatherOutcomes() {
|
|
1444
|
+
const { data, target } = getWeatherOutcomesData();
|
|
1445
|
+
return {
|
|
1446
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1447
|
+
target: chunk6AE5FKKQ_cjs.tensor(target),
|
|
1448
|
+
featureNames: ["humidity (%)", "pressure (hPa)", "temperature (\xB0C)"],
|
|
1449
|
+
targetNames: ["rain probability", "wind speed (km/h)"],
|
|
1450
|
+
description: `${SYNTHETIC_NOTE} 150 samples, 3 features, 2 targets (multi-output regression).`
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
var __perfectlySeparable;
|
|
1454
|
+
function getPerfectlySeparableData() {
|
|
1455
|
+
if (__perfectlySeparable !== void 0) return __perfectlySeparable;
|
|
1456
|
+
const rng = createRng(3020);
|
|
1457
|
+
const data = [];
|
|
1458
|
+
const target = [];
|
|
1459
|
+
for (let i = 0; i < 50; i++) {
|
|
1460
|
+
data.push([1 + rng() * 0.8, 0.5 + rng() * 0.6, -1 + rng() * 0.7, 2 + rng() * 0.5]);
|
|
1461
|
+
target.push(0);
|
|
1462
|
+
}
|
|
1463
|
+
for (let i = 0; i < 50; i++) {
|
|
1464
|
+
data.push([4 + rng() * 0.8, 3.5 + rng() * 0.6, 2 + rng() * 0.7, 5 + rng() * 0.5]);
|
|
1465
|
+
target.push(1);
|
|
1466
|
+
}
|
|
1467
|
+
__perfectlySeparable = { data, target };
|
|
1468
|
+
return __perfectlySeparable;
|
|
1469
|
+
}
|
|
1470
|
+
function loadPerfectlySeparable() {
|
|
1471
|
+
const { data, target } = getPerfectlySeparableData();
|
|
1472
|
+
return {
|
|
1473
|
+
data: chunk6AE5FKKQ_cjs.tensor(data),
|
|
1474
|
+
target: chunk6AE5FKKQ_cjs.tensor(target, { dtype: "int32" }),
|
|
1475
|
+
featureNames: ["feature_0", "feature_1", "feature_2", "feature_3"],
|
|
1476
|
+
targetNames: ["class_0", "class_1"],
|
|
1477
|
+
description: `${SYNTHETIC_NOTE} 100 samples, 4 features, 2 linearly separable classes.`
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
exports.DataLoader = DataLoader;
|
|
1482
|
+
exports.datasets_exports = datasets_exports;
|
|
1483
|
+
exports.loadBreastCancer = loadBreastCancer;
|
|
1484
|
+
exports.loadConcentricRings = loadConcentricRings;
|
|
1485
|
+
exports.loadCropYield = loadCropYield;
|
|
1486
|
+
exports.loadCustomerSegments = loadCustomerSegments;
|
|
1487
|
+
exports.loadDiabetes = loadDiabetes;
|
|
1488
|
+
exports.loadDigits = loadDigits;
|
|
1489
|
+
exports.loadEnergyEfficiency = loadEnergyEfficiency;
|
|
1490
|
+
exports.loadFitnessScores = loadFitnessScores;
|
|
1491
|
+
exports.loadFlowersExtended = loadFlowersExtended;
|
|
1492
|
+
exports.loadFruitQuality = loadFruitQuality;
|
|
1493
|
+
exports.loadGaussianIslands = loadGaussianIslands;
|
|
1494
|
+
exports.loadHousingMini = loadHousingMini;
|
|
1495
|
+
exports.loadIris = loadIris;
|
|
1496
|
+
exports.loadLeafShapes = loadLeafShapes;
|
|
1497
|
+
exports.loadLinnerud = loadLinnerud;
|
|
1498
|
+
exports.loadMoonsMulti = loadMoonsMulti;
|
|
1499
|
+
exports.loadPerfectlySeparable = loadPerfectlySeparable;
|
|
1500
|
+
exports.loadPlantGrowth = loadPlantGrowth;
|
|
1501
|
+
exports.loadSeedMorphology = loadSeedMorphology;
|
|
1502
|
+
exports.loadSensorStates = loadSensorStates;
|
|
1503
|
+
exports.loadSpiralArms = loadSpiralArms;
|
|
1504
|
+
exports.loadStudentPerformance = loadStudentPerformance;
|
|
1505
|
+
exports.loadTrafficConditions = loadTrafficConditions;
|
|
1506
|
+
exports.loadWeatherOutcomes = loadWeatherOutcomes;
|
|
1507
|
+
exports.makeBlobs = makeBlobs;
|
|
1508
|
+
exports.makeCircles = makeCircles;
|
|
1509
|
+
exports.makeClassification = makeClassification;
|
|
1510
|
+
exports.makeGaussianQuantiles = makeGaussianQuantiles;
|
|
1511
|
+
exports.makeMoons = makeMoons;
|
|
1512
|
+
exports.makeRegression = makeRegression;
|
|
1513
|
+
//# sourceMappingURL=chunk-XEG44RF6.cjs.map
|
|
1514
|
+
//# sourceMappingURL=chunk-XEG44RF6.cjs.map
|