Skip to content

Commit 87d4797

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6f801ac commit 87d4797

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

machine_learning/adaboost.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ def predict(self, feature_matrix: np.ndarray) -> np.ndarray:
7373
return np.where(clf_preds >= 0, 1, 0)
7474

7575
def _build_stump(
76-
self, feature_matrix: np.ndarray, target_signed: np.ndarray, sample_weights: np.ndarray
76+
self,
77+
feature_matrix: np.ndarray,
78+
target_signed: np.ndarray,
79+
sample_weights: np.ndarray,
7780
) -> Dict[str, Any]:
7881
"""Find the best decision stump for current weights."""
7982
n_samples, n_features = feature_matrix.shape
@@ -83,7 +86,9 @@ def _build_stump(
8386
thresholds = np.unique(feature_matrix[:, feature])
8487
for threshold in thresholds:
8588
for polarity in [1, -1]:
86-
pred = self._stump_predict(feature_matrix, feature, threshold, polarity)
89+
pred = self._stump_predict(
90+
feature_matrix, feature, threshold, polarity
91+
)
8792
error = np.sum(sample_weights * (pred != target_signed))
8893
if error < min_error:
8994
min_error = error

0 commit comments

Comments
 (0)