def fit(self, X, y=None, sample_weight=None):
if self.normalize:<EOL><INDENT>X = normalize(X)<EOL><DEDENT>random_state = check_random_state(self.random_state)<EOL>self.cluster_centers_, self.labels_, self.inertia_, self.n_iter_ = spherical_k_means(<EOL>X,<EOL>n_clusters=self.n_clusters,<EOL>sample_weight=sample_weight,<EOL>init=self.init,<EOL>n_init=self.n_init,<EOL>max_iter=self.max_iter,<EOL>verbose=self.verbose,<EOL>tol=self.tol,<EOL>random_state=random_state,<EOL>copy_x=self.copy_x,<EOL>n_jobs=self.n_jobs,<EOL>return_n_iter=True,<EOL>)<EOL>return self<EOL>
Compute k-means clustering.

        Parameters
        ----------

        X : array-like or sparse matrix, shape=(n_samples, n_features)

        y : Ignored
            not used, present here for API consistency by convention.

        sample_weight : array-like, shape (n_samples,), optional
            The weights for each observation in X. If None, all observations
            are assigned equal weight (default: None)