class_docstr: Base class for prediction drift checks.
class_docstr_tok: ["Base","class","for","prediction","drift","checks","."]
docstr: Add condition - require drift score to be less than the threshold.
  
  The industry standard for PSI limit is above 0.2.
  There are no common industry standards for other drift methods, such as Cramer's V,
  Kolmogorov-Smirnov and Earth Mover's Distance.
  
  Parameters
  ----------
  max_allowed_drift_score: float , default: 0.15
      the max threshold for the categorical variable drift score
  Returns
  -------
  ConditionResult
      False if any column has passed the max threshold, True otherwise
docstr_tok: ["Add","condition","-","require","drift","score","to","be","less","than","the","threshold",".","The","industry","standard","for","PSI","limit","is","above","0.2",".","There","are","no","common","industry","standards","for","other","drift","methods",",","such","as","Cramer","'s","V",",","Kolmogorov-Smirnov","and","Earth","Mover","'s","Distance",".","Parameters","--","--","--","--","--","max_allowed_drift_score",":","float",",","default",":","0.15","the","max","threshold","for","the","categorical","variable","drift","score","Returns","--","--","--","-","ConditionResult","False","if","any","column","has","passed","the","max","threshold",",","True","otherwise"]
code: def add_condition_drift_score_less_than(
      self, max_allowed_drift_score: float = 0.15
  ):
      """
      Add condition - require drift score to be less than the threshold.
  
      The industry standard for PSI limit is above 0.2.
      There are no common industry standards for other drift methods, such as Cramer's V,
      Kolmogorov-Smirnov and Earth Mover's Distance.
  
      Parameters
      ----------
      max_allowed_drift_score: float , default: 0.15
          the max threshold for the categorical variable drift score
      Returns
      -------
      ConditionResult
          False if any column has passed the max threshold, True otherwise
      """
  
      def condition(result: t.Dict) -> ConditionResult:
          drift_score_dict = result["Drift score"]
          # Move to dict for easier looping
          if not isinstance(drift_score_dict, dict):
              drift_score_dict = {0: drift_score_dict}
          method = result["Method"]
          has_failed = {}
          drift_score = 0
          for class_name, drift_score in drift_score_dict.items():
              has_failed[class_name] = (
                  drift_score > max_allowed_drift_score
              )
  
          if len(has_failed) == 1:
              details = f"Found model prediction {method} drift score of {format_number(drift_score)}"
          else:
              details = (
                  f"Found {sum(has_failed.values())} classes with model predicted probability {method} drift"
                  f" score above threshold: {max_allowed_drift_score}."
              )
  
          category = (
              ConditionCategory.FAIL
              if any(has_failed.values())
              else ConditionCategory.PASS
          )
          return ConditionResult(category, details)
  
      return self.add_condition(
          f"Prediction drift score < {max_allowed_drift_score}",
          condition,
      )
  
file_path: deepchecks/deepchecks/utils/abstracts/prediction_drift.py
imports: import abc
  import typing
  import numpy
  import pandas
  from deepchecks import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.utils.distribution.drift import calc_drift_and_plot, get_drift_plot_sidenote
  from deepchecks.utils.strings import format_number
label_desc: Use image node_id 2 for calling the PredictionDriftAbstract obj's underlying member method code with example usage: obj.add_condition_drift_score_less_than(max_allowed_drift_score) and returns: self, ConditionResult