actableai.models.legacy package

Submodules

actableai.models.legacy.inference module

class actableai.models.legacy.inference.AAIModelInferenceHeadLegacy(cache_maxsize: int = 20)

Bases: object

classmethod get_actor(cache_maxsize: int = 20)
async get_model_ref(s3_bucket_name, path)
static load_raw_model(s3_bucket_name, path)
class actableai.models.legacy.inference.AAIModelInferenceLegacy(s3_bucket, s3_prefix='', cache_maxsize=5, head_cache_maxsize=20)

Bases: object

TODO write documentation

classmethod deploy(ray_autoscaling_configs, ray_options, s3_bucket, s3_prefix='', cache_maxsize=5, head_cache_maxsize=20)

TODO write documentation

classmethod get_deployment()

TODO write documentation

classmethod get_handle()

TODO write documentation

async get_metadata(task_id)
static get_model_path(s3_prefix, task_id)

TODO write documentation

async is_model_available(task_id)

TODO write documentation

async predict(task_id, df, return_probabilities=False, probability_threshold=0.5, positive_label=None)
async predict_proba(task_id, df)

actableai.models.legacy.intervention module

actableai.models.legacy.intervention.empty_string_to_nan(df: pandas.core.frame.DataFrame, task_model, intervention_col: str, new_intervention_col: str, expected_target: str) pandas.core.frame.DataFrame
Replace the empty string to nan in interventional model, also checks if the
column exist in the DataFrame for new_intervention_col
Parameters
  • df – DataFrame with empty strings values
  • task_model – Task_model containing the discrete_treatment information
  • intervention_col – Column name of the current treatment
  • new_intervention_col – Column name of the new treatment
Returns

DataFrame containing the result with the intervention columns

empty strings set to nan values and casted as float if treatment is not discrete.

Return type

pd.DataFrame

Module contents