ostatslib.actions.base#

Actions base classes module

Classes

Action()

Action base abstract class

ActionInfo(action_name[, model, ...])

Information class populated by action or environment during a step.

ClusteringEstimatorAction()

Extends ModelEstimatorAction to fit a cluster model

ExploratoryAction()

Extends action base class for exploratory actions

ModelEstimatorAction()

Extends base action class for model estimators

TargetExploratoryAction()

Extends ExploraotryAction base class for exploratory actions that inspect response variable values

TargetModelEstimatorAction()

Extends ModelEstimatorAction for modeling response (target) variable

TreeEstimatorAction()

Extends TargetModelEstimatorAction for Tree models

class Action[source]#

Action base abstract class

abstract execute(data: DataFrame, state: State, config: Config) tuple[ostatslib.states.state.State, float, ostatslib.actions.base.ActionInfo][source]#

Executes action

Parameters:
  • data (DataFrame) – data

  • state (State) – state

  • config (Config) – configuration dictionary

Returns:

tuple of next state, reward and action info

Return type:

tuple[State, float, ActionInfo]

class ActionInfo(action_name: str, model: Union[None, T] = None, raised_exception: bool = False, is_invalid_state: bool = False, next_state: None | ostatslib.states.state.State = None, fit_time: None | float = None)[source]#

Information class populated by action or environment during a step. Ostatslib implements Gymnasium step returns ref <https://gymnasium.farama.org/api/env/#gymnasium.Env.step>

class ClusteringEstimatorAction[source]#

Extends ModelEstimatorAction to fit a cluster model

class ExploratoryAction[source]#

Extends action base class for exploratory actions

execute(data: DataFrame, state: State, config: Config) tuple[ostatslib.states.state.State, float, ostatslib.actions.base.ActionInfo][source]#

Executes action

Parameters:
  • data (DataFrame) – data

  • state (State) – state

  • config (Config) – configuration dictionary

Returns:

tuple of next state, reward and action info

Return type:

tuple[State, float, ActionInfo]

class ModelEstimatorAction[source]#

Extends base action class for model estimators

execute(data: DataFrame, state: State, config: Config) tuple[ostatslib.states.state.State, float, ostatslib.actions.base.ActionInfo[T]][source]#

Executes action

Parameters:
  • data (DataFrame) – data

  • state (State) – state

  • config (Config) – configuration dictionary

Returns:

tuple of next state, reward and action info

Return type:

tuple[State, float, ActionInfo]

class TargetExploratoryAction[source]#

Extends ExploraotryAction base class for exploratory actions that inspect response variable values

class TargetModelEstimatorAction[source]#

Extends ModelEstimatorAction for modeling response (target) variable

class TreeEstimatorAction[source]#

Extends TargetModelEstimatorAction for Tree models