code: def __init__(
      self,
      n_clusters,
      max_iter=300,
      init=c_ops.RANDOM_INIT,
      distance=c_ops.SQUARED_EUCLIDEAN_DISTANCE,
      metric=None,
      num_features=None,
      log_dir="/tmp/tflearn_logs/",
      global_step=None,
      session=None,
      graph=None,
      name=None,
  ):
      super(KMeansBase, self).__init__(
          metric=metric,
          log_dir=log_dir,
          global_step=global_step,
          session=session,
          graph=graph,
          name=name,
      )
  
      self._estimator_built = False
  
      # Params
      self.n_clusters = n_clusters
      self.max_iter = max_iter
      self.init = init
      self.distance = distance
      self.num_features = num_features
      self.use_mini_batch = False
  
imports: from __future__ import division, print_function, absolute_import
  from datetime import datetime
  import os
  import math
  import numpy
  import time
  import tensorflow.compat.v1
  from tensorflow.contrib.factorization.python.ops import clustering_ops
  from tensorflow.contrib.tensor_forest.python.ops import data_ops
  from tensorflow.python.ops import state_ops, array_ops, math_ops
  from ...utils import validate_dim, read_tensor_in_checkpoint, prepare_X
  from ...data_utils import get_num_features, get_num_sample
  from ...data_flow import generate_data_tensor
  from ...distances import euclidean, cosine
  from ..base import BaseEstimator
label_desc: Use image node_id 1 to create a new KMeansBase object from inherited base classes: BaseEstimator with example: obj = KMeansBase(n_clusters, max_iter, init, distance, metric, num_features, log_dir, global_step, session, graph, name)