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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/datasets.js +9 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xy-scale",
3
- "version": "1.4.47",
3
+ "version": "1.4.48",
4
4
  "main": "./index.js",
5
5
  "type": "module",
6
6
  "scripts": {
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
- throw new Error(`Invalid numeric value returned from "xCallbackFunc".`);
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
- throw new Error(`Invalid numeric value returned from "xCallbackFunc".`);
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) {