class_docstr: Transforms numeric data into k-means cluster memberships.
  From the Feature Engineering Book by Alice Zheng
  https://github.com/alicezheng/feature-engineering-book/blob/master/kmeans_featurizer.py
  This transformer runs k-means on the input data and converts each data point
  into the id of the closest cluster. If a target variable is present, it is
  scaled and included as input to k-means in order to derive clusters that
  obey the classification boundary as well as group similar points together.
  Parameters
  ----------
  k: integer, optional, default 100
      The number of clusters to group data into.
  target_scale: float, [0, infty], optional, default 5.0
      The scaling factor for the target variable. Set this to zero to ignore
      the target. For classification problems, larger `target_scale` values
      will produce clusters that better respect the class boundary.
  random_state : integer or numpy.RandomState, optional
      This is passed to k-means as the generator used to initialize the
      kmeans centers. If an integer is given, it fixes the seed. Defaults to
      the global numpy random number generator.
  Attributes
  ----------
  cluster_centers_ : array, [k, n_features]
      Coordinates of cluster centers. n_features does count the target column.
class_docstr_tok: ["Transforms","numeric","data","into","k-means","cluster","memberships",".","From","the","Feature","Engineering","Book","by","Alice","Zheng","https",":","\/\/github.com\/alicezheng\/feature-engineering-book\/blob\/master\/kmeans_featurizer.py","This","transformer","runs","k-means","on","the","input","data","and","converts","each","data","point","into","the","id","of","the","closest","cluster",".","If","a","target","variable","is","present",",","it","is","scaled","and","included","as","input","to","k-means","in","order","to","derive","clusters","that","obey","the","classification","boundary","as","well","as","group","similar","points","together",".","Parameters","--","--","--","--","--","k",":","integer",",","optional",",","default","100","The","number","of","clusters","to","group","data","into",".","target_scale",":","float",",","[","0",",","infty","]",",","optional",",","default","5.0","The","scaling","factor","for","the","target","variable",".","Set","this","to","zero","to","ignore","the","target",".","For","classification","problems",",","larger","`","target_scale","`","values","will","produce","clusters","that","better","respect","the","class","boundary",".","random_state",":","integer","or","numpy.RandomState",",","optional","This","is","passed","to","k-means","as","the","generator","used","to","initialize","the","kmeans","centers",".","If","an","integer","is","given",",","it","fixes","the","seed",".","Defaults","to","the","global","numpy","random","number","generator",".","Attributes","--","--","--","--","--","cluster_centers_",":","array",",","[","k",",","n_features","]","Coordinates","of","cluster","centers",".","n_features","does","count","the","target","column","."]
docstr: Runs fit followed by transform.
          
docstr_tok: ["Runs","fit","followed","by","transform","."]
code: def fit_transform(self, X, y=None):
      """Runs fit followed by transform."""
      self.fit(X, y)
      return self.transform(X, y)
  
file_path: Auto_ViML/autoviml/Transform_KM_Features.py
imports: import numpy
  import pandas
  from sklearn.cluster import KMeans
  import sklearn
  import scipy
  from collections import defaultdict
  import operator
  import pdb
  import copy
  from sklearn.model_selection import train_test_split
label_desc: Use image node_id 4 for calling the KMeansFeaturizer obj's underlying member method code with example usage: obj.fit_transform(X, y) and returns: self