{"id":19325421,"url":"https://github.com/krypt0nn/cati-tree","last_synced_at":"2026-06-22T09:32:09.065Z","repository":{"id":57009441,"uuid":"370124044","full_name":"krypt0nn/cati-tree","owner":"krypt0nn","description":"Category Identification Tree","archived":false,"fork":false,"pushed_at":"2021-06-01T12:54:56.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-17T09:50:59.341Z","etag":null,"topics":["machine-learning","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krypt0nn.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}},"created_at":"2021-05-23T18:08:20.000Z","updated_at":"2021-07-31T19:27:07.000Z","dependencies_parsed_at":"2022-08-21T13:10:13.670Z","dependency_job_id":null,"html_url":"https://github.com/krypt0nn/cati-tree","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/krypt0nn/cati-tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fcati-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fcati-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fcati-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fcati-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krypt0nn","download_url":"https://codeload.github.com/krypt0nn/cati-tree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fcati-tree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34643612,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"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":["machine-learning","php"],"created_at":"2024-11-10T02:10:00.583Z","updated_at":"2026-06-22T09:32:09.046Z","avatar_url":"https://github.com/krypt0nn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e🚀 CATI Tree\u003c/h1\u003e\n\n**CATI Tree** *(Category Identification Tree)* - library for realization datasets identification in PHP 7.4+\n\nThis data structure and the algorithm implemented in it were invented by me so they certainly will work like pieces of shit. More useful information (in Russian) you can read [here](https://twitter.com/krypt0nn/status/1394701165238046724?s=20)\n\n## Installation\n\n```\ncomposer require krypt0nn/cati-tree\n```\n\n## Example of work\n\n### Tree\n\n```php\n$tree = CATI\\Tree::train ([\n    'a' =\u003e [\n        [1, 2, 3],\n        [1, 2, 4],\n        [5, 6, 7],\n        [6, 7, 8],\n        [2, 3, 6]\n    ],\n\n    'b' =\u003e [\n        [2, 3, 1]\n    ]\n]);\n\necho 'Training accuracy: '. $tree-\u003eacuracy();\n\nfile_put_contents ('tree.json', json_encode ($tree-\u003eexport ()));\n```\n\n```php\n$tree = CATI\\Tree::load (json_decode (file_get_contents ('tree.json'), true));\n\necho $tree-\u003epredict ([6, 7, 8]) ?: 'unknown'; // a\n```\n\n### Random forest\n\n```php\n$forest = CATI\\RandomForest::create ([\n    'a' =\u003e [\n        [1, 2, 3],\n        [1, 2, 4],\n        [5, 6, 7],\n        [6, 7, 8],\n        [2, 3, 6]\n    ],\n\n    'b' =\u003e [\n        [2, 3, 1]\n    ]\n], forestSize: 5);\n\necho 'Training accuracy: '. $forest-\u003eacuracy();\n\nfile_put_contents ('forest.json', json_encode ($forest-\u003eexport ()));\n```\n\n```php\n$forest = CATI\\RandomForest::load (json_decode (file_get_contents ('forest.json'), true));\n\nprint_r ($forest-\u003eprobability ([6, 7, 8]));\n```\n\nAuthor: [Nikita Podvirnyy](https://vk.com/technomindlp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrypt0nn%2Fcati-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrypt0nn%2Fcati-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrypt0nn%2Fcati-tree/lists"}