Skip to main content
Deepbox Hero

The TypeScript Toolkit for AI & Numerical Computing

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.

Quick Start

Get up and running in 5 minutes with a complete example

Installation

Install Deepbox with npm, yarn, or pnpm

Core Concepts

Learn about tensors, autograd, and broadcasting

API Reference

Explore the complete API documentation

Key Features

90+ operations for arithmetic, trigonometric, logical, reductions, sorting, and manipulation
  • Automatic differentiation: GradTensor with reverse-mode backpropagation
  • Broadcasting: Full broadcasting semantics for element-wise operations
  • Sparse matrices: CSR format with arithmetic and matrix operations
  • Multiple dtypes: float32, float64, int32, int64, uint8, bool, string
  • Activation functions: ReLU, Sigmoid, Softmax, GELU, Mish, Swish, ELU, LeakyReLU
Tabular API with familiar operations for data manipulation
  • Filtering, grouping, joining, merging, pivoting, sorting
  • CSV I/O for reading and writing files
  • Descriptive statistics: describe(), value counts, correlation matrices
  • Series for one-dimensional labeled data
Classical ML models with scikit-learn-inspired API
  • Linear models: LinearRegression, Ridge, Lasso, LogisticRegression
  • Tree-based: DecisionTreeClassifier/Regressor, RandomForestClassifier/Regressor
  • Ensemble: GradientBoostingClassifier/Regressor
  • SVM: LinearSVC, LinearSVR
  • Neighbors: KNeighborsClassifier, KNeighborsRegressor
  • Naive Bayes: GaussianNB
  • Clustering: KMeans, DBSCAN
  • Dimensionality reduction: PCA, t-SNE
Deep learning layers and modules for building custom architectures
  • Layers: Linear, Conv1d, Conv2d, MaxPool2d, AvgPool2d
  • Recurrent: RNN, LSTM, GRU
  • Attention: MultiheadAttention, TransformerEncoderLayer
  • Normalization: BatchNorm1d, LayerNorm
  • Regularization: Dropout
  • Losses: MSE, MAE, CrossEntropy, BCE, Huber
Advanced mathematical operations for scientific computing
  • Decompositions: SVD, QR, LU, Cholesky, Eigenvalue (eig, eigh)
  • Solvers: solve(), lstsq(), solveTriangular()
  • Properties: det(), trace(), matrixRank(), cond(), norm()
  • Statistics: mean, median, mode, variance, std, skewness, kurtosis
  • Hypothesis tests: t-tests, ANOVA, chi-square, Shapiro-Wilk, Mann-Whitney U
Complete ML pipeline utilities for data preparation and model training
  • Scalers: StandardScaler, MinMaxScaler, RobustScaler, Normalizer
  • Encoders: LabelEncoder, OneHotEncoder, OrdinalEncoder
  • Splitting: trainTestSplit, KFold, StratifiedKFold
  • Optimizers: SGD, Adam, AdamW, RMSprop, Adagrad
  • LR Schedulers: StepLR, CosineAnnealingLR, OneCycleLR

Why Deepbox?

Type-Safe

Built with TypeScript for excellent IDE support and compile-time safety

Zero Dependencies

No runtime dependencies - just pure TypeScript

Production Ready

4,344 tests ensure reliability and correctness

Modular Design

Import only what you need for optimal bundle size

Node.js Native

Works seamlessly in Node.js >= 24.13.0

Competitive Performance

Pure TypeScript implementation with competitive performance

Quick Example

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);

Next Steps

Installation Guide

Install Deepbox and set up your development environment

Quick Start Tutorial

Build your first Deepbox application in minutes

Core Concepts

Understand the fundamental concepts behind Deepbox

Examples

Explore practical examples and use cases

Build docs developers (and LLMs) love