dice_ml.utils package — DiCE 0.7 documentation

# dice_ml.utils package

## Subpackages

- dice_ml.utils.sample_architecture package
  - Submodules
  - dice_ml.utils.sample_architecture.vae_model module
  - Module contents

## Submodules

## dice_ml.utils.exception module

Exceptions for the package.

exception `dice_ml.utils.exception.` `SystemException`

  Bases: `Exception`

  An exception indicating that some system exception happened during execution.

  Parameters

    exception_message (str) – A message describing the error.

exception `dice_ml.utils.exception.` `UserConfigValidationException`

  Bases: `Exception`

  An exception indicating that some user configuration is not valid.

  Parameters

    exception_message (str) – A message describing the error.

## dice_ml.utils.helpers module

This module containts helper functions to load data and get meta deta.

class `dice_ml.utils.helpers.` `DataTransfomer`(func=None, kw_args=None)

  Bases: `object`

  A class to transform data based on user-defined function to get predicted outcomes. This class calls FunctionTransformer of scikit-learn internally (https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.FunctionTransformer.html).

  `feed_data_params`(data_interface)
  `initialize_transform_func`()
  `inverse_transform`(data)
  `transform`(data)

`dice_ml.utils.helpers.` `get_adult_data_info`()

`dice_ml.utils.helpers.` `get_adult_income_modelpath`(backend='TF1')

`dice_ml.utils.helpers.` `get_base_gen_cf_initialization`(data_interface, encoded_size, cont_minx, cont_maxx, margin, validity_reg, epochs, wm1, wm2, wm3, learning_rate)

`dice_ml.utils.helpers.` `get_custom_dataset_modelpath_pipeline`()

`dice_ml.utils.helpers.` `get_custom_dataset_modelpath_pipeline_binary`()

`dice_ml.utils.helpers.` `get_custom_dataset_modelpath_pipeline_multiclass`()

`dice_ml.utils.helpers.` `get_custom_dataset_modelpath_pipeline_regression`()

`dice_ml.utils.helpers.` `load_adult_income_dataset`(only_train=True)
  Loads adult income dataset from https://archive.ics.uci.edu/ml/datasets/Adult and prepares

    the data for data analysis based on https://rpubs.com/H_Zhu/235617

  Return adult_data

    returns preprocessed adult income dataset.

`dice_ml.utils.helpers.` `load_custom_testing_dataset`()

`dice_ml.utils.helpers.` `load_custom_testing_dataset_binary`()

`dice_ml.utils.helpers.` `load_custom_testing_dataset_multiclass`()

`dice_ml.utils.helpers.` `load_custom_testing_dataset_regression`()

`dice_ml.utils.helpers.` `load_min_max_equal_dataset`()

`dice_ml.utils.helpers.` `load_outcome_not_last_column_dataset`()

`dice_ml.utils.helpers.` `ohe_min_max_transformation`(data, data_interface)

  the data is one-hot-encoded and min-max normalized and fed to the ML model

## dice_ml.utils.serialize module

class `dice_ml.utils.serialize.` `DummyDataInterface`(outcome_name, data_df=None)

  Bases: `object`

  `to_json`()

## Module contents