class_docstr: Config for providing parameters to the Anomaly Detection library.
class_docstr_tok: ["Config","for","providing","parameters","to","the","Anomaly","Detection","library","."]
docstr: Converts a dictionary to the corresponding instance of the `ADConfig` class.
  Raises ValueError if the input is not a dictionary.
docstr_tok: ["Converts","a","dictionary","to","the","corresponding","instance","of","the","`","ADConfig","`","class",".","Raises","ValueError","if","the","input","is","not","a","dictionary","."]
code: def from_dict(obj: Any) -> "ADConfig":
      """Converts a dictionary to the corresponding instance of the `ADConfig` class.
      Raises ValueError if the input is not a dictionary.
      """
      if not isinstance(obj, dict):
          raise ValueError(f"The input ({obj}) is not a dictionary.")
      volatility_features_list = from_union(
          [from_list_list_str, from_none],
          obj.get("volatility_features_list"),
      )
      coverage_grid = from_union(
          [from_list_float, from_none], obj.get("coverage_grid")
      )
      ape_grid = from_union(
          [from_list_float, from_none], obj.get("ape_grid")
      )
      sape_grid = from_union(
          [from_list_float, from_none], obj.get("sape_grid")
      )
      min_admissible_value = from_union(
          [from_float, from_none], obj.get("min_admissible_value")
      )
      max_admissible_value = from_union(
          [from_float, from_none], obj.get("max_admissible_value")
      )
      objective = from_union(
          [from_str, from_none], obj.get("objective")
      )
      target_precision = from_union(
          [from_float, from_none], obj.get("target_precision")
      )
      target_recall = from_union(
          [from_float, from_none], obj.get("target_recall")
      )
      soft_window_size = from_union(
          [from_int, from_none], obj.get("soft_window_size")
      )
      target_anomaly_percent = from_union(
          [from_float, from_none], obj.get("target_anomaly_percent")
      )
      variance_scaling = from_union(
          [from_bool, from_none], obj.get("variance_scaling")
      )
  
      return ADConfig(
          volatility_features_list=volatility_features_list,
          coverage_grid=coverage_grid,
          ape_grid=ape_grid,
          sape_grid=sape_grid,
          min_admissible_value=min_admissible_value,
          max_admissible_value=max_admissible_value,
          objective=objective,
          target_precision=target_precision,
          target_recall=target_recall,
          soft_window_size=soft_window_size,
          target_anomaly_percent=target_anomaly_percent,
          variance_scaling=variance_scaling,
      )
  
file_path: greykite/greykite/detection/detector/config.py
imports: import json
  from dataclasses import dataclass
  from typing import Any
  from typing import List
  from typing import Optional
  from greykite.common.python_utils import assert_equal
  from greykite.framework.templates.autogen.forecast_config import from_bool
  from greykite.framework.templates.autogen.forecast_config import from_float
  from greykite.framework.templates.autogen.forecast_config import from_int
  from greykite.framework.templates.autogen.forecast_config import from_list_float
  from greykite.framework.templates.autogen.forecast_config import from_list_list_str
  from greykite.framework.templates.autogen.forecast_config import from_none
  from greykite.framework.templates.autogen.forecast_config import from_str
  from greykite.framework.templates.autogen.forecast_config import from_union
label_desc: Use image node_id 1 for calling the ADConfig obj's underlying member method code with example usage: obj.from_dict(obj) and returns: ADConfig