regression

WebJar for regression

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

regression
Последняя версия

Последняя версия

2.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

regression
WebJar for regression
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/tom-alexander/regression-js

Скачать regression

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/regression/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>regression</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/regression/
implementation 'org.webjars.npm:regression:2.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/regression/
implementation ("org.webjars.npm:regression:2.0.1")
'org.webjars.npm:regression:jar:2.0.1'
<dependency org="org.webjars.npm" name="regression" rev="2.0.1">
  <artifact name="regression" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='regression', version='2.0.1')
)
libraryDependencies += "org.webjars.npm" % "regression" % "2.0.1"
[org.webjars.npm/regression "2.0.1"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

regression-js

npm version npm downloads

regression-js is a JavaScript module containing a collection of linear least-squares fitting methods for simple data analysis.

Installation

This module works on node and in the browser. It is available as the 'regression' package on npm. It is also available on a CDN.

npm

npm install --save regression

Usage

import regression from 'regression';
const result = regression.linear([[0, 1], [32, 67], [12, 79]]);
const gradient = result.equation[0];
const yIntercept = result.equation[1];

Data is passed into the model as an array. A second parameter can be used to configure the model. The configuration parameter is optional. null values are ignored. The precision option will set the number of significant figures the output is rounded to.

Configuration options

Below are the default values for the configuration parameter.

{
  order: 2,
  precision: 2,
}

Properties

  • equation: an array containing the coefficients of the equation
  • string: A string representation of the equation
  • points: an array containing the predicted data in the domain of the input
  • r2: the coefficient of determination (R2)
  • predict(x): This function will return the predicted value

API

regression.linear(data[, options])

Fits the input data to a straight line with the equation y = mx + c. It returns the coefficients in the form [m, c].

regression.exponential(data[, options])

Fits the input data to a exponential curve with the equation y = ae^bx. It returns the coefficients in the form [a, b].

regression.logarithmic(data[, options])

Fits the input data to a logarithmic curve with the equation y = a + b ln x. It returns the coefficients in the form [a, b].

regression.power(data[, options])

Fits the input data to a power law curve with the equation y = ax^b. It returns the coefficients in the form [a, b].

regression.polynomial(data[, options])

Fits the input data to a polynomial curve with the equation anx^n ... + a1x + a0. It returns the coefficients in the form [an..., a1, a0]. The order can be configure with the order option.

Example

const data = [[0,1],[32, 67] .... [12, 79]];
const result = regression.polynomial(data, { order: 3 });

Development

  • Install the dependencies with npm install
  • To build the assets in the dist directory, use npm run build
  • You can run the tests with: npm run test.

Версии библиотеки

Версия
2.0.1