class_docstr: A data interface for private data with meta information.
class_docstr_tok: ["A","data","interface","for","private","data","with","meta","information","."]
docstr: Init method
  
  :param features: Dictionary or OrderedDict with feature names as keys and range in int/float
                   (for continuous features) or categories in string (for categorical features)
                   as values. For python version <=3.6, should provide only an OrderedDict.
  :param outcome_name: Outcome feature name.
  :param type_and_precision (optional): Dictionary with continuous feature names as keys.
                                        If the feature is of type int, just string 'int' should be provided,
                                        if the feature is of type float, a list of type and precision should be
                                        provided. For instance, type_and_precision: {cont_f1: 'int',
                                        cont_f2: ['float', 2]} for continuous features cont_f1 and cont_f2 of
                                        type int and float (and precision up to 2 decimal places) respectively.
                                        Default value is None and all features are treated as int.
  :param mad (optional): Dictionary with feature names as keys and corresponding Median Absolute Deviations (MAD)
                         as values.
                         Default MAD value is 1 for all features.
  :param data_name (optional): Dataset name
docstr_tok: ["Init","method",":","param","features",":","Dictionary","or","OrderedDict","with","feature","names","as","keys","and","range","in","int\/float","(","for","continuous","features",")","or","categories","in","string","(","for","categorical","features",")","as","values",".","For","python","version","<","=3.6",",","should","provide","only","an","OrderedDict",".",":","param","outcome_name",":","Outcome","feature","name",".",":","param","type_and_precision","(","optional",")",":","Dictionary","with","continuous","feature","names","as","keys",".","If","the","feature","is","of","type","int",",","just","string","'int","'","should","be","provided",",","if","the","feature","is","of","type","float",",","a","list","of","type","and","precision","should","be","provided",".","For","instance",",","type_and_precision",":","{","cont_f1",":","'int","'",",","cont_f2",":","[","'float","'",",","2","]","}","for","continuous","features","cont_f1","and","cont_f2","of","type","int","and","float","(","and","precision","up","to","2","decimal","places",")","respectively",".","Default","value","is","None","and","all","features","are","treated","as","int",".",":","param","mad","(","optional",")",":","Dictionary","with","feature","names","as","keys","and","corresponding","Median","Absolute","Deviations","(","MAD",")","as","values",".","Default","MAD","value","is","1","for","all","features",".",":","param","data_name","(","optional",")",":","Dataset","name"]
code: def __init__(self, params):
      """Init method
  
      :param features: Dictionary or OrderedDict with feature names as keys and range in int/float
                       (for continuous features) or categories in string (for categorical features)
                       as values. For python version <=3.6, should provide only an OrderedDict.
      :param outcome_name: Outcome feature name.
      :param type_and_precision (optional): Dictionary with continuous feature names as keys.
                                            If the feature is of type int, just string 'int' should be provided,
                                            if the feature is of type float, a list of type and precision should be
                                            provided. For instance, type_and_precision: {cont_f1: 'int',
                                            cont_f2: ['float', 2]} for continuous features cont_f1 and cont_f2 of
                                            type int and float (and precision up to 2 decimal places) respectively.
                                            Default value is None and all features are treated as int.
      :param mad (optional): Dictionary with feature names as keys and corresponding Median Absolute Deviations (MAD)
                             as values.
                             Default MAD value is 1 for all features.
      :param data_name (optional): Dataset name
      """
      if sys.version_info > (3, 6, 0) and isinstance(
          params["features"], (dict, collections.OrderedDict)
      ):
          features_dict = params["features"]
      elif sys.version_info <= (3, 6, 0) and isinstance(
          params["features"], collections.OrderedDict
      ):
          features_dict = params["features"]
      else:
          raise ValueError(
              "should provide dictionary with feature names as keys and range"
              "(for continuous features) or categories (for categorical features) as values. "
              "For python version <3.6, should provide an OrderedDict"
          )
  
      self._validate_and_set_outcome_name(params=params)
      self._validate_and_set_type_and_precision(params=params)
  
      self.continuous_feature_names = []
      self.categorical_feature_names = []
      self.categorical_levels = {}
  
      for feature in features_dict:
          if isinstance(
              features_dict[feature][0], (int, float)
          ):  # continuous feature
              self.continuous_feature_names.append(feature)
          else:
              self.categorical_feature_names.append(feature)
              self.categorical_levels[feature] = features_dict[feature]
  
      self._validate_and_set_mad(params=params)
      self._validate_and_set_permitted_range(
          params=params, features_dict=features_dict
      )
      self.feature_names = list(features_dict.keys())
      self.number_of_features = len(self.feature_names)
  
      self.continuous_feature_indexes = [
          list(features_dict.keys()).index(name)
          for name in self.continuous_feature_names
          if name in features_dict
      ]
  
      self.categorical_feature_indexes = [
          list(features_dict.keys()).index(name)
          for name in self.categorical_feature_names
          if name in features_dict
      ]
  
      for feature_name in self.continuous_feature_names:
          if feature_name not in self.type_and_precision:
              self.type_and_precision[feature_name] = "int"
  
      self._validate_and_set_data_name(params=params)
  
imports: import collections
  import logging
  import sys
  from collections import defaultdict
  import numpy
  import pandas
  from sklearn.preprocessing import LabelEncoder
  from dice_ml.data_interfaces.base_data_interface import _BaseData
label_desc: Use image node_id 1 to create a new PrivateData object from inherited base classes: _BaseData with example: obj = PrivateData(params)