actions

The actions module. This module includes various actions to be applied by the implemented RL agents

class actions.ActionType(value)

Defines the type of an Action

class actions.ActionBase(column_name: str, action_type: ActionType)

Base class for actions

__init__(column_name: str, action_type: ActionType) None

Constructor

Parameters
  • column_name (The name of the column this is acting on) –

  • action_type (The type of the action) –

abstract act(**ops) Any

Perform the action

Parameters

ops (The data to distort) –

Return type

Typically the action returns the distorted subset of the data

class actions.ActionIdentity(column_name: str)

Implements the identity action. Use this action to signal that no distortion should be applied.

__init__(column_name: str) None

Constructor

Parameters

column_name (The name of the column this is acting on) –

act(**ops) Any

Perform the action

Parameters

ops (The data to distort) –

Return type

The distorted column

class actions.ActionNumericBinGeneralize(column_name: str, generalization_table: Hierarchy)

Generalization Action for numeric columns using bins

__init__(column_name: str, generalization_table: Hierarchy)

Constructor :param column_name: :type column_name: The name of the column this is acting on :param generalization_table: :type generalization_table: The bins to use

act(**ops) Any

Perform the action :param ops: :type ops: The data to distort

Return type

Typically the action returns the distorted subset of the data

class actions.ActionNumericStepGeneralize(column_name: str, step: float)
__init__(column_name: str, step: float)

Constructor

Parameters
  • column_name (The name of the column this is acting on) –

  • action_type (The type of the action) –

act(**ops)

Perform an action :return:

class actions.ActionRestore(column_name: str, restore_values: Hierarchy)

Implements the restore action

__init__(column_name: str, restore_values: Hierarchy)

Constructor

Parameters
  • column_name (The name of the column this is acting on) –

  • action_type (The type of the action) –

act(**ops) Any

Perform an action :return:

class actions.ActionStringGeneralize(column_name: str, generalization_table: Hierarchy)

Implements the generalization action. The generalization_table must implement the __getitem__ function

__init__(column_name: str, generalization_table: Hierarchy) None

Constructor

Parameters
  • column_name (The column name this action is acting on) –

  • generalization_table (The hierarchy for the generalization) –

act(**ops) Any

Performs the action

Parameters

ops (The data to distort) –

Return type

The distorted data

add(key: Any, value: Any) None

Add a new item in the underlying hierarchy

Parameters
  • key (The key to use for the new item) –

  • value (The value of the new item) –

Return type

None

class actions.ActionSuppress(column_name: str, suppress_table: Hierarchy)

Implements the suppress action

__init__(column_name: str, suppress_table: Hierarchy)

Constructor

Parameters
  • column_name (The name of the column this is acting on) –

  • action_type (The type of the action) –

act(**ops) None

Perform the action :return: None

class actions.ActionTransform(column_name: str, transform_value: Any)

Implements the transform action

__init__(column_name: str, transform_value: Any)

Constructor

Parameters
  • column_name (The name of the column this is acting on) –

  • action_type (The type of the action) –

act(**ops) Any

Perform an action :return: