
Security News
Federal Audit Finds NIST Wasted Funds With No Plan to Clear NVD Backlog
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.
Deepbox is a comprehensive, type-safe TypeScript library that unifies numerical computing, tabular data workflows, and machine learning into a single modular package. Zero runtime dependencies. 4,344 tests. Production-ready.
Documentation: https://deepbox.dev/docs · Examples: https://deepbox.dev/examples · Projects: https://deepbox.dev/projects
>= 24.13.0npm install deepbox
import { tensor, add, parameter } from "deepbox/ndarray";
import { DataFrame } from "deepbox/dataframe";
import { LinearRegression } from "deepbox/ml";
// Tensor operations with broadcasting
const a = tensor([
[1, 2],
[3, 4],
]);
const b = tensor([
[5, 6],
[7, 8],
]);
const c = add(a, b); // tensor([[6, 8], [10, 12]])
// Automatic differentiation
const x = parameter([2, 3]);
const y = x.mul(x).sum();
y.backward();
// x.grad -> tensor([4, 6])
// DataFrame operations
const df = new DataFrame({
name: ["Alice", "Bob", "Charlie"],
age: [25, 30, 35],
score: [85, 90, 78],
});
// Machine learning
const model = new LinearRegression();
model.fit(XTrain, yTrain);
const predictions = model.predict(XTest);
Prefer per-module imports for tree-shaking, or use namespaces from the root:
import * as db from "deepbox";
const t = db.ndarray.tensor([1, 2, 3]);
| Module | What it provides | Docs |
|---|---|---|
deepbox/core | Types, errors, validation, dtype helpers, configuration | core |
deepbox/ndarray | N-D tensors with autograd, broadcasting, 90+ ops, sparse matrices | ndarray |
deepbox/linalg | SVD, QR, LU, Cholesky, eigenvalue decomposition, solvers, norms | linalg |
deepbox/dataframe | DataFrame + Series with 50+ operations, CSV I/O | dataframe |
deepbox/stats | Descriptive stats, correlations, hypothesis tests (t-test, ANOVA, chi-square, etc.) | stats |
deepbox/metrics | 40+ ML metrics (classification, regression, clustering) | metrics |
deepbox/preprocess | Scalers, encoders, normalizers, cross-validation splits | preprocess |
deepbox/ml | Classical ML (Linear, Ridge, Lasso, Logistic, Trees, SVM, KNN, Naive Bayes, Ensembles) | ml |
deepbox/nn | Neural networks (Linear, Conv, RNN/LSTM/GRU, Attention, Normalization, Losses) | nn |
deepbox/optim | Optimizers (SGD, Adam, AdamW, RMSprop, etc.) + LR schedulers | optim |
deepbox/random | Distributions (uniform, normal, binomial, gamma, beta, etc.) + sampling | random |
deepbox/datasets | Built-in datasets (Iris, Digits, Breast Cancer, etc.) + synthetic generators | datasets |
deepbox/plot | SVG/PNG plotting (scatter, line, bar, hist, heatmap, contour, ML plots) | plot |
GradTensor with reverse-mode backpropagationdescribe(), value counts, correlation matricessolve(), lstsq(), solveTriangular()det(), trace(), matrixRank(), cond(), slogdet()norm() (L1, L2, Frobenius, nuclear, inf)inv(), pinv()import { parameter } from "deepbox/ndarray";
const x = parameter([
[1, 2],
[3, 4],
]);
const w = parameter([[0.5], [0.5]]);
const y = x.matmul(w).sum();
y.backward();
// x.grad -> gradients w.r.t. x
// w.grad -> gradients w.r.t. w
import { Sequential, Linear, ReLU, Dropout, mseLoss } from "deepbox/nn";
import { Adam } from "deepbox/optim";
const model = new Sequential(
new Linear(10, 64),
new ReLU(),
new Dropout(0.2),
new Linear(64, 32),
new ReLU(),
new Linear(32, 1),
);
const optimizer = new Adam(model.parameters(), { lr: 0.001 });
for (let epoch = 0; epoch < 100; epoch++) {
const output = model.forward(xTrain);
const loss = mseLoss(output, yTrain);
optimizer.zeroGrad();
loss.backward();
optimizer.step();
}
import { trainTestSplit, StandardScaler } from "deepbox/preprocess";
import { RandomForestClassifier } from "deepbox/ml";
import { accuracy, f1Score } from "deepbox/metrics";
const [XTrain, XTest, yTrain, yTest] = trainTestSplit(X, y, {
testSize: 0.2,
randomState: 42,
});
const scaler = new StandardScaler();
scaler.fit(XTrain);
const XTrainScaled = scaler.transform(XTrain);
const XTestScaled = scaler.transform(XTest);
const model = new RandomForestClassifier({ nEstimators: 100, maxDepth: 10 });
model.fit(XTrainScaled, yTrain);
const yPred = model.predict(XTestScaled);
console.log("Accuracy:", accuracy(yTest, yPred));
console.log("F1 Score:", f1Score(yTest, yPred));
import {
DecisionTreeClassifier,
GradientBoostingClassifier,
KNeighborsClassifier,
LinearSVC,
} from "deepbox/ml";
const tree = new DecisionTreeClassifier({ maxDepth: 5 });
tree.fit(XTrain, yTrain);
const gb = new GradientBoostingClassifier({
nEstimators: 100,
learningRate: 0.1,
});
gb.fit(XTrain, yTrain);
const knn = new KNeighborsClassifier({ nNeighbors: 5 });
knn.fit(XTrain, yTrain);
const svm = new LinearSVC({ C: 1.0 });
svm.fit(XTrain, yTrain);
import { DataFrame } from "deepbox/dataframe";
const df = new DataFrame({
name: ["Alice", "Bob", "Charlie", "David"],
age: [25, 30, 35, 28],
salary: [50000, 60000, 75000, 55000],
department: ["IT", "HR", "IT", "HR"],
});
const itDept = df.filter((row) => row.department === "IT");
const avgSalary = df.groupBy("department").agg({ salary: "mean" });
const sorted = df.sort("salary", false);
import { scatter, plot, hist, heatmap, saveFig } from "deepbox/plot";
import { tensor } from "deepbox/ndarray";
scatter(tensor([1, 2, 3, 4, 5]), tensor([2, 4, 5, 4, 6]), { color: "#1f77b4" });
plot(tensor([1, 2, 3, 4, 5]), tensor([2, 4, 5, 4, 6]), { color: "#ff7f0e" });
hist(tensor([1, 2, 2, 3, 3, 3, 4, 4, 5]), { bins: 5 });
heatmap(
tensor([
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
]),
);
saveFig("output.svg");
Deepbox is pure TypeScript — no native addons, no WebAssembly, no C bindings. Every operation runs on V8’s JIT compiler with TypedArray backing. Despite competing against Python libraries that use hand-tuned C and Fortran backends (BLAS, LAPACK, ATen), Deepbox delivers competitive or superior performance in several areas.
542 head-to-head benchmarks across 10 categories, tested on the same machine with identical data sizes and iteration counts:
| Category | Deepbox Wins | Python Package Wins | Competing Against |
|---|---|---|---|
| DataFrames | 23 | 32 | Pandas (C / Cython) |
| Datasets | 11 | 30 | scikit-learn |
| Linear Algebra | 0 | 54 | NumPy + SciPy (LAPACK) |
| Metrics | 46 | 17 | scikit-learn (C / Cython) |
| ML Training | 15 | 33 | scikit-learn (C / Cython) |
| NDArray Ops | 6 | 88 | NumPy (C / BLAS) |
| Plotting | 43 | 0 | Matplotlib (C / Agg) |
| Preprocessing | 19 | 24 | scikit-learn (C / Cython) |
| Random | 0 | 44 | NumPy (C) |
| Statistics | 30 | 27 | SciPy (C / Fortran) |
| Total | 193 | 349 |
Python’s numerical libraries delegate heavy lifting to compiled C/Fortran code (OpenBLAS, MKL, LAPACK). Deepbox implements everything in TypeScript, relying on V8’s TurboFan JIT and Float64Array for performance. The gap is largest for BLAS-bound operations (matmul, decompositions) and smallest for memory-layout operations (transpose, reshape, indexing) where Deepbox’s lazy-view architecture has an advantage.
Run
npm run bench:allto reproduce. Full results inbenchmarks/RESULTS.md.
See CONTRIBUTING.md for the full development workflow.
npm install # Install dependencies
npm run build # Build the package
npm test # Run 4,344 tests
npm run typecheck # Type checking
npm run lint # Lint with Biome
npm run format # Format with Biome
npm run all # Run all checks
MIT License — see LICENSE for details.
Built by Jehaad Aljohani
FAQs
The TypeScript Toolkit for AI & Numerical Computing
The npm package deepbox receives a total of 0 weekly downloads. As such, deepbox popularity was classified as not popular.
We found that deepbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.