xy-scale 1.3.9 → 1.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xy-scale",
3
- "version": "1.3.9",
3
+ "version": "1.4.0",
4
4
  "main": "./index.js",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/datasets.js CHANGED
@@ -41,12 +41,12 @@ export const parseTrainingXY = ({
41
41
  }
42
42
  }
43
43
 
44
- if(shuffle)
44
+ /* if(shuffle)
45
45
  {
46
46
  const {shuffledX, shuffledY} = xyArrayShuffle(X, Y)
47
47
  X = shuffledX
48
48
  Y = shuffledY
49
- }
49
+ } */
50
50
 
51
51
  const excludesSet = new Set(excludes)
52
52
 
@@ -72,6 +72,14 @@ export const parseTrainingXY = ({
72
72
 
73
73
  let trainX = scaledX.slice(0, splitIndex)
74
74
  let trainY = flatY.slice(0, splitIndex)
75
+
76
+ if(shuffle)
77
+ {
78
+ const {shuffledX, shuffledY} = xyArrayShuffle(trainX, trainY)
79
+ trainX = shuffledX
80
+ trainY = shuffledY
81
+ }
82
+
75
83
  let testX = scaledX.slice(splitIndex)
76
84
  let testY = flatY.slice(splitIndex)
77
85
 
package/test/test.js CHANGED
@@ -55,7 +55,7 @@ const test = async () => {
55
55
 
56
56
  return curr.ema_50 > curr.sma_300 && curr.sma_200 > curr.sma_300 && (curr.price_x_sma_300 === -1 || curr.price_x_sma_300 === 1)
57
57
  },
58
- shuffle: false,
58
+ shuffle: true,
59
59
  minmaxRange: [0, 1],
60
60
  balancing: null,
61
61
  groups: scaledGroups,