Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.7%) to scientific vocabulary
Keywords
Repository
Oblique Tree classifier based on SVM nodes
Basic Info
- Host: GitHub
- Owner: Doctorado-ML
- License: mit
- Language: Python
- Default Branch: master
- Homepage: https://stree.readthedocs.io
- Size: 10.6 MB
Statistics
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 1
- Releases: 11
Topics
Metadata Files
README.md
STree

Oblique Tree classifier based on SVM nodes. The nodes are built and splitted with sklearn SVC models. Stree is a sklearn estimator and can be integrated in pipelines, grid searches, etc.
Installation
bash
pip install Stree
Documentation
Can be found in stree.readthedocs.io
Examples
Jupyter notebooks
Hyperparameters
| | Hyperparameter | Type/Values | Default | Meaning |
| --- | ------------------- | -------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| * | C | <float> | 1.0 | Regularization parameter. The strength of the regularization is inversely proportional to C. Must be strictly positive. |
| * | kernel | {"liblinear", "linear", "poly", "rbf", "sigmoid"} | linear | Specifies the kernel type to be used in the algorithm. It must be one of ‘liblinear’, ‘linear’, ‘poly’ or ‘rbf’. liblinear uses liblinear library and the rest uses libsvm library through scikit-learn library |
| * | maxiter | <int> | 1e5 | Hard limit on iterations within solver, or -1 for no limit. |
| * | randomstate | <int> | None | Controls the pseudo random number generation for shuffling the data for probability estimates. Ignored when probability is False.
Pass an int for reproducible output across multiple function calls |
| | maxdepth | <int> | None | Specifies the maximum depth of the tree |
| * | tol | <float> | 1e-4 | Tolerance for stopping criterion. |
| * | degree | <int> | 3 | Degree of the polynomial kernel function (‘poly’). Ignored by all other kernels. |
| * | gamma | {"scale", "auto"} or <float> | scale | Kernel coefficient for ‘rbf’, ‘poly’ and ‘sigmoid’.
if gamma='scale' (default) is passed then it uses 1 / (nfeatures * X.var()) as value of gamma,
if ‘auto’, uses 1 / nfeatures. |
| | splitcriteria | {"impurity", "maxsamples"} | impurity | Decides (just in case of a multi class classification) which column (class) use to split the dataset in a node**. maxsamples is incompatible with 'ovo' multiclassstrategy |
| | criterion | {“gini”, “entropy”} | entropy | The function to measure the quality of a split (only used if maxfeatures != numfeatures).
Supported criteria are “gini” for the Gini impurity and “entropy” for the information gain. |
| | minsamplessplit | <int> | 0 | The minimum number of samples required to split an internal node. 0 (default) for any |
| | maxfeatures | <int>, <float>
or {“auto”, “sqrt”, “log2”} | None | The number of features to consider when looking for the split:
If int, then consider maxfeatures features at each split.
If float, then maxfeatures is a fraction and int(maxfeatures * nfeatures) features are considered at each split.
If “auto”, then maxfeatures=sqrt(nfeatures).
If “sqrt”, then maxfeatures=sqrt(nfeatures).
If “log2”, then maxfeatures=log2(nfeatures).
If None, then maxfeatures=nfeatures. |
| | splitter | {"best", "random", "trandom", "mutual", "cfs", "fcbf", "iwss"} | "random" | The strategy used to choose the feature set at each node (only used if maxfeatures < numfeatures).
Supported strategies are: “best”: sklearn SelectKBest algorithm is used in every node to choose the maxfeatures best features. “random”: The algorithm generates 5 candidates and choose the best (max. info. gain) of them. “trandom”: The algorithm generates only one random combination. "mutual": Chooses the best features w.r.t. their mutual info with the label. "cfs": Apply Correlation-based Feature Selection. "fcbf": Apply Fast Correlation-Based Filter. "iwss": IWSS based algorithm |
| | normalize | <bool> | False | If standardization of features should be applied on each node with the samples that reach it |
| * | multiclassstrategy | {"ovo", "ovr"} | "ovo" | Strategy to use with multiclass datasets, "ovo": one versus one. "ovr": one versus rest |
* Hyperparameter used by the support vector classifier of every node
** Splitting in a STree node
The decision function is applied to the dataset and distances from samples to hyperplanes are computed in a matrix. This matrix has as many columns as classes the samples belongs to (if more than two, i.e. multiclass classification) or 1 column if it's a binary class dataset. In binary classification only one hyperplane is computed and therefore only one column is needed to store the distances of the samples to it. If three or more classes are present in the dataset we need as many hyperplanes as classes are there, and therefore one column per hyperplane is needed.
In case of multiclass classification we have to decide which column take into account to make the split, that depends on hyperparameter splitcriteria_, if "impurity" is chosen then STree computes information gain of every split candidate using each column and chooses the one that maximize the information gain, otherwise STree choses the column with more samples with a predicted class (the column with more positive numbers in it).
Once we have the column to take into account for the split, the algorithm splits samples with positive distances to hyperplane from the rest.
Tests
bash
python -m unittest -v stree.tests
License
STree is MIT licensed
Reference
R. Montañana, J. A. Gámez, J. M. Puerta, "STree: a single multi-class oblique decision tree based on support vector machines.", 2021 LNAI 12882, pg. 54-64
Owner
- Name: Doctorado-ML
- Login: Doctorado-ML
- Kind: organization
- Location: Spain
- Repositories: 5
- Profile: https://github.com/Doctorado-ML
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Montañana"
given-names: "Ricardo"
orcid: "https://orcid.org/0000-0003-3242-5452"
- family-names: "Gámez"
given-names: "José A."
orcid: "https://orcid.org/0000-0003-1188-1117"
- family-names: "Puerta"
given-names: "José M."
orcid: "https://orcid.org/0000-0002-9164-5191"
title: "STree"
version: 1.2.3
doi: 10.5281/zenodo.5504083
date-released: 2021-11-02
url: "https://github.com/Doctorado-ML/STree"
preferred-citation:
type: article
authors:
- family-names: "Montañana"
given-names: "Ricardo"
orcid: "https://orcid.org/0000-0003-3242-5452"
- family-names: "Gámez"
given-names: "José A."
orcid: "https://orcid.org/0000-0003-1188-1117"
- family-names: "Puerta"
given-names: "José M."
orcid: "https://orcid.org/0000-0002-9164-5191"
doi: "10.1007/978-3-030-85713-4_6"
journal: "Lecture Notes in Computer Science"
month: 9
start: 54
end: 64
title: "STree: A Single Multi-class Oblique Decision Tree Based on Support Vector Machines"
volume: 12882
year: 2021
GitHub Events
Total
- Issues event: 1
- Watch event: 1
- Push event: 2
Last Year
- Issues event: 1
- Watch event: 1
- Push event: 2
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Ricardo Montañana | r****a@g****m | 97 |
| Ricardo Montañana Gómez | r****a | 34 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 31
- Total pull requests: 28
- Average time to close issues: 4 months
- Average time to close pull requests: 8 days
- Total issue authors: 4
- Total pull request authors: 1
- Average comments per issue: 0.74
- Average comments per pull request: 0.89
- Merged pull requests: 27
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 16 minutes
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 2.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- rmontanana (28)
- noycohen100 (1)
- Semiu (1)
- laoruan100 (1)
Pull Request Authors
- rmontanana (29)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 279 last-month
- Total dependent packages: 1
- Total dependent repositories: 1
- Total versions: 10
- Total maintainers: 1
pypi.org: stree
Oblique decision tree with svm nodes.
- Documentation: https://stree.readthedocs.io/en/latest/index.html
- License: MIT License Copyright (c) 2020-2021, Ricardo Montañana Gómez Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 1.4.0
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- mufs *
- myst-parser *
- sphinx *
- sphinx-rtd-theme *
- mufs *
- scikit-learn >0.24
- scikit-learn *
- actions/checkout v2 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- codacy/codacy-coverage-reporter-action master composite
- codecov/codecov-action v3 composite