Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, n_clusters=8, max_iter=100, cat_dissim=matching_dissim,
init='Cao', n_init=1, verbose=0, random_state=None, n_jobs=1):
self.n_clusters = n_clusters
self.max_iter = max_iter
self.cat_dissim = cat_dissim
self.init = init
self.n_init = n_init
self.verbose = verbose
self.random_state = random_state
self.n_jobs = n_jobs
if ((isinstance(self.init, str) and self.init == 'Cao') or
hasattr(self.init, '__array__')) and self.n_init > 1:
if self.verbose:
print("Initialization method and algorithm are deterministic. "
"Setting n_init to 1.")
self.n_init = 1
def __init__(self, n_clusters=8, max_iter=100, num_dissim=euclidean_dissim,
cat_dissim=matching_dissim, init='Huang', n_init=10, gamma=None,
verbose=0, random_state=None, n_jobs=1):
super(KPrototypes, self).__init__(n_clusters, max_iter, cat_dissim, init,
verbose=verbose, random_state=random_state,
n_jobs=n_jobs)
self.num_dissim = num_dissim
self.gamma = gamma
self.n_init = n_init
if isinstance(self.init, list) and self.n_init > 1:
if self.verbose:
print("Initialization method is deterministic. "
"Setting n_init to 1.")
self.n_init = 1