Regression libraries for NodeJS

We do Node JS Consulting.

We've delivered complex, enterprise applications for billion dollar companies and small product shops. Our specialty is data-driven architectures, analytics, machine-learning and visualization.

Maybe the most important tool for generating synthetic data is the regression. Different kinds of regressions provide different approaches to generating new synthetic values based on a training set of data. Our technology stack is primarily built on JavaScript and NodeJS, so we’ve put together a quick run-down on the different regression libraries we use.



npm i ml

ML.js contains a number of different regressions, including linear, polynomial, multivariate and logistic. Documentation is good, and there is a large community supporting and using the package.

JS Regression


npm i js-regression

JS Regression provides two regression APIs: linear and logistic. Unlike some other libraries, the linear regression accepts polynomial values as a nested array. Similarly, the logistic regression method accepts a simple training set as a nested array. One small gotcha with this library is that the output variable for the logistic regression is always the last variable in the array ‘row’. You can customize the regressions with different settings for iterations, alpha and lambda.



npm i regression

Regression is a more simple library of common regressions, including linear, logarithmic and exponential. Each method accepts a nested array and outputs the slope and y intercept variables as an array. This library has more limited configuration options.

Simple Statistics


npm i simple-statistics

Simple statistics provides great documentation and a very mature codebase. It provides a number of different statistical methods, in addition to linear regressions.



npm i jerzy

Jerzy also provides a good list of standard Statistical methods, with a few nice-to-haves like 95% CI computation.

Stream Statistics


npm I stream-statistics

This one doesn’t do any regressions, but we think its pretty cool for running statistical characterization of streaming data, like moving window averages.