class_docstr: Defines the configuration for generating counterfactuals.
class_docstr_tok: ["Defines","the","configuration","for","generating","counterfactuals","."]
code: def __init__(
      self,
      method,
      continuous_features,
      total_CFs,
      desired_class=CounterfactualConstants.OPPOSITE,
      desired_range=None,
      permitted_range=None,
      features_to_vary=None,
      feature_importance=False,
      id=None,
  ):
      super(CounterfactualConfig, self).__init__()
      self.method = method
      self.continuous_features = continuous_features
      self.total_CFs = total_CFs
      if id is None:
          self.id = str(uuid.uuid4())
      else:
          self.id = id
      self.desired_range = desired_range
      self.desired_class = desired_class
      self.permitted_range = permitted_range
      self.features_to_vary = features_to_vary
      self.feature_importance = feature_importance
      self.is_computed = False
      self.counterfactual_obj = None
      self.has_computation_failed = False
      self.failure_reason = None
      self.explainer = None
  
imports: import json
  import uuid
  import warnings
  from pathlib import Path
  from typing import Any, List, Optional, Union
  import dice_ml
  import jsonschema
  import numpy
  import pandas
  from dice_ml import Dice
  from dice_ml.counterfactual_explanations import CounterfactualExplanations
  from dice_ml.explainer_interfaces.explainer_base import ExplainerBase
  from raiutils.exceptions import UserConfigValidationException
  from raiutils.models import ModelTask
  from responsibleai._config.base_config import BaseConfig
  from responsibleai._data_validations import validate_train_test_categories
  from responsibleai._interfaces import CounterfactualData
  from responsibleai._internal.constants import CounterfactualManagerKeys, FileFormats, ListProperties, ManagerNames
  from responsibleai._tools.shared.state_directory_management import DirectoryManager
  from responsibleai.exceptions import DuplicateManagerConfigException, SchemaErrorException
  from responsibleai.managers.base_manager import BaseManager
  from responsibleai.utils import _find_features_having_missing_values, _measure_time
label_desc: Use image node_id 1 to create a new CounterfactualConfig object from inherited base classes: BaseConfig with example: obj = CounterfactualConfig(method, continuous_features, total_CFs, desired_class, desired_range, permitted_range, features_to_vary, feature_importance, id)