obliquetree 1.0.5__cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,113 @@
1
+ Metadata-Version: 2.4
2
+ Name: obliquetree
3
+ Version: 1.0.5
4
+ Summary: Traditional and Oblique Decision Tree
5
+ Author-email: Samet Copur <sametcopur@yahoo.com>
6
+ License-Expression: MIT
7
+ Project-URL: Documentation, https://obliquetree.readthedocs.io/en/latest/
8
+ Project-URL: Repository, https://github.com/sametcopur/obliquetree
9
+ Project-URL: Tracker, https://github.com/sametcopur/obliquetree/issues
10
+ Keywords: python,data-science,machine-learning,machine-learning-library,explainable-ai,decision-tree,oblique-tree
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: numpy>=2.2.1
17
+ Requires-Dist: scipy>=1.15.0
18
+ Dynamic: license-file
19
+
20
+ # obliquetree
21
+
22
+ `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.
23
+
24
+
25
+ ![Tree Visualization](docs/source/_static/tree_visual.png)
26
+
27
+
28
+ ----
29
+
30
+ ## Getting Started
31
+
32
+ `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.
33
+
34
+ In **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.
35
+
36
+ When 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.
37
+
38
+ In 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**.
39
+
40
+ -----
41
+ ## Installation
42
+ To install `obliquetree`, use the following pip command:
43
+ ```bash
44
+ pip install obliquetree
45
+ ```
46
+
47
+ Using the `obliquetree` library is simple and intuitive. Here's a more generic example that works for both classification and regression:
48
+
49
+
50
+ ```python
51
+ from obliquetree import Classifier, Regressor
52
+
53
+ # Initialize the model (Classifier or Regressor)
54
+ model = Classifier( # Replace "Classifier" with "Regressor" if performing regression
55
+ use_oblique=True, # Enable oblique splits
56
+ max_depth=2, # Set the maximum depth of the tree
57
+ n_pair=2, # Number of feature pairs for optimization
58
+ random_state=42, # Set a random state for reproducibility
59
+ categories=[0, 10, 32], # Specify which features are categorical
60
+ )
61
+
62
+ # Train the model on the training dataset
63
+ model.fit(X_train, y_train)
64
+
65
+ # Predict on the test dataset
66
+ y_pred = model.predict(X_test)
67
+ ```
68
+ -----
69
+
70
+ ## Documentation
71
+ For 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/).
72
+
73
+ ---
74
+ ## Key Features
75
+
76
+ - **Oblique Splits**
77
+ 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.
78
+
79
+ - **Axis-Aligned Splits**
80
+ Offers conventional (axis-aligned) splits, enabling users to leverage standard decision tree behavior for simplicity and interpretability.
81
+
82
+ - **Feature Constraints**
83
+ Limit the number of features used in oblique splits with the `n_pair` parameter, promoting simpler, more interpretable tree structures while retaining predictive power.
84
+
85
+ - **Seamless Categorical Feature Handling**
86
+ Natively supports categorical columns with minimal preprocessing. Only label encoding is required, removing the need for extensive data transformation.
87
+
88
+ - **Robust Handling of Missing Values**
89
+ Automatically assigns `NaN` values to the optimal leaf for axis-aligned splits.
90
+
91
+ - **Customizable Tree Structures**
92
+ The flexible API empowers users to design their own tree architectures easily.
93
+
94
+ - **Exact Equivalence with `scikit-learn`**
95
+ Guarantees results identical to `scikit-learn`'s decision trees when oblique and categorical splitting are disabled.
96
+
97
+ - **Optimized Performance**
98
+ Outperforms `scikit-learn` in terms of speed and efficiency when oblique and categorical splitting are disabled:
99
+ - Up to **50% faster** for datasets with float columns.
100
+ - Up to **200% faster** for datasets with integer columns.
101
+
102
+ ![Performance Comparison (Float)](docs/source/_static/sklearn_perf/performance_comparison_float.png)
103
+
104
+ ![Performance Comparison (Integer)](docs/source/_static/sklearn_perf/performance_comparison_int.png)
105
+
106
+
107
+ ----
108
+ ### Contributing
109
+ Contributions are welcome! If you'd like to improve `obliquetree` or suggest new features, feel free to fork the repository and submit a pull request.
110
+
111
+ -----
112
+ ### License
113
+ `obliquetree` is released under the MIT License. See the LICENSE file for more details.
@@ -0,0 +1,21 @@
1
+ obliquetree/__init__.py,sha256=-0R6INeDNsCbWWWS8pcJMgfonWcykI_0JcvKvlfOxBo,106
2
+ obliquetree/_pywrap.py,sha256=eUsDuXWkvmEWAVW_a7KRbNbBuKG_dCHjy2rqBRAnnrE,28022
3
+ obliquetree/utils.py,sha256=ewYp_3HZRvgBMysMlnelZdDuMCv49wsPAuYD_6du4GY,31149
4
+ obliquetree/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ obliquetree/src/base.cp310-win_amd64.pyd,sha256=9xTBtNkFBsbonmZdeQ-C9wrxFEcm1lWZ6wKZLItYPLA,168960
6
+ obliquetree/src/base.cpp,sha256=Qm2uoVtY_XXlu0rFzlEgmjXbAwq_81QVUdgYCKnVMHs,1466782
7
+ obliquetree/src/ccp.cp310-win_amd64.pyd,sha256=sY0zeJPAdJqoL-uucqCR8Z-9PAEOnw-BaPtQ4GOn2IQ,101376
8
+ obliquetree/src/ccp.cpp,sha256=oxEFvDbNoQJBKquilFy6lWU1612Q9zLOsXrfFwST4IU,972943
9
+ obliquetree/src/metric.cp310-win_amd64.pyd,sha256=73I0PBDmDOG8kpbEqzvBWU9t4lt7N8ZXYBMDKGCnJ_8,121344
10
+ obliquetree/src/metric.cpp,sha256=1q8iVfciap4mdOjZJbsReD8TfEracDl_ndDY-_IEzQY,1216075
11
+ obliquetree/src/oblique.cp310-win_amd64.pyd,sha256=jSmx-_NHJjBvFk14FFrKFbZtmqnsz5BpshK5H8inr_Q,196608
12
+ obliquetree/src/oblique.cpp,sha256=ffKhhm5vQwFy7vWF1lDAvfZWpoMZeV5dOZOg0dGVuBU,1409335
13
+ obliquetree/src/tree.cp310-win_amd64.pyd,sha256=9htc88qYn_21zxhPaGn0rSJliY_MSMrL9YxPzxAHmik,113152
14
+ obliquetree/src/tree.cpp,sha256=Jofyp872pxXcwytHNhv3oi_JpvIxvi6SL9B586VbDoI,1167664
15
+ obliquetree/src/utils.cp310-win_amd64.pyd,sha256=cMHym4tmAu8zQ-pjrbC8vHKBYWg81OEuGTqVXWzA-og,147968
16
+ obliquetree/src/utils.cpp,sha256=9UoaFPO85gFKQ39xxy4glE_Yk5ciYH0N92EPGDtJ1S0,1263005
17
+ obliquetree-1.0.5.dist-info/licenses/LICENSE,sha256=WfEPDyxevjVRSepuK7Lvl2VDl5pqtwjvMoNu2iWhcD8,1090
18
+ obliquetree-1.0.5.dist-info/METADATA,sha256=Gw4fErzCt4_XAYmygxlUP9Q0Mh14MECNoxWN26G6bHw,5727
19
+ obliquetree-1.0.5.dist-info/WHEEL,sha256=KUuBC6lxAbHCKilKua8R9W_TM71_-9Sg5uEP3uDWcoU,101
20
+ obliquetree-1.0.5.dist-info/top_level.txt,sha256=m-5N4-iAS5MsFOdk8y1r2ya_i5rVQBgPayHBA-K26qg,12
21
+ obliquetree-1.0.5.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-cp310-win_amd64
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Samet Çopur
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ obliquetree