class_docstr: A data interface for private data with meta information.
class_docstr_tok: ["A","data","interface","for","private","data","with","meta","information","."]
docstr: Computes Median Absolute Deviation of features. If they are <=0, returns a practical value instead
docstr_tok: ["Computes","Median","Absolute","Deviation","of","features",".","If","they","are","<","=0",",","returns","a","practical","value","instead"]
code: def get_valid_mads(
      self, normalized=False, display_warnings=False, return_mads=True
  ):
      """Computes Median Absolute Deviation of features. If they are <=0, returns a practical value instead"""
      mads = self.get_mads(normalized=normalized)
      for feature in self.continuous_feature_names:
          if feature in mads:
              if mads[feature] <= 0:
                  mads[feature] = 1.0
                  if display_warnings:
                      logging.warning(
                          " MAD for feature %s is 0, so replacing it with 1.0 to avoid error.",
                          feature,
                      )
          else:
              mads[feature] = 1.0
              if display_warnings:
                  logging.info(
                      " MAD is not given for feature %s, so using 1.0 as MAD instead.",
                      feature,
                  )
  
      if return_mads:
          return mads
  
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 9 for calling the PrivateData obj's underlying member method code with example usage: obj.get_valid_mads(normalized, display_warnings, return_mads) and returns: mads