{"id":20833843,"url":"https://github.com/denissimon/prediction-builder","last_synced_at":"2025-04-12T22:28:47.383Z","repository":{"id":33434715,"uuid":"37080032","full_name":"denissimon/prediction-builder","owner":"denissimon","description":"A library for machine learning that builds predictions using a linear regression.","archived":false,"fork":false,"pushed_at":"2024-11-14T05:51:19.000Z","size":10,"stargazers_count":112,"open_issues_count":0,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-04T01:41:47.714Z","etag":null,"topics":["composer","linear-regression","machine-learning","ml","php","prediction","regression"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/denissimon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-08T16:52:27.000Z","updated_at":"2025-01-06T04:20:18.000Z","dependencies_parsed_at":"2024-11-26T08:46:01.560Z","dependency_job_id":null,"html_url":"https://github.com/denissimon/prediction-builder","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.3571428571428571,"last_synced_commit":"e133abbe77516c3785d4fc8bd7b789d75b48ec2f"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denissimon%2Fprediction-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denissimon%2Fprediction-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denissimon%2Fprediction-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denissimon%2Fprediction-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denissimon","download_url":"https://codeload.github.com/denissimon/prediction-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248639293,"owners_count":21137819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer","linear-regression","machine-learning","ml","php","prediction","regression"],"created_at":"2024-11-18T00:16:59.661Z","updated_at":"2025-04-12T22:28:47.356Z","avatar_url":"https://github.com/denissimon.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":["General-Purpose Machine Learning"],"readme":"PredictionBuilder\n=================\n\n[![Latest Stable Version](https://poser.pugx.org/denissimon/prediction-builder/v/stable.svg)](https://packagist.org/packages/denissimon/prediction-builder)\n[![Total Downloads](https://poser.pugx.org/denissimon/prediction-builder/downloads)](https://packagist.org/packages/denissimon/prediction-builder)\n[![License](https://poser.pugx.org/denissimon/prediction-builder/license.svg)](https://github.com/denissimon/prediction-builder/blob/master/LICENSE)\n\nPredictionBuilder is a library for machine learning that builds predictions using a linear regression.\n\nRequirements\n------------\n\nThis project requires [PHP 5.4 or higher](http://php.net) because makes use of trait and short array syntax.\n\nInstallation\n------------\n\nYou can install the library by [Composer](https://getcomposer.org). Add this to your project's composer.json:\n\n``` json\n\"require\": {\n    \"denissimon/prediction-builder\": \"*\"\n}\n```\n\nThen run `php composer.phar install` (or `composer install`).\n\nExample\n-------\n\n``` php\nuse PredictionBuilder\\PredictionBuilder;\n\nrequire_once __DIR__ . '/vendor/autoload.php';\n\n$data = [[1,20],[2,70],[2,45],[3,81],[5,73],[6,80],[7,110]];\n$x = 4.5;\n\n// What is the expected y value for a given x value?\ntry {\n    $prediction = new PredictionBuilder($x, $data);\n    $result = $prediction-\u003ebuild(); // y = 76.65\n} catch (\\Exception $e) {\n    echo $e-\u003egetMessage(), \"\\n\";\n}\n```\n\nThe returned object has the following properties:\n\n`$result-\u003eln_model` linear model that fits the data: \"29.56362+10.46364x\"\n\n`$result-\u003ecor` correlation coefficient: 0.8348\n\n`$result-\u003ex` given x value: 4.5\n\n`$result-\u003ey` predicted y value: 76.65\n\nLicense\n-------\n\nLicensed under the [MIT License](https://github.com/denissimon/prediction-builder/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenissimon%2Fprediction-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenissimon%2Fprediction-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenissimon%2Fprediction-builder/lists"}