承接 denissimon/prediction-builder 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

denissimon/prediction-builder

最新稳定版本:v1.1.2

Composer 安装命令:

composer require denissimon/prediction-builder

包简介

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

README 文档

README

Latest Stable Version Total Downloads License

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

Requirements

This project requires PHP 5.4 or higher because makes use of trait and short array syntax.

Installation

You can install the library by Composer. Add this to your project's composer.json:

"require": {
    "denissimon/prediction-builder": "*"
}

Then run php composer.phar install (or composer install).

Example

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:

$result->ln_model linear model that fits the data: "29.56362+10.46364x"

$result->cor correlation coefficient: 0.8348

$result->x given x value: 4.5

$result->y predicted y value: 76.65

License

Licensed under the MIT License

统计信息

  • 总下载量: 6.71k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 115
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 114
  • Watchers: 8
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固