xy-scale 1.0.2 → 1.0.3
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 +28 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -154,6 +154,34 @@ The `parseLabels` function defines the target output (or labels) that the machin
|
|
|
154
154
|
|
|
155
155
|
---
|
|
156
156
|
|
|
157
|
+
### Upcoming Feature: Optional Precision Handling with Big.js and BigNumber.js
|
|
158
|
+
|
|
159
|
+
In the next release, we are introducing an optional **precision** feature to enhance decimal precision in financial and scientific datasets. This feature will allow users to integrate **Big.js** or **BigNumber.js** libraries seamlessly into their data processing workflow by adding a new `precision` property to the parameters of `parseTrainingDataset` and `parseProductionDataset`.
|
|
160
|
+
|
|
161
|
+
#### How Precision Handling Will Work
|
|
162
|
+
|
|
163
|
+
With the new `precision` property, users can pass either Big.js or BigNumber.js as callback functions to handle high-precision decimal calculations. This makes the integration fully optional, allowing flexibility based on the precision requirements of the dataset. When `precision` is set, the toolkit will use the specified library for all numeric computations, ensuring high precision and minimizing rounding errors.
|
|
164
|
+
|
|
165
|
+
**Future Example Usage:**
|
|
166
|
+
|
|
167
|
+
```javascript
|
|
168
|
+
import Big from 'big.js';
|
|
169
|
+
import BigNumber from "bignumber.js";
|
|
170
|
+
import { parseTrainingDataset, parseProductionDataset } from './scale.js';
|
|
171
|
+
|
|
172
|
+
const trainingData = parseTrainingDataset({
|
|
173
|
+
arrObj: myArray,
|
|
174
|
+
trainingSplit: 0.75,
|
|
175
|
+
weights: { open: 1, high: 1, low: 1, sma_200: 1, sma_100: 1 },
|
|
176
|
+
parseLabels,
|
|
177
|
+
parseFeatures,
|
|
178
|
+
precision: Big, // Big or BigNumber for high-precision calculations
|
|
179
|
+
forceScaling: 'normalization'
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
157
185
|
## Technical Details
|
|
158
186
|
|
|
159
187
|
- **Error Handling**: Validates scaling approach values and ensures positive feature weights.
|