mirror of
https://github.com/Doctorado-ML/STree.git
synced 2025-08-15 15:36:00 +00:00
Solve Warning class label not found when bagging
This commit is contained in:
@@ -440,7 +440,12 @@ class Stree(BaseEstimator, ClassifierMixin):
|
|||||||
|
|
||||||
check_classification_targets(y)
|
check_classification_targets(y)
|
||||||
X, y = check_X_y(X, y)
|
X, y = check_X_y(X, y)
|
||||||
sample_weight = _check_sample_weight(sample_weight, X)
|
sample_weight = _check_sample_weight(
|
||||||
|
sample_weight, X, dtype=np.float64
|
||||||
|
)
|
||||||
|
# solve WARNING: class label 0 specified in weight is not found
|
||||||
|
# in bagging
|
||||||
|
sample_weight += 1e-5
|
||||||
check_classification_targets(y)
|
check_classification_targets(y)
|
||||||
# Initialize computed parameters
|
# Initialize computed parameters
|
||||||
self.splitter_ = Splitter(
|
self.splitter_ = Splitter(
|
||||||
|
Reference in New Issue
Block a user