Examples
50 hands-on examples covering every Deepbox module — from tensor basics to training neural networks. Each example includes full source code, console output, and detailed explanations.
Quick Start Guide
A rapid introduction to Deepbox's core features — tensors, DataFrames, and machine learning in under 50 lines.
Tensor Basics
Learn the fundamentals of creating and manipulating tensors (N-dimensional arrays). Tensors are the core data structure in Deepbox.
Tensor Operations
Explore arithmetic, mathematical, and reduction operations on tensors. Deepbox supports 90+ tensor operations with full broadcasting.
Data Analysis & Visualization
Comprehensive data analysis workflow using DataFrames, statistics, and plotting. Explores, analyzes, and visualizes employee data.
DataFrame Basics
Learn fundamental DataFrame operations for working with tabular data. Covers creation, selection, filtering, and sorting — for tabular data analysis.
DataFrame GroupBy & Aggregation
Learn to group and aggregate data for analysis. Similar to SQL GROUP BY operations.
Complete Machine Learning Pipeline
End-to-end ML pipeline demonstrating classification with the Iris dataset and regression with the Housing-Mini dataset. Includes data preprocessing, model comparison, cross-validation, and visualization.
Linear Regression
Build a simple linear regression model to predict continuous values. Learn the basics of supervised learning with Deepbox.
Logistic Regression
Build a binary classification model using logistic regression. Learn to classify data into two categories using the Iris dataset.
Ridge & Lasso Regression
Compare L1 (Lasso) and L2 (Ridge) regularization techniques. Learn when to use each regularization method.
Advanced ML Models
Demonstrates advanced ML models: KMeans clustering, K-Nearest Neighbors (classification and regression), PCA dimensionality reduction, and Gaussian Naive Bayes.
Tree-Based & Ensemble Models
Decision Trees, Random Forests, Gradient Boosting, and Linear SVM. Covers both classification and regression variants.
Complete ML Pipeline
Bring everything together in a comprehensive machine learning workflow. From data loading to model evaluation and visualization.
Neural Network Training
Build and train neural networks using the nn, optim, and autograd modules. Covers Sequential models, custom modules, loss functions, and optimizers.
Automatic Differentiation (Autograd)
Deepbox's autograd system tracks operations on GradTensors to build a computation graph, then computes gradients via reverse-mode differentiation.
Activation Functions
Explore different activation functions used in neural networks. Learn when to use each activation function.
Learning Rate Schedulers
Control the learning rate during training for better convergence. Deepbox provides 8 learning rate schedulers.
Preprocessing — Encoders
Transform categorical and label data into numeric representations using Deepbox's encoding utilities.
Preprocessing — Scalers
Feature scaling is essential before many ML algorithms. Deepbox provides 7 feature scalers.
Statistical Analysis
Perform descriptive statistics and hypothesis testing. Analyze data distributions and test hypotheses.
Linear Algebra Operations
Explore matrix decompositions and linear system solving. Essential for understanding ML algorithms under the hood.
Random Sampling & Distributions
Generate random numbers from various probability distributions. Useful for simulations, Monte Carlo methods, and data generation.
Built-in Datasets
Explore Deepbox's 24 built-in datasets and 6 synthetic generators for quick experimentation. Perfect for learning and testing ML algorithms.
Cross-Validation Strategies
Learn different cross-validation techniques for robust model evaluation. Essential for assessing model generalization.
Model Evaluation Metrics
Learn to evaluate models using various performance metrics. Different metrics for classification, regression, and clustering.
Data Visualization
Create various types of plots to visualize data and results. Deepbox supports SVG and PNG output for publication-quality figures.
Sparse Matrix Operations
Demonstrates CSR (Compressed Sparse Row) matrix operations. Memory-efficient representation for matrices with many zeros.
CNN Layers
Demonstrates convolutional neural network layers: Conv1d, Conv2d, MaxPool2d, and AvgPool2d.
Recurrent Neural Network Layers
Demonstrates RNN, LSTM, and GRU layers for sequence modeling tasks.
Attention & Transformer Layers
Demonstrates MultiheadAttention and TransformerEncoderLayer for sequence-to-sequence modeling.
Normalization & Dropout Layers
Demonstrates BatchNorm1d, LayerNorm, and Dropout for training stability and regularization.
DataLoader — Batching & Shuffling
Demonstrates the DataLoader class for efficient batch iteration over datasets.
Neural Network Module System
Demonstrates the Module base class: custom modules, parameter registration, state serialization, train/eval modes, freeze/unfreeze, and Sequential container.
DataFrame Advanced Features
Advanced DataFrame operations new in v1.0.0: string/datetime accessors, rolling/expanding/EWM windows, query/eval expressions, pivot tables, crosstabs, and more.
Ensemble & Advanced ML Models
Advanced ensemble methods and ML models new in v1.0.0: AdaBoost, Bagging, Voting, Stacking, ExtraTrees, Gaussian Processes, Discriminant Analysis, and Semi-supervised Learning.
Advanced Clustering
Advanced clustering algorithms new in v1.0.0: Agglomerative, GaussianMixture, SpectralClustering, OPTICS, MiniBatchKMeans, MeanShift, Birch, and AffinityPropagation.
Kernel SVM & Anomaly Detection
Support Vector Machines with kernel tricks and anomaly detection algorithms new in v1.0.0.
Model Selection & Pipeline
Automated model selection and ML pipelines new in v1.0.0: GridSearchCV, RandomizedSearchCV, Pipeline, ColumnTransformer, and cross-validation.
Feature Engineering & Preprocessing
Advanced preprocessing tools new in v1.0.0: imputation, feature selection, text vectorizers, spline transformers, and advanced splitters.
Advanced Neural Networks
Advanced NN features new in v1.0.0: Trainer with EarlyStopping, weight initialization, Embedding layers, normalization layers, containers, and advanced activations.
Transformer Architecture
Full Transformer implementation new in v1.0.0: MultiheadAttention, TransformerEncoder/Decoder, PositionalEncoding, and complete encoder-decoder models.
Advanced Optimizers & Schedulers
Advanced optimizers and learning rate schedulers new in v1.0.0: RAdam, LAMB, LARS, CyclicLR, CosineAnnealingWarmRestarts, PolynomialLR, LambdaLR, and SequentialLR.
FFT & Signal Processing
FFT and signal processing tools new in v1.0.0: fft, ifft, rfft, irfft, fft2, ifft2, fftn, and spectral analysis utilities.
Statistical Distributions & Hypothesis Tests
Comprehensive statistics module new in v1.0.0: probability distributions, hypothesis tests, correlations, and confidence intervals.
Advanced Visualization
Visualization tools new in v1.0.0: line plots, scatter, histograms, heatmaps, confusion matrices, ROC curves, learning curves, decision boundaries, dendrograms, and 3D scatter.
Core Runtime Tooling
A runtime-focused walkthrough for the v1.0.0 `deepbox/core` surface: structured logging, warning policies, backend registration, and JSON/file serialization.
Dataset Transforms & Samplers
A data-pipeline example for the v1.0.0 dataset helpers around training loops: `Subset`, `randomSplit`, `mapDataset`, `filterDataset`, `WeightedRandomSampler`, and `SubsetRandomSampler`.
DataFrame IO & Styling
A practical DataFrame operations example for the v1.0.0 polish layer: JSON/XLSX/Parquet round-trips, datetime parsing, styling, and pandas-like plotting accessors.
Statistical Inference Playbook
A focused walkthrough for the v1.0.0 inference APIs that were still missing from the runnable docs: confidence intervals, bootstrap resampling, Gaussian KDE, multiple-comparison correction, and statistical power planning.
Advanced Linear Algebra Toolkit
A focused v1.0.0 linear algebra example covering the new advanced routines missing from the earlier decomposition walkthrough: Hessenberg and Schur decompositions, polar decomposition, matrix functions, structured solvers, sparse CSR solving, and Sylvester/Lyapunov equations.