Coder Social home page Coder Social logo

regression-trend's Introduction

Build Status Coverage Status

Regression Trend

Library for creating regression and trend from requested data set.

Regression Trend on NPM

Supported Regression Types

  • Linear
  • Power

Quick Start

Input data looks

Data pattern must looks like { x: point, y: value}

data = [{x:1,y:10},{x:2,y:15}..{x:10,y:50}];

If you want see predictable values use null for value

data = [{x:1,y:10},{x:2,y:15}..{x:10,y:50},{x:11,y:null}];

Predictable value can be everywhere

data = [{x:1,y:10},{x:2,y:null}..{x:10,y:50},{x:11,y:null}];

or

data = [{x:1,y:null},{x:2,y:null}..{x:10,y:50},{x:11,y:150}];

Try not use zero value for x,y but if you need just do it

Example output data

{ equation: { a: -1, b: 1 },
  points: 
   [ { x: 1, y: 0 },
     { x: 2, y: 1 },
     { x: 3, y: 2 },
     { x: 4, y: 3 },
     { x: 5, y: 4 } ],
  pattern: 'y = -1 + 1 * x' }

Generate regression and trend for requested point

You can use data not in order

var regression = require('regression-trend');
var inputData = [{x:1,y:10},{x:2,y:15},{x:10,y:50}];

var output = regression.generate(inputData);

You can create predictable values for selected points

var value = regression.trend(output.equation,5);

Generate regression for another type

You can create regression for another type default type of regression is linear

List of all types is in

regression.TYPES

Setting other type than default

regression.setType(regression.TYPES.power);

regression-trend's People

Contributors

asddsdassad avatar

Stargazers

 avatar

Watchers

 avatar  avatar

regression-trend's Issues

Main file

Main file should be src/regression.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.