{"id":32639639,"url":"https://github.com/sametcopur/obliquetree","last_synced_at":"2025-10-31T02:14:13.701Z","repository":{"id":271634227,"uuid":"914073261","full_name":"sametcopur/obliquetree","owner":"sametcopur","description":"obliquetree is an advanced decision tree implementation featuring oblique and axis-aligned splits, optimized performance. ","archived":false,"fork":false,"pushed_at":"2025-07-29T07:48:03.000Z","size":3221,"stargazers_count":21,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T02:38:49.313Z","etag":null,"topics":["decision-tree","explainable-ai","machine-learning","oblique-decision-tree"],"latest_commit_sha":null,"homepage":"https://obliquetree.readthedocs.io/en/latest/","language":"Cython","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/sametcopur.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,"zenodo":null}},"created_at":"2025-01-08T22:33:43.000Z","updated_at":"2025-10-04T14:11:22.000Z","dependencies_parsed_at":"2025-07-29T09:24:44.452Z","dependency_job_id":"1f3e73b8-ec2b-41c7-8ba5-b3737a746e44","html_url":"https://github.com/sametcopur/obliquetree","commit_stats":null,"previous_names":["sametcopur/obliquetree"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sametcopur/obliquetree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sametcopur%2Fobliquetree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sametcopur%2Fobliquetree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sametcopur%2Fobliquetree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sametcopur%2Fobliquetree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sametcopur","download_url":"https://codeload.github.com/sametcopur/obliquetree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sametcopur%2Fobliquetree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281914606,"owners_count":26583094,"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-10-31T02:00:07.401Z","response_time":57,"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":["decision-tree","explainable-ai","machine-learning","oblique-decision-tree"],"created_at":"2025-10-31T02:14:01.382Z","updated_at":"2025-10-31T02:14:13.693Z","avatar_url":"https://github.com/sametcopur.png","language":"Cython","funding_links":[],"categories":[],"sub_categories":[],"readme":"# obliquetree\n\n`obliquetree` is an advanced decision tree implementation designed to provide high-performance and interpretable models. It supports both classification and regression tasks, enabling a wide range of applications. By offering traditional and oblique splits, it ensures flexibility and improved generalization with shallow trees. This makes it a powerful alternative to regular decision trees.\n\n\n![Tree Visualization](docs/source/_static/tree_visual.png)\n\n\n----\n\n## Getting Started\n\n`obliquetree` combines advanced capabilities with efficient performance. It supports **oblique splits**, leveraging **L-BFGS optimization** to determine the best linear weights for splits, ensuring both speed and accuracy.\n\nIn **traditional mode**, without oblique splits, `obliquetree` outperforms `scikit-learn` in terms of speed and adds support for **categorical variables**, providing a significant advantage over many traditional decision tree implementations.\n\nWhen the **oblique feature** is enabled, `obliquetree` dynamically selects the optimal split type between oblique and traditional splits. If no weights can be found to reduce impurity, it defaults to an **axis-aligned split**, ensuring robustness and adaptability in various scenarios.\n\nIn very large trees (e.g., depth 10 or more), the performance of `obliquetree` may converge closely with **traditional trees**. The true strength of `obliquetree` lies in their ability to perform exceptionally well at **shallower depths**, offering improved generalization with fewer splits. Moreover, thanks to linear projections, `obliquetree` significantly outperform traditional trees when working with datasets that exhibit **linear relationships**.\n\n-----\n## Installation\nTo install `obliquetree`, use the following pip command:\n```bash\npip install obliquetree\n```\n\nUsing the `obliquetree` library is simple and intuitive. Here's a more generic example that works for both classification and regression:\n\n\n```python\nfrom obliquetree import Classifier, Regressor\n\n# Initialize the model (Classifier or Regressor)\nmodel = Classifier(  # Replace \"Classifier\" with \"Regressor\" if performing regression\n    use_oblique=True,       # Enable oblique splits\n    max_depth=2,            # Set the maximum depth of the tree\n    n_pair=2,               # Number of feature pairs for optimization\n    random_state=42,        # Set a random state for reproducibility\n    categories=[0, 10, 32], # Specify which features are categorical\n)\n\n# Train the model on the training dataset\nmodel.fit(X_train, y_train)\n\n# Predict on the test dataset\ny_pred = model.predict(X_test)\n```\n-----\n\n## Documentation\nFor example usage, API details, comparisons with axis-aligned trees, and in-depth insights into the algorithmic foundation, we **strongly recommend** referring to the full [documentation](https://obliquetree.readthedocs.io/en/latest/).\n\n---\n## Key Features\n\n- **Oblique Splits**  \n  Perform oblique splits using linear combinations of features to capture complex patterns in data. Supports both linear and soft decision tree objectives for flexible and accurate modeling.\n\n- **Axis-Aligned Splits**  \n  Offers conventional (axis-aligned) splits, enabling users to leverage standard decision tree behavior for simplicity and interpretability.\n\n- **Feature Constraints**  \n  Limit the number of features used in oblique splits with the `n_pair` parameter, promoting simpler, more interpretable tree structures while retaining predictive power.\n\n- **Seamless Categorical Feature Handling**  \n  Natively supports categorical columns with minimal preprocessing. Only label encoding is required, removing the need for extensive data transformation.\n\n- **Robust Handling of Missing Values**  \n  Automatically assigns `NaN` values to the optimal leaf for axis-aligned splits.\n\n- **Customizable Tree Structures**  \n  The flexible API empowers users to design their own tree architectures easily.\n\n- **Exact Equivalence with `scikit-learn`**  \n  Guarantees results identical to `scikit-learn`'s decision trees when oblique and categorical splitting are disabled.\n\n- **Optimized Performance**  \n  Outperforms `scikit-learn` in terms of speed and efficiency when oblique and categorical splitting are disabled:\n  - Up to **50% faster** for datasets with float columns.\n  - Up to **200% faster** for datasets with integer columns.\n\n  ![Performance Comparison (Float)](docs/source/_static/sklearn_perf/performance_comparison_float.png)\n\n  ![Performance Comparison (Integer)](docs/source/_static/sklearn_perf/performance_comparison_int.png)\n\n\n----\n### Contributing\nContributions are welcome! If you'd like to improve `obliquetree` or suggest new features, feel free to fork the repository and submit a pull request.\n\n-----\n### License\n`obliquetree` is released under the MIT License. See the LICENSE file for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsametcopur%2Fobliquetree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsametcopur%2Fobliquetree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsametcopur%2Fobliquetree/lists"}