GitHub
deepbox/ml

Linear Models

Linear, regularized, robust, kernel, probabilistic, and SGD-based models for regression and classification.
Linear estimators

BayesianRidge

Bayesian Ridge Regression with automatic regularization.

ElasticNet

Elastic Net Regression (L1 + L2 Regularized Linear Regression).

HuberRegressor

Linear regression with Huber loss for robustness to outliers.

IsotonicRegression

Isotonic Regression.

KernelRidge

Kernel Ridge Regression.

Lasso

Lasso Regression (L1 Regularized Linear Regression).

LinearRegression

Ordinary Least Squares Linear Regression.

LogisticRegression

Logistic Regression (Binary and Multiclass Classification).

QuantileRegressor

QuantileRegressor is part of the deepbox/ml public API.

RANSACRegressor

RANSACRegressor is part of the deepbox/ml public API.

Ridge

Ridge Regression (L2 Regularized Linear Regression).

SGDClassifier

SGD Classifier — Linear classifiers with SGD training.

SGDRegressor

SGD Regressor — Linear regressor with SGD training.

ml-linear.ts
import {  BayesianRidge,  ElasticNet,  LinearRegression,  LogisticRegression,  Ridge,} from "deepbox/ml";import { tensor } from "deepbox/ndarray";const X = tensor([[1], [2], [3], [4]]);const y = tensor([2, 4, 6, 8]);console.log(new LinearRegression().fit(X, y).predict(tensor([[5]])).toString());console.log(new Ridge({ alpha: 1 }).fit(X, y).predict(tensor([[5]])).toString());console.log(new ElasticNet({ alpha: 0.1 }).fit(X, y).predict(tensor([[5]])).toString());console.log(new BayesianRidge().fit(X, y).predict(tensor([[5]])).toString());console.log(new LogisticRegression().fit(tensor([[0], [1], [2], [3]]), tensor([0, 0, 1, 1])).predict(tensor([[1.5]])).toString());