mirror of
https://github.com/Doctorado-ML/STree.git
synced 2025-08-19 09:26:04 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
cb80e8606b
|
|||
c93d3fbcc7
|
|||
f4ca4bbd5b
|
|||
e676ddbfcc
|
|||
|
dc637018e8 | ||
517013be09
|
@@ -3,8 +3,12 @@ version: 2
|
|||||||
sphinx:
|
sphinx:
|
||||||
configuration: docs/source/conf.py
|
configuration: docs/source/conf.py
|
||||||
|
|
||||||
|
build:
|
||||||
|
os: ubuntu-22.04
|
||||||
|
tools:
|
||||||
|
python: "3.12"
|
||||||
|
|
||||||
python:
|
python:
|
||||||
version: 3.8
|
|
||||||
install:
|
install:
|
||||||
- requirements: requirements.txt
|
- requirements: requirements.txt
|
||||||
- requirements: docs/requirements.txt
|
- requirements: docs/requirements.txt
|
@@ -1,16 +1,18 @@
|
|||||||
|
# STree
|
||||||
|
|
||||||

|

|
||||||
[](https://github.com/Doctorado-ML/STree/actions/workflows/codeql-analysis.yml)
|
[](https://github.com/Doctorado-ML/STree/actions/workflows/codeql-analysis.yml)
|
||||||
[](https://codecov.io/gh/doctorado-ml/stree)
|
[](https://codecov.io/gh/doctorado-ml/stree)
|
||||||
[](https://www.codacy.com/gh/Doctorado-ML/STree?utm_source=github.com&utm_medium=referral&utm_content=Doctorado-ML/STree&utm_campaign=Badge_Grade)
|
[](https://www.codacy.com/gh/Doctorado-ML/STree?utm_source=github.com&utm_medium=referral&utm_content=Doctorado-ML/STree&utm_campaign=Badge_Grade)
|
||||||
[](https://badge.fury.io/py/STree)
|
[](https://badge.fury.io/py/STree)
|
||||||

|

|
||||||
|
[](https://deepwiki.com/Doctorado-ML/STree)
|
||||||
[](https://zenodo.org/badge/latestdoi/262658230)
|
[](https://zenodo.org/badge/latestdoi/262658230)
|
||||||
|
|
||||||
# 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.
|
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
|
## Installation
|
||||||
|
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
Siterator
|
Siterator
|
||||||
=========
|
=========
|
||||||
|
|
||||||
.. automodule:: Splitter
|
.. automodule:: stree
|
||||||
.. autoclass:: Siterator
|
.. autoclass:: Siterator
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:private-members:
|
:private-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
:noindex:
|
@@ -1,9 +1,9 @@
|
|||||||
Snode
|
Snode
|
||||||
=====
|
=====
|
||||||
|
|
||||||
.. automodule:: Splitter
|
.. autoclass:: stree.Splitter.Snode
|
||||||
.. autoclass:: Snode
|
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:private-members:
|
:private-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
:noindex:
|
@@ -1,9 +1,10 @@
|
|||||||
Splitter
|
Splitter
|
||||||
========
|
========
|
||||||
|
|
||||||
.. automodule:: Splitter
|
.. automodule:: stree.Splitter
|
||||||
.. autoclass:: Splitter
|
.. autoclass:: Splitter
|
||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:private-members:
|
:private-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
:noindex:
|
@@ -6,4 +6,5 @@ Stree
|
|||||||
:members:
|
:members:
|
||||||
:undoc-members:
|
:undoc-members:
|
||||||
:private-members:
|
:private-members:
|
||||||
:show-inheritance:
|
:show-inheritance:
|
||||||
|
:noindex:
|
@@ -6,26 +6,21 @@
|
|||||||
|
|
||||||
# -- Path setup --------------------------------------------------------------
|
# -- Path setup --------------------------------------------------------------
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
||||||
#
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
from stree._version import __version__
|
from pathlib import Path
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath("../../stree/"))
|
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
|
||||||
|
|
||||||
|
import stree
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
project = "STree"
|
project = "STree"
|
||||||
copyright = "2020 - 2022, Ricardo Montañana Gómez"
|
copyright = "2020 - 2024, Ricardo Montañana Gómez"
|
||||||
author = "Ricardo Montañana Gómez"
|
author = "Ricardo Montañana Gómez"
|
||||||
|
|
||||||
# The full version, including alpha/beta/rc tags
|
# The full version, including alpha/beta/rc tags
|
||||||
version = __version__
|
version = release = stree.__version__
|
||||||
release = version
|
|
||||||
|
|
||||||
|
|
||||||
# -- General configuration ---------------------------------------------------
|
# -- General configuration ---------------------------------------------------
|
||||||
|
|
||||||
|
@@ -5,7 +5,6 @@ Welcome to STree's documentation!
|
|||||||
:caption: Contents:
|
:caption: Contents:
|
||||||
:titlesonly:
|
:titlesonly:
|
||||||
|
|
||||||
|
|
||||||
stree
|
stree
|
||||||
install
|
install
|
||||||
hyperparameters
|
hyperparameters
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
scikit-learn>0.24
|
scikit-learn==1.5.2
|
||||||
mufs
|
coverage
|
||||||
|
mufs
|
||||||
|
@@ -746,7 +746,7 @@ class Splitter:
|
|||||||
Train time - True / Test time - False
|
Train time - True / Test time - False
|
||||||
"""
|
"""
|
||||||
# data contains the distances of every sample to every class hyperplane
|
# data contains the distances of every sample to every class hyperplane
|
||||||
# array of (m, nc) nc = # classes
|
# array of (m, nc) nc = k if ovr, nc = k*(k-1)/2 if ovo
|
||||||
data = self._distances(node, samples)
|
data = self._distances(node, samples)
|
||||||
if data.shape[0] < self._min_samples_split:
|
if data.shape[0] < self._min_samples_split:
|
||||||
# there aren't enough samples to split
|
# there aren't enough samples to split
|
||||||
|
@@ -168,16 +168,17 @@ class Stree(BaseEstimator, ClassifierMixin):
|
|||||||
self.splitter = splitter
|
self.splitter = splitter
|
||||||
self.normalize = normalize
|
self.normalize = normalize
|
||||||
self.multiclass_strategy = multiclass_strategy
|
self.multiclass_strategy = multiclass_strategy
|
||||||
|
self.depth_ = 0
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def version() -> str:
|
def version() -> str:
|
||||||
"""Return the version of the package."""
|
"""Return the version of the package."""
|
||||||
return __version__
|
return __version__
|
||||||
|
|
||||||
def __call__(self) -> str:
|
def __call__(self) -> None:
|
||||||
"""Only added to comply with scikit-learn base sestimator for ensembles
|
"""Only added to comply with scikit-learn base sestimator for
|
||||||
"""
|
ensembles"""
|
||||||
return self.version()
|
pass
|
||||||
|
|
||||||
def _more_tags(self) -> dict:
|
def _more_tags(self) -> dict:
|
||||||
"""Required by sklearn to supply features of the classifier
|
"""Required by sklearn to supply features of the classifier
|
||||||
|
@@ -728,7 +728,7 @@ class Stree_test(unittest.TestCase):
|
|||||||
def test_call(self) -> None:
|
def test_call(self) -> None:
|
||||||
"""Check call method."""
|
"""Check call method."""
|
||||||
clf = Stree()
|
clf = Stree()
|
||||||
self.assertEqual(__version__, clf())
|
self.assertIsNone(clf())
|
||||||
|
|
||||||
def test_graph(self):
|
def test_graph(self):
|
||||||
"""Check graphviz representation of the tree."""
|
"""Check graphviz representation of the tree."""
|
||||||
|
Reference in New Issue
Block a user