Skip to content

Commit

Permalink
fix new black requirements (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimotheeMathieu authored May 29, 2021
1 parent 4e453eb commit c1dfd25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sklearn_extra/cluster/_k_medoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def _check_nonnegative_int(self, value, desc, strict=True):
)

def _check_init_args(self):
"""Validates the input arguments. """
"""Validates the input arguments."""

# Check n_clusters and max_iter
self._check_nonnegative_int(self.n_clusters, "n_clusters")
Expand Down Expand Up @@ -298,7 +298,7 @@ def _update_medoid_idxs_in_place(self, D, labels, medoid_idxs):
medoid_idxs[k] = cluster_k_idxs[min_cost_idx]

def _compute_cost(self, D, medoid_idxs):
""" Compute the cose for a given configuration of the medoids"""
"""Compute the cose for a given configuration of the medoids"""
return self._compute_inertia(D[:, medoid_idxs])

def transform(self, X):
Expand Down
4 changes: 2 additions & 2 deletions sklearn_extra/kernel_approximation/_fastfood.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _uniform_vector(self, rng):
return None

def _apply_approximate_gaussian_matrix(self, B, G, P, X):
""" Create mapping of all x_i by applying B, G and P step-wise """
"""Create mapping of all x_i by applying B, G and P step-wise"""
num_examples = X.shape[0]

result = np.multiply(B, X.reshape((1, num_examples, 1, self._d)))
Expand All @@ -134,7 +134,7 @@ def _apply_approximate_gaussian_matrix(self, B, G, P, X):
return result

def _scale_transformed_data(self, S, VX):
""" Scale mapped data VX to match kernel(e.g. RBF-Kernel) """
"""Scale mapped data VX to match kernel(e.g. RBF-Kernel)"""
VX = VX.reshape(-1, self._times_to_stack_v * self._d)

return (
Expand Down
2 changes: 1 addition & 1 deletion sklearn_extra/robust/robust_weighted_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def fit(self, X, y=None):
return self

def _get_loss_function(self, loss):
"""Get concrete ''LossFunction'' object for str ''loss''. """
"""Get concrete ''LossFunction'' object for str ''loss''."""
if type(loss) == str:
eff_loss = LOSS_FUNCTIONS.get(loss)
if eff_loss is None:
Expand Down

0 comments on commit c1dfd25

Please sign in to comment.