2017 © Pedro Peláez
 

library prediction-builder

A library for machine learning that builds predictions using a linear regression.

image

denissimon/prediction-builder

A library for machine learning that builds predictions using a linear regression.

  • Friday, January 5, 2018
  • by denissimon
  • Repository
  • 5 Watchers
  • 86 Stars
  • 4,739 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 4 Versions
  • 3 % Grown

The README.md

PredictionBuilder

Latest Stable Version Total Downloads License, (*1)

PredictionBuilder is a library for machine learning that builds predictions using a linear regression., (*2)

Requirements

This project requires PHP 5.4 or higher because makes use of trait and short array syntax., (*3)

Installation

You can install the library by Composer. Add this to your project's composer.json:, (*4)

``` json "require": { "denissimon/prediction-builder": "*" }, (*5)


Then run `php composer.phar install` (or `composer install`). Example ------- ``` php use PredictionBuilder\PredictionBuilder; require_once __DIR__ . '/vendor/autoload.php'; $data = [[1,20],[2,70],[2,45],[3,81],[5,73],[6,80],[7,110]]; $x = 4.5; // What is the expected y value for a given x value? try { $prediction = new PredictionBuilder($x, $data); $result = $prediction->build(); // y = 76.65 } catch (\Exception $e) { echo $e->getMessage(), "\n"; }

The returned object has the following properties:, (*6)

$result->ln_model linear model that fits the data: "29.56362+10.46364x", (*7)

$result->cor correlation coefficient: 0.8348, (*8)

$result->x given x value: 4.5, (*9)

$result->y predicted y value: 76.65, (*10)

License

Licensed under the MIT License, (*11)

The Versions

05/01 2018

dev-master

9999999-dev

A library for machine learning that builds predictions using a linear regression.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Denis Simon

machine learning prediction regression

05/01 2018

v1.0.2

1.0.2.0

A library for machine learning that builds predictions using a linear regression.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Denis Simon

machine learning prediction regression

05/01 2017

v1.0.1

1.0.1.0

A library for machine learning that builds predictions using a linear regression.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Denis Simon

machine learning prediction regression

12/08 2015

v1.0.0

1.0.0.0

A library for machine learning that builds predictions using a linear regression.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Denis Simon

machine learning prediction regression