Change project builder to hatch

Update actions in Makefile
This commit is contained in:
2024-08-14 09:41:45 +02:00
parent b627bb7531
commit 85b56785c8
4 changed files with 45 additions and 43 deletions

View File

@@ -414,7 +414,8 @@ class Splitter:
)
return tuple(
sorted(
range(len(feature_list)), key=lambda sub: feature_list[sub]
range(len(feature_list)),
key=lambda sub: feature_list[sub],
)[-max_features:]
)
@@ -529,7 +530,10 @@ class Splitter:
return entropy
def information_gain(
self, labels: np.array, labels_up: np.array, labels_dn: np.array
self,
labels: np.array,
labels_up: np.array,
labels_dn: np.array,
) -> float:
"""Compute information gain of a split candidate

View File

@@ -175,7 +175,8 @@ class Stree(BaseEstimator, ClassifierMixin):
return __version__
def __call__(self) -> str:
"""Only added to comply with scikit-learn base estimator for ensemble"""
"""Only added to comply with scikit-learn base sestimator for ensembles
"""
return self.version()
def _more_tags(self) -> dict:
@@ -188,7 +189,10 @@ class Stree(BaseEstimator, ClassifierMixin):
return {"requires_y": True}
def fit(
self, X: np.ndarray, y: np.ndarray, sample_weight: np.array = None
self,
X: np.ndarray,
y: np.ndarray,
sample_weight: np.array = None,
) -> "Stree":
"""Build the tree based on the dataset of samples and its labels
@@ -343,7 +347,11 @@ class Stree(BaseEstimator, ClassifierMixin):
)
node.set_down(
self._train(
X_D, y_d, sw_d, depth + 1, title + f" - Down({depth+1})"
X_D,
y_d,
sw_d,
depth + 1,
title + f" - Down({depth+1})",
)
)
return node