Data science for JavaScript
Analyze data, build models, visualize results—all in JavaScript.
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.
Statistical analysis
Comprehensive statistical toolkit including t-tests, ANOVA, generalized linear models (GLM), and mixed-effects models.
Data clustering
Unsupervised classification with hierarchical clustering, k-means or DBSCAN.
Machine learning
Build predictive models with K-nearest neighbors, multilayer perceptrons, decision trees, and more. Complete with cross-validation and hyperparameter tuning.
Visualization
Publication-ready plots powered by Observable Plot. Create biplots, confusion matrices, dendrograms, and more.
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
Community
- GitHub: tangent-to/ds
- Issues: Report bugs
- Discussions: Ask questions
License
tangent/ds is distributed under the GPL-3 License.