xy-scale 1.4.47 → 1.4.48
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/package.json +1 -1
- package/src/datasets.js +9 -3
package/package.json
CHANGED
package/src/datasets.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { arrayShuffle } from "./utilities.js";
|
|
2
|
-
import { validateFirstRow, validateArray, hasInvalidNumbers, validateSizes } from "./validators.js";
|
|
2
|
+
import { validateFirstRow, validateArray, hasInvalidNumbers, validateSizes, isNumber } from "./validators.js";
|
|
3
3
|
import {zscore} from './zscore.js'
|
|
4
4
|
|
|
5
5
|
export const parseTrainingXY = ({
|
|
@@ -46,7 +46,10 @@ export const parseTrainingXY = ({
|
|
|
46
46
|
if (parsedX == null || parsedY == null) continue;
|
|
47
47
|
|
|
48
48
|
if (hasInvalidNumbers(parsedX, 'parseTrainingXY')) {
|
|
49
|
-
|
|
49
|
+
|
|
50
|
+
const invalids = Object.entries(parsedX).find(arr => !isNumber(arr[1]))
|
|
51
|
+
|
|
52
|
+
throw new Error(`Invalid numeric value returned from "xCallbackFunc": ${JSON.stringify(invalids)}`);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
if (keyNamesX === null) {
|
|
@@ -229,7 +232,10 @@ export const parseProductionX = ({
|
|
|
229
232
|
if (parsedX == null) continue;
|
|
230
233
|
|
|
231
234
|
if (hasInvalidNumbers(parsedX, 'parseProductionX')) {
|
|
232
|
-
|
|
235
|
+
|
|
236
|
+
const invalids = Object.entries(parsedX).find(arr => !isNumber(arr[1]))
|
|
237
|
+
|
|
238
|
+
throw new Error(`Invalid numeric value returned from "xCallbackFunc": ${JSON.stringify(invalids)}`);
|
|
233
239
|
}
|
|
234
240
|
|
|
235
241
|
if (keyNamesX === null) {
|