Socket
Socket
Sign inDemoInstall

lobf

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lobf

Find the line of best fit given a set of points


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

lobf

Find the line of best fit given a set of points

lobf on NPM

Build Status lobf's Total Downloads on NPM lobf's Version on NPM bitHound Overall Score bitHound Code Dependencies Dev Dependencies Known Vulnerabilities lobf's License lobf's Stars on GitHub

Example Usage

const lobf = require('lobf');

const myLineOfBestFit = lobf([
	// [x, y]
	[1.5, 3],
	[1.5, 2],
	[2, 1.5]
]);

console.log(myLineOfBestFit);
// Logs {
//	'slope' : -2,
//	'intercept' : 5.5
// }

API

module.exports is a function as follows:

  • function (points: [x, y][]) - calculate the line of best fit for the given points.
    • points: [x, y][] - an array of arrays with element 0 as the x coordinate and element 1 as the y coordinate.
    • returns - { slope, intercept }:
      • slope: Number - the slope of the line, or the m in y = mx + b.
      • intercept: Number - the intercept of the line, or the b in y = mx + b.

Keywords

FAQs

Last updated on 13 Aug 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc