class_docstr: Abstract class for Low dimensional embedding. The class defines
  uniform API, which is used by the NNContrastive explainer internally.
  NNContrastive explainer uses BaseEmbedding to obtain low dimensional
  vector embedding of the data, which is used for Neighborhood query.
class_docstr_tok: ["Abstract","class","for","Low","dimensional","embedding",".","The","class","defines","uniform","API",",","which","is","used","by","the","NNContrastive","explainer","internally",".","NNContrastive","explainer","uses","BaseEmbedding","to","obtain","low","dimensional","vector","embedding","of","the","data",",","which","is","used","for","Neighborhood","query","."]
code: def __init__(
      self,
      data: pd.DataFrame,
      features: List[str] = None,
      categorical_features: List[str] = [],
      categorical_values: dict = {},
      max_train_records: int = 10000,
  ):
      if features is None:
          features = list(data.columns)
  
      if not all([f in data for f in features]) or len(features) < 1:
          raise ValueError(f"Error: invalid feature definitions!")
  
      if not all([f in features for f in categorical_features]):
          raise ValueError(
              f"Error: invalid categorical features not in data!"
          )
  
      cat_feats = dict()
      for feat in categorical_features:
          tags = np.array(
              categorical_values.get(feat, data[feat].unique())
          )
          if len(data[feat].unique()) > len(tags):
              tags = data[feat].unique()
          cat_feats[feat] = tags
  
      self._features = features
      self._data = data[features]
      self._categorical_features = cat_feats
      self._fitted = False
      self._max_train_records = max_train_records
  
imports: import numpy
  import pandas
  from abc import ABC, abstractmethod
  from typing import Union, List, Any
  from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder, QuantileTransformer, StandardScaler, MinMaxScaler
label_desc: Use image node_id 1 to create a new BaseEmbedding object from inherited base classes: ABC with example: obj = BaseEmbedding(data, features, categorical_features, categorical_values, max_train_records)