class_docstr: Defines the CounterfactualManager for generating counterfactuals
  from a model.
class_docstr_tok: ["Defines","the","CounterfactualManager","for","generating","counterfactuals","from","a","model","."]
code: def _create_diceml_explainer(self, method, continuous_features):
      dice_data = dice_ml.Data(
          dataframe=self._train,
          continuous_features=continuous_features,
          outcome_name=self._target_column,
      )
      model_type = (
          CounterfactualConstants.CLASSIFIER
          if self._task_type == ModelTask.CLASSIFICATION
          else CounterfactualConstants.REGRESSOR
      )
      dice_model = dice_ml.Model(
          model=self._model,
          backend=CounterfactualConstants.SKLEARN,
          model_type=model_type,
      )
  
      dice_explainer = Dice(dice_data, dice_model, method=method)
  
      return dice_explainer
  
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 2 for calling the CounterfactualManager obj's underlying member method code with example usage: obj._create_diceml_explainer(method, continuous_features) and returns: dice_explainer