Data science for JavaScript

Analyze data, build models, visualize results—all in JavaScript.

Get Started View on GitHub


Quick example

import * as ds from '@tangent/ds';
import * as Plot from '@observablehq/plot';

// Run PCA in 3 lines
const pca = new ds.mva.PCA({ center: true, scale: true });
pca.fit({ data: myData, X: ["var1", "var2", "var3"] });
ds.plot.ordiplot(pca.model).show(Plot);

Features

Multivariate analysis

Ordination techniques (PCA, LDA, RDA) and clustering algorithms (hierarchical, k-means) for exploring complex datasets.

Try Ordination

Statistical analysis

Comprehensive statistical toolkit including t-tests, ANOVA, generalized linear models (GLM), and mixed-effects models.

Explore Statistics

Machine learning

Build predictive models with K-nearest neighbors, multilayer perceptrons, decision trees, and more. Complete with cross-validation and hyperparameter tuning.

Learn ML

Visualization

Publication-ready plots powered by Observable Plot. Create biplots, confusion matrices, dendrograms, and more.

See Examples


Why tangent/ds?

Native JavaScript
No Python or R required. Run analyses directly in the browser or Node.js/Deno.
Modern API
Clean, intuitive API inspired by scikit-learn and R’s tidyverse.
Toolkit
From data preprocessing to model evaluation, in one package.

Installation

# npm
npm install @tangent/ds

# deno
deno add @tangent/ds

Read the full guide →


Community


License

tangent/ds is distributed under the GPL-3 License.