class_docstr: Base class for KMeans and MiniBatchKMeans
class_docstr_tok: ["Base","class","for","KMeans","and","MiniBatchKMeans"]
code: def _check_params_vs_input(self, X, default_n_init=None):
      # n_clusters
      if X.shape[0] < self.n_clusters:
          raise ValueError(
              f"n_samples={X.shape[0]} should be >= n_clusters={self.n_clusters}."
          )
  
      # tol
      self._tol = _tolerance(X, self.tol)
  
      # n-init
      # TODO(1.4): Remove
      self._n_init = self.n_init
      if self._n_init == "warn":
          warnings.warn(
              (
                  "The default value of `n_init` will change from "
                  f"{default_n_init} to 'auto' in 1.4. Set the value of `n_init`"
                  " explicitly to suppress the warning"
              ),
              FutureWarning,
              stacklevel=2,
          )
          self._n_init = default_n_init
      if self._n_init == "auto":
          if isinstance(self.init, str) and self.init == "k-means++":
              self._n_init = 1
          elif isinstance(self.init, str) and self.init == "random":
              self._n_init = default_n_init
          elif callable(self.init):
              self._n_init = default_n_init
          else:  # array-like
              self._n_init = 1
  
      if _is_arraylike_not_scalar(self.init) and self._n_init != 1:
          warnings.warn(
              (
                  "Explicit initial center position passed: performing only"
                  f" one init in {self.__class__.__name__} instead of "
                  f"n_init={self._n_init}."
              ),
              RuntimeWarning,
              stacklevel=2,
          )
          self._n_init = 1
  
imports: import warnings
  from abc import ABC, abstractmethod
  from numbers import Integral, Real
  import numpy
  import scipy.sparse
  from ..base import BaseEstimator, ClassNamePrefixFeaturesOutMixin, ClusterMixin, TransformerMixin, _fit_context
  from ..exceptions import ConvergenceWarning
  from ..metrics.pairwise import _euclidean_distances, euclidean_distances
  from ..utils import check_array, check_random_state
  from ..utils._openmp_helpers import _openmp_effective_n_threads
  from ..utils._param_validation import Hidden, Interval, StrOptions, validate_params
  from ..utils.extmath import row_norms, stable_cumsum
  from ..utils.fixes import threadpool_info, threadpool_limits
  from ..utils.sparsefuncs import mean_variance_axis
  from ..utils.sparsefuncs_fast import assign_rows_csr
  from ..utils.validation import _check_sample_weight, _is_arraylike_not_scalar, check_is_fitted
  from ._k_means_common import CHUNK_SIZE, _inertia_dense, _inertia_sparse, _is_same_clustering
  from ._k_means_elkan import elkan_iter_chunked_dense, elkan_iter_chunked_sparse, init_bounds_dense, init_bounds_sparse
  from ._k_means_lloyd import lloyd_iter_chunked_dense, lloyd_iter_chunked_sparse
  from ._k_means_minibatch import _minibatch_update_dense, _minibatch_update_sparse
label_desc: Use image node_id 2 for calling the _BaseKMeans obj's underlying member method code with example usage: obj._check_params_vs_input(X, default_n_init) without return types