class_docstr: A data interface for private data with meta information.
class_docstr_tok: ["A","data","interface","for","private","data","with","meta","information","."]
docstr: Normalizes continuous features to make them fall in the range [0,1].
docstr_tok: ["Normalizes","continuous","features","to","make","them","fall","in","the","range","[","0,1","]","."]
code: def normalize_data(self, df):
      """Normalizes continuous features to make them fall in the range [0,1]."""
      result = df.copy()
      if isinstance(df, pd.DataFrame) or isinstance(df, dict):
          for feature_name in self.continuous_feature_names:
              max_value = self.permitted_range[feature_name][1]
              min_value = self.permitted_range[feature_name][0]
              if min_value == max_value:
                  result[feature_name] = 0
              else:
                  result[feature_name] = (
                      df[feature_name] - min_value
                  ) / (max_value - min_value)
      else:
          result = result.astype("float")
          for feature_index in self.continuous_feature_indexes:
              feature_name = self.feature_names[feature_index]
              max_value = self.permitted_range[feature_name][1]
              min_value = self.permitted_range[feature_name][0]
              if len(df.shape) == 1:
                  if min_value == max_value:
                      value = 0
                  else:
                      value = (df[feature_index] - min_value) / (
                          max_value - min_value
                      )
                  result[feature_index] = value
              else:
                  if min_value == max_value:
                      result[:, feature_index] = np.zeros(
                          len(df[:, feature_index])
                      )
                  else:
                      result[:, feature_index] = (
                          df[:, feature_index] - min_value
                      ) / (max_value - min_value)
      return result
  
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 5 for calling the PrivateData obj's underlying member method code with example usage: obj.normalize_data(df) and returns: result