regressio 1.0.0 → 1.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/README.md +21 -12
- package/dist/index.cjs +753 -340
- package/dist/index.d.cts +5 -32
- package/dist/index.d.ts +5 -32
- package/dist/index.js +476 -380
- package/dist/regressio_wasm_bg-zc1d7yka.wasm +0 -0
- package/dist/shared/chunk-b83k8bdn.js +280 -0
- package/dist/shared/chunk-xv8z2kms.js +4 -0
- package/package.json +14 -6
package/README.md
CHANGED
|
@@ -297,27 +297,36 @@ console.log(C.trace()); // 5
|
|
|
297
297
|
console.log(C.transpose().toArray());
|
|
298
298
|
```
|
|
299
299
|
|
|
300
|
-
## WASM
|
|
300
|
+
## WASM Acceleration
|
|
301
301
|
|
|
302
|
-
|
|
302
|
+
regressio ships with a pre-compiled Rust/WASM engine that activates automatically — no configuration needed. When the WASM binary is available, heavy computations are dispatched to compiled Rust code for significantly faster execution.
|
|
303
303
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
304
|
+
**Accelerated operations:**
|
|
305
|
+
- Matrix: multiply, transpose, add, subtract, scale, dot product, norm, determinant
|
|
306
|
+
- Decompositions: QR, Cholesky, SVD, eigenvalues (tridiagonal QL)
|
|
307
|
+
- Solvers: forward/back substitution
|
|
308
|
+
- Models: Lasso/Elastic Net coordinate descent, logistic regression IRLS, softmax, KNN distance matrices
|
|
309
|
+
- Diagnostics: correlation matrix, VIF (via correlation matrix inverse)
|
|
310
|
+
- Predictions: bootstrap OLS (1000+ resamples in a single WASM call)
|
|
311
|
+
|
|
312
|
+
If WASM is unavailable (e.g. unsupported runtime), all operations fall back silently to pure TypeScript.
|
|
307
313
|
|
|
308
314
|
```typescript
|
|
309
|
-
import {
|
|
315
|
+
import { isWasmActive } from 'regressio';
|
|
310
316
|
|
|
311
|
-
//
|
|
312
|
-
await useWasmEngine();
|
|
313
|
-
console.log(isWasmActive()); // true
|
|
317
|
+
console.log(isWasmActive()); // true if WASM loaded
|
|
314
318
|
|
|
315
|
-
//
|
|
319
|
+
// Everything just works — WASM is used transparently
|
|
316
320
|
const model = new LinearRegression();
|
|
317
321
|
model.fit(X, y); // QR decomposition runs in Rust
|
|
322
|
+
```
|
|
318
323
|
|
|
319
|
-
|
|
320
|
-
|
|
324
|
+
### Rebuilding WASM
|
|
325
|
+
|
|
326
|
+
The pre-built WASM binary is included in the package. To rebuild from Rust source (requires [Rust](https://rustup.rs/) with `wasm32-unknown-unknown` target):
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
bun run build:wasm
|
|
321
330
|
```
|
|
322
331
|
|
|
323
332
|
## License
|