SLSDT
Stochastic Local Search Decision Tree
This repository is for my first scientific initiation project.
About
Oblique Decision Tree is a algorithm for induction a machine learning method called decision tree using oblique approach.
SLSDT is a method for induction oblique decision trees using stochastic local search method called Late Acceptance Hill-Climbing (LAHC).
This project also provides a utility to read csv files and convert to the format accepted by the SLSDT method.
How to use
- Install
pip3 install slsdt
- read_csv
from slsdt.reader_csv import read_csv
X, y = read_csv("some_file.csv", "class_column_name")
- slsdt
from slsdt.slsdt import SLSDT
clf = SLSDT()
clf.fit(X, y)
result = clf.predict(X)
print(result)
print(result == y)
Iris example oblique split
from sklearn import datasets
from slsdt.slsdt import SLSDT
iris = datasets.load_iris()
X = iris.data[:, :2] # we only take the sepal width and sepal length features.
y = iris.target
mark = y != 2
# we only take the 0 (Iris-setosa) and 1 (Iris-versicolor) class labels
X = X[mark]
y = y[mark]
clf = SLSDT()
clf.fit(X, y)
clf.print_tree()
result = clf.predict(X)
print(result)
print(result == y)
Plot iris oblique split
Plot with Matplotlib using the results obtained above.
How to contribute
- Leave the ⭐ if you liked the project
- Fork this project
- Cloner your fork:
git clone your-fork-url && cd slsdt - Create a branch with your features:
git checkout -b my-features - Commit your changes:
git commit -m 'feat: My new features' - Send the your branch:
git push origin my-features
License
This project is licensed under the EPL 2.0 License - see the LICENSE file for details.
Metadata
Release files for slsdt 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| slsdt-0.0.2.tar.gz | 67.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| slsdt-0.0.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 80.3 kB
Release files / slsdt-0.0.2.tar.gz
| Download URL | slsdt-0.0.2.tar.gz |
|---|---|
| Size | 67.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5be0faca86d287c111ea7e9ec72b92dae2939ef175367e2a4209cf092b39d92
|
|
BLAKE2b-256 checksum How to use checksums |
2b2f5497a7a63cb2afdd6763be0ec0f6c32f873e6c96bff82428a66d04c8379f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.8.0 tqdm/4.56.0 CPython/3.8.6
|
Release files / slsdt-0.0.2-py2.py3-none-any.whl
| Download URL | slsdt-0.0.2-py2.py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b996984e05590e6010a907ec9df6ef50ccec65bba145c52ccae2939e6bcaab98
|
|
BLAKE2b-256 checksum How to use checksums |
c81599eb99de1da8e181f7f79368bb6ab9c118f7f7d5370bfa00c28ba6662b2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.8.0 tqdm/4.56.0 CPython/3.8.6
|