obliquetree 1.0.3__cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.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.

Potentially problematic release.


This version of obliquetree might be problematic. Click here for more details.

@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: obliquetree
3
+ Version: 1.0.3
4
+ Summary: Traditional and Oblique Decision Tree
5
+ Author-email: Samet Copur <sametcopur@yahoo.com>
6
+ License: MIT License
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: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: numpy>=2.2.1
18
+ Requires-Dist: scipy>=1.15.0
19
+ Dynamic: license-file
20
+
21
+ # obliquetree
22
+
23
+ `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.
24
+
25
+
26
+ ![Tree Visualization](docs/source/_static/tree_visual.png)
27
+
28
+
29
+ ----
30
+
31
+ ## Getting Started
32
+
33
+ `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.
34
+
35
+ 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.
36
+
37
+ 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.
38
+
39
+ 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**.
40
+
41
+ -----
42
+ ## Installation
43
+ To install `obliquetree`, use the following pip command:
44
+ ```bash
45
+ pip install obliquetree
46
+ ```
47
+
48
+ Using the `obliquetree` library is simple and intuitive. Here's a more generic example that works for both classification and regression:
49
+
50
+
51
+ ```python
52
+ from obliquetree import Classifier, Regressor
53
+
54
+ # Initialize the model (Classifier or Regressor)
55
+ model = Classifier( # Replace "Classifier" with "Regressor" if performing regression
56
+ use_oblique=True, # Enable oblique splits
57
+ max_depth=2, # Set the maximum depth of the tree
58
+ n_pair=2, # Number of feature pairs for optimization
59
+ random_state=42, # Set a random state for reproducibility
60
+ categories=[0, 10, 32], # Specify which features are categorical
61
+ )
62
+
63
+ # Train the model on the training dataset
64
+ model.fit(X_train, y_train)
65
+
66
+ # Predict on the test dataset
67
+ y_pred = model.predict(X_test)
68
+ ```
69
+ -----
70
+
71
+ ## Documentation
72
+ 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/).
73
+
74
+ ---
75
+ ## Key Features
76
+
77
+ - **Oblique Splits**
78
+ 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.
79
+
80
+ - **Axis-Aligned Splits**
81
+ Offers conventional (axis-aligned) splits, enabling users to leverage standard decision tree behavior for simplicity and interpretability.
82
+
83
+ - **Feature Constraints**
84
+ Limit the number of features used in oblique splits with the `n_pair` parameter, promoting simpler, more interpretable tree structures while retaining predictive power.
85
+
86
+ - **Seamless Categorical Feature Handling**
87
+ Natively supports categorical columns with minimal preprocessing. Only label encoding is required, removing the need for extensive data transformation.
88
+
89
+ - **Robust Handling of Missing Values**
90
+ Automatically assigns `NaN` values to the optimal leaf for axis-aligned splits.
91
+
92
+ - **Customizable Tree Structures**
93
+ The flexible API empowers users to design their own tree architectures easily.
94
+
95
+ - **Exact Equivalence with `scikit-learn`**
96
+ Guarantees results identical to `scikit-learn`'s decision trees when oblique and categorical splitting are disabled.
97
+
98
+ - **Optimized Performance**
99
+ Outperforms `scikit-learn` in terms of speed and efficiency when oblique and categorical splitting are disabled:
100
+ - Up to **50% faster** for datasets with float columns.
101
+ - Up to **200% faster** for datasets with integer columns.
102
+
103
+ ![Performance Comparison (Float)](docs/source/_static/sklearn_perf/performance_comparison_float.png)
104
+
105
+ ![Performance Comparison (Integer)](docs/source/_static/sklearn_perf/performance_comparison_int.png)
106
+
107
+
108
+ ----
109
+ ### Contributing
110
+ 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.
111
+
112
+ -----
113
+ ### License
114
+ `obliquetree` is released under the MIT License. See the LICENSE file for more details.
@@ -0,0 +1,21 @@
1
+ obliquetree/__init__.py,sha256=VQapTBiRrm5l9oV8X2fu3xlvvGTh1cjQ6Hh3ynpArKU,103
2
+ obliquetree/_pywrap.py,sha256=d6XRinPMBxNUf2UlJQkV4TOe3_zbEcM4q8j8QPcXudg,26332
3
+ obliquetree/utils.py,sha256=mEs3ZspxOKUm1SoS-ms0XjQQ1Ci6Ej4oQA53WEYY7VY,30267
4
+ obliquetree/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ obliquetree/src/base.cpp,sha256=zDDiQC4letk-5Cd97w3-wZ45rLOsB0HLGM7mFgWHkXs,1416211
6
+ obliquetree/src/base.cpython-311-x86_64-linux-gnu.so,sha256=s1n1U9KNLbuS5Wzc4y85-CBPkDX6JI_rSZeQBBFD-8w,2333520
7
+ obliquetree/src/ccp.cpp,sha256=DuKlYs_HCYFLzMJnCNb3TmKgv2yZspBj7DzyyS-EiCA,948541
8
+ obliquetree/src/ccp.cpython-311-x86_64-linux-gnu.so,sha256=EZkUm65DovVXL4uagF_iIs7eaP0fBuevY1Z5GVBU1_o,1556984
9
+ obliquetree/src/metric.cpp,sha256=wkaoaKW0Z6A0OkK67BpRRBFI50s9vuXVX56A7uUBKZo,1182973
10
+ obliquetree/src/metric.cpython-311-x86_64-linux-gnu.so,sha256=AnYlgr5av5VM-PsEbe9-0xOl1epzo8cWgsirDoiq4Ng,1809472
11
+ obliquetree/src/oblique.cpp,sha256=TO164GjBrfoxYxlMsUpvtWvVqesA0chncEFCva3qCME,1363790
12
+ obliquetree/src/oblique.cpython-311-x86_64-linux-gnu.so,sha256=M45ZleT2GudjoQrw0JrLWRrQL8ln2FGZHnErhITcsM0,2723456
13
+ obliquetree/src/tree.cpp,sha256=IZEGxbVyl7e8cCnKjuCPVLM9KXTsNyT6yo9MUAwQGc4,1130937
14
+ obliquetree/src/tree.cpython-311-x86_64-linux-gnu.so,sha256=PKE_hod3s9J-KDS3G-hC9Gyn5KPMXgxQfzrRViW8vj0,1704888
15
+ obliquetree/src/utils.cpp,sha256=zw5WE-LxF-Ds2JU904mUq5FhD2HY5vc14RNxTG7GuV8,1235423
16
+ obliquetree/src/utils.cpython-311-x86_64-linux-gnu.so,sha256=ke4X_4MqibayAdU7vNkPWX0i1JJ2YimiTbMK_iNvjhQ,2299928
17
+ obliquetree-1.0.3.dist-info/METADATA,sha256=zo1UGljAQo1gfqG3q4-X1L4A4xIUf6UUAaiRQaDlfL4,5662
18
+ obliquetree-1.0.3.dist-info/WHEEL,sha256=N6PyfvHGx46Sh1ny6KlB0rtGwHkXZAwlLCEEPBiTPn8,152
19
+ obliquetree-1.0.3.dist-info/top_level.txt,sha256=m-5N4-iAS5MsFOdk8y1r2ya_i5rVQBgPayHBA-K26qg,12
20
+ obliquetree-1.0.3.dist-info/RECORD,,
21
+ obliquetree-1.0.3.dist-info/licenses/LICENSE,sha256=lLpW3hLh8QbaRAWXRaZ76c80HoVfUr6739D0S7ecslU,1069
@@ -0,0 +1,6 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp311-cp311-manylinux_2_24_x86_64
5
+ Tag: cp311-cp311-manylinux_2_28_x86_64
6
+
@@ -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