Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

regression

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

regression

Javascript least squares data fitting methods

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is regression?

The 'regression' npm package is a simple and efficient library for performing various types of regression analysis. It supports multiple regression models including linear, exponential, logarithmic, power, and polynomial regression. This package is useful for fitting data to a model and making predictions based on that model.

What are regression's main functionalities?

Linear Regression

Performs linear regression on a set of data points. The result includes the equation of the line, the slope, the intercept, and the R-squared value.

const regression = require('regression');
const data = [[0, 1], [32, 67], [12, 79]];
const result = regression.linear(data);
console.log(result);

Exponential Regression

Performs exponential regression on a set of data points. The result includes the equation of the curve and the R-squared value.

const regression = require('regression');
const data = [[0, 1], [32, 67], [12, 79]];
const result = regression.exponential(data);
console.log(result);

Logarithmic Regression

Performs logarithmic regression on a set of data points. The result includes the equation of the curve and the R-squared value.

const regression = require('regression');
const data = [[0, 1], [32, 67], [12, 79]];
const result = regression.logarithmic(data);
console.log(result);

Power Regression

Performs power regression on a set of data points. The result includes the equation of the curve and the R-squared value.

const regression = require('regression');
const data = [[0, 1], [32, 67], [12, 79]];
const result = regression.power(data);
console.log(result);

Polynomial Regression

Performs polynomial regression on a set of data points. The result includes the equation of the curve and the R-squared value. The order of the polynomial can be specified.

const regression = require('regression');
const data = [[0, 1], [32, 67], [12, 79]];
const result = regression.polynomial(data, { order: 2 });
console.log(result);

Other packages similar to regression

Keywords

FAQs

Package last updated on 10 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc