{"id":13828586,"url":"https://github.com/phpjuice/slopeone","last_synced_at":"2025-09-07T06:07:17.690Z","repository":{"id":27079056,"uuid":"112244402","full_name":"phpjuice/slopeone","owner":"phpjuice","description":"PHP implementation of the Weighted Slope One rating-based collaborative filtering scheme.","archived":false,"fork":false,"pushed_at":"2022-03-16T20:15:26.000Z","size":46,"stargazers_count":85,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-20T03:54:02.517Z","etag":null,"topics":["algorithm","collaborative-filtering","recommender-system","slopeone"],"latest_commit_sha":null,"homepage":"https://phpjuice.github.io/slopeone/","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/phpjuice.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2017-11-27T20:22:22.000Z","updated_at":"2023-07-15T12:32:50.000Z","dependencies_parsed_at":"2022-08-07T12:15:21.983Z","dependency_job_id":null,"html_url":"https://github.com/phpjuice/slopeone","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/phpjuice/slopeone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpjuice%2Fslopeone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpjuice%2Fslopeone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpjuice%2Fslopeone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpjuice%2Fslopeone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpjuice","download_url":"https://codeload.github.com/phpjuice/slopeone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpjuice%2Fslopeone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274001615,"owners_count":25205293,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["algorithm","collaborative-filtering","recommender-system","slopeone"],"created_at":"2024-08-04T09:02:53.687Z","updated_at":"2025-09-07T06:07:17.660Z","avatar_url":"https://github.com/phpjuice.png","language":"PHP","readme":"# Slopeone\n\n![Tests](https://github.com/phpjuice/slopeone/workflows/Tests/badge.svg?branch=main)\n[![Maintainability](https://api.codeclimate.com/v1/badges/4b362481ae8a8cf39936/maintainability)](https://codeclimate.com/github/phpjuice/slopeone/maintainability)\n[![Latest Stable Version](http://poser.pugx.org/phpjuice/slopeone/v)](https://packagist.org/packages/phpjuice/slopeone)\n[![Total Downloads](http://poser.pugx.org/phpjuice/slopeone/downloads)](https://packagist.org/packages/phpjuice/slopeone)\n[![License](http://poser.pugx.org/phpjuice/slopeone/license)](https://packagist.org/packages/phpjuice/slopeone)\n\nPHP implementation of the Weighted Slope One rating-based collaborative filtering scheme.\n\n## Installation\n\nSlopeone Package requires PHP 7.4 or higher.\n\n\u003e **INFO:** If you are using an older version of php this package may not function correctly.\n\nThe supported way of installing `Slopeone` package is via Composer.\n\n```bash\ncomposer require phpjuice/slopeone\n```\n\n## Usage\n\nSlopeone Package is designed to be very simple and straightforward to use. All you have to do is to load rating data,\nthen predict future ratings based on the training set provided.\n\n### Loading files\n\nThe `Slopeone` object is created by direct instantiation:\n\n```php\nuse PHPJuice\\Slopeone\\Algorithm;\n\n// Create an instance\n$slopeone = new Algorithm();\n```\n\n### Adding Rating values\n\nAdding Rating values can be easily done by providing an array of users ratings via the update() method:\n\n```php\n\n$data =[\n  [\n    \"squid\" =\u003e 1,\n    \"cuttlefish\" =\u003e 0.5,\n    \"octopus\" =\u003e 0.2\n  ],\n  [\n    \"squid\" =\u003e 1,\n    \"octopus\" =\u003e 0.5,\n    \"nautilus\" =\u003e 0.2\n  ],\n  [\n    \"squid\" =\u003e 0.2,\n    \"octopus\" =\u003e 1,\n    \"cuttlefish\" =\u003e 0.4,\n    \"nautilus\" =\u003e 0.4\n  ],\n  [\n    \"cuttlefish\" =\u003e 0.9,\n    \"octopus\" =\u003e 0.4,\n    \"nautilus\" =\u003e 0.5\n  ]\n];\n\n$slopeone-\u003eupdate($data);\n```\n\n### Predicting ratings\n\nall you have to do to predict ratings for a new user is to run the slopeone::predict method\n\n```php\n$results = $slopeone-\u003epredict([\n    \"squid\" =\u003e 0.4\n]);\n```\n\nthis should produce the following results\n\n```php\n[\n  \"cuttlefish\"=\u003e0.25,\n  \"octopus\"=\u003e0.23333333333333,\n  \"nautilus\"=\u003e0.1\n];\n```\n\n## Running the tests\n\nyou can easily run tests using composer\n\n```bash\ncomposer test\n```\n\n## Built With\n\n- [PHP](http://www.php.net) - The programing language used\n- [Composer](https://getcomposer.org) - Dependency Management\n- [Pest](https://pestphp.com) - An elegant PHP Testing Framework\n\n## Changelog\n\nPlease see the [changelog](changelog.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING.md](./CONTRIBUTING.md) for details and a todo list.\n\n## Security\n\nIf you discover any security related issues, please email author instead of using the issue tracker.\n\n## Credits\n\n- [Daniel Lemire](https://github.com/lemire)\n- [SlopeOne Predictors for Online Rating-Based Collaborative Filtering](https://www.researchgate.net/publication/1960789_Slope_One_Predictors_for_Online_Rating-Based_Collaborative_Filtering)\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see\nthe [tags on this repository](https://github.com/PHPJuice/slopeone/tags).\n\n## License\n\nlicense. Please see the [Licence](https://github.com/phpjuice/slopeone/blob/main/LICENSE) for more information.\n\n![Tests](https://github.com/phpjuice/slopeone/workflows/Tests/badge.svg?branch=main)\n[![Maintainability](https://api.codeclimate.com/v1/badges/4b362481ae8a8cf39936/maintainability)](https://codeclimate.com/github/phpjuice/slopeone/maintainability)\n[![Latest Stable Version](http://poser.pugx.org/phpjuice/slopeone/v)](https://packagist.org/packages/phpjuice/slopeone)\n[![Total Downloads](http://poser.pugx.org/phpjuice/slopeone/downloads)](https://packagist.org/packages/phpjuice/slopeone)\n[![License](http://poser.pugx.org/phpjuice/slopeone/license)](https://packagist.org/packages/phpjuice/slopeone)\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpjuice%2Fslopeone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpjuice%2Fslopeone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpjuice%2Fslopeone/lists"}