Skip to content

Commit

Permalink
Fix linting issues with Codacy.
Browse files Browse the repository at this point in the history
  • Loading branch information
daffidwilde committed Apr 5, 2019
1 parent 63e351b commit 033d087
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
22 changes: 12 additions & 10 deletions kmodes/kmodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,16 +390,18 @@ def fit(self, X, y=None, **kwargs):
"""

random_state = check_random_state(self.random_state)
self._enc_cluster_centroids, self._enc_map, self.labels_,\
self.cost_, self.n_iter_, self.epoch_costs_ = k_modes(X,
self.n_clusters,
self.max_iter,
self.cat_dissim,
self.init,
self.n_init,
self.verbose,
random_state,
self.n_jobs)
self._enc_cluster_centroids, self._enc_map, self.labels_, self.cost_, \
self.n_iter_, self.epoch_costs_ = k_modes(
X,
self.n_clusters,
self.max_iter,
self.cat_dissim,
self.init,
self.n_init,
self.verbose,
random_state,
self.n_jobs,
)
return self

def fit_predict(self, X, y=None, **kwargs):
Expand Down
30 changes: 16 additions & 14 deletions kmodes/kprototypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,20 +451,22 @@ def fit(self, X, y=None, categorical=None):
random_state = check_random_state(self.random_state)
# If self.gamma is None, gamma will be automatically determined from
# the data. The function below returns its value.
self._enc_cluster_centroids, self._enc_map, \
self.labels_, self.cost_, self.n_iter_, \
self.epoch_costs_, self.gamma = k_prototypes(X,
categorical,
self.n_clusters,
self.max_iter,
self.num_dissim,
self.cat_dissim,
self.gamma,
self.init,
self.n_init,
self.verbose,
random_state,
self.n_jobs)
self._enc_cluster_centroids, self._enc_map, self.labels_, self.cost_, \
self.n_iter_, self.epoch_costs_, self.gamma = k_prototypes(
X,
categorical,
self.n_clusters,
self.max_iter,
self.num_dissim,
self.cat_dissim,
self.gamma,
self.init,
self.n_init,
self.verbose,
random_state,
self.n_jobs
)

return self

def predict(self, X, categorical=None):
Expand Down

0 comments on commit 033d087

Please sign in to comment.