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

|
||||
[](https://github.com/Doctorado-ML/STree/actions/workflows/codeql-analysis.yml)
|
||||
[](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://badge.fury.io/py/STree)
|
||||

|
||||

|
||||
[](https://deepwiki.com/Doctorado-ML/STree)
|
||||
[](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.
|
||||
|
||||

|
||||
|
||||
## Installation
|
||||
|
||||
|
@@ -1,9 +1,10 @@
|
||||
Siterator
|
||||
=========
|
||||
|
||||
.. automodule:: Splitter
|
||||
.. automodule:: stree
|
||||
.. autoclass:: Siterator
|
||||
:members:
|
||||
:undoc-members:
|
||||
:private-members:
|
||||
:show-inheritance:
|
||||
:noindex:
|
@@ -1,9 +1,9 @@
|
||||
Snode
|
||||
=====
|
||||
|
||||
.. automodule:: Splitter
|
||||
.. autoclass:: Snode
|
||||
.. autoclass:: stree.Splitter.Snode
|
||||
:members:
|
||||
:undoc-members:
|
||||
:private-members:
|
||||
:show-inheritance:
|
||||
:noindex:
|
@@ -1,9 +1,10 @@
|
||||
Splitter
|
||||
========
|
||||
|
||||
.. automodule:: Splitter
|
||||
.. automodule:: stree.Splitter
|
||||
.. autoclass:: Splitter
|
||||
:members:
|
||||
:undoc-members:
|
||||
:private-members:
|
||||
:show-inheritance:
|
||||
:noindex:
|
@@ -7,3 +7,4 @@ Stree
|
||||
:undoc-members:
|
||||
:private-members:
|
||||
:show-inheritance:
|
||||
:noindex:
|
@@ -6,26 +6,21 @@
|
||||
|
||||
# -- 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
|
||||
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 = "STree"
|
||||
copyright = "2020 - 2022, Ricardo Montañana Gómez"
|
||||
copyright = "2020 - 2024, Ricardo Montañana Gómez"
|
||||
author = "Ricardo Montañana Gómez"
|
||||
|
||||
# The full version, including alpha/beta/rc tags
|
||||
version = __version__
|
||||
release = version
|
||||
|
||||
version = release = stree.__version__
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
|
@@ -5,7 +5,6 @@ Welcome to STree's documentation!
|
||||
:caption: Contents:
|
||||
:titlesonly:
|
||||
|
||||
|
||||
stree
|
||||
install
|
||||
hyperparameters
|
||||
|
@@ -1,2 +1,3 @@
|
||||
scikit-learn>0.24
|
||||
scikit-learn==1.5.2
|
||||
coverage
|
||||
mufs
|
@@ -746,7 +746,7 @@ class Splitter:
|
||||
Train time - True / Test time - False
|
||||
"""
|
||||
# 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)
|
||||
if data.shape[0] < self._min_samples_split:
|
||||
# there aren't enough samples to split
|
||||
|
@@ -168,16 +168,17 @@ class Stree(BaseEstimator, ClassifierMixin):
|
||||
self.splitter = splitter
|
||||
self.normalize = normalize
|
||||
self.multiclass_strategy = multiclass_strategy
|
||||
self.depth_ = 0
|
||||
|
||||
@staticmethod
|
||||
def version() -> str:
|
||||
"""Return the version of the package."""
|
||||
return __version__
|
||||
|
||||
def __call__(self) -> str:
|
||||
"""Only added to comply with scikit-learn base sestimator for ensembles
|
||||
"""
|
||||
return self.version()
|
||||
def __call__(self) -> None:
|
||||
"""Only added to comply with scikit-learn base sestimator for
|
||||
ensembles"""
|
||||
pass
|
||||
|
||||
def _more_tags(self) -> dict:
|
||||
"""Required by sklearn to supply features of the classifier
|
||||
|
@@ -728,7 +728,7 @@ class Stree_test(unittest.TestCase):
|
||||
def test_call(self) -> None:
|
||||
"""Check call method."""
|
||||
clf = Stree()
|
||||
self.assertEqual(__version__, clf())
|
||||
self.assertIsNone(clf())
|
||||
|
||||
def test_graph(self):
|
||||
"""Check graphviz representation of the tree."""
|
||||
|
Reference in New Issue
Block a user