actableai.regression package

Submodules

actableai.regression.cross_validation module

actableai.regression.cross_validation.run_cross_validation(regression_train_task: actableai.tasks.regression._AAIRegressionTrainTask, kfolds: int, cross_validation_max_concurrency: int, explain_samples: bool, presets: str, hyperparameters: Dict[str, Dict], model_directory: str, target: str, features: List[str], run_model: bool, df_train: pandas.core.frame.DataFrame, df_test: pandas.core.frame.DataFrame, prediction_quantiles: Optional[List[int]], drop_duplicates: bool, run_debiasing: bool, biased_groups: List[str], debiased_features: List[str], residuals_hyperparameters: Dict[str, Dict], num_gpus: Union[int, str], eval_metric: str, time_limit: Optional[int], drop_unique: bool, drop_useless_features: bool, feature_prune: bool, feature_prune_time_limit: Optional[float], num_trials: int, problem_type: str, infer_limit: float, infer_limit_batch_size: int) Tuple[Dict, Dict, Union[List, Dict], List, List, List]

Run cross validation on Regression Task. Data is divided in kfold groups and each run a regression. The returned values are means or lists of values from each sub regression task.

Parameters
  • regression_train_task (_AAIRegressionTrainTask) – Sub Regression Task Object
  • kfolds (int) – Number of folds
  • cross_validation_max_concurrency (int) – Max concurrency of sub regression task
  • explain_samples (bool) – Explaining the samples
  • presets (str) – Presets of the regressions
  • hyperparameters (Dict[str, Dict]) – Hyperparameters of the regressions
  • model_directory (str) – Model directory for the regression
  • target (str) – Target for regressions
  • features (List[str]) – Features for the regressions
  • run_model (bool) – If True, regressions models run predictions on unseen values
  • df_train (pd.DataFrame) – Training data
  • df_test (pd.DataFrame) – Testing data
  • prediction_quantiles – Prediction quantiles for the regressions
  • drop_duplicates (bool) – If True, only the unique values are kept
  • run_debiasing (bool) – If True, features are debiased w.r.t to biased_groups and debiased_features
  • biased_groups (List[str]) – Biased features in the data
  • debiased_features (List[str]) – Features debiased of the biased groups
  • residuals_hyperparameters (Dict[str, Dict]) – HyperParameters for debiasing models
  • num_gpus (int) – Number of GPUs for the model
  • time_limit – Time limit of training (in seconds)
  • feature_prune – If True, features are pruned
  • feature_prune_time_limit – Time limit for feature pruning (in seconds) If None, the remaining training time is used
  • num_trials – The number of trials for hyperparameter optimization
  • problem_type – The type of problem (‘regression’ or ‘quantile’)
  • infer_limit – The time in seconds to predict 1 row of data. For example, infer_limit=0.05 means 50 ms per row of data, or 20 rows / second throughput.
  • infer_limit_batch_size – The amount of rows passed at once to be predicted when calculating per-row speed. This is very important because infer_limit_batch_size=1 (online-inference) is highly suboptimal as various operations have a fixed cost overhead regardless of data size. If you can pass your test data in bulk, you should specify infer_limit_batch_size=10000. Must be an integer greater than 0.
Returns

important_features evaluate predictions predict_shap_values df_val leaderboard

Return type

Tuple[Dict, Dict, List, List, List, List]

actableai.regression.model module

class actableai.regression.model.RegressionInference(model: actableai.models.inference.ModelType)

Bases: actableai.models.autogluon.base.AAIAutogluonTabularInference[actableai.regression.model.RegressionModel, actableai.regression.model.RegressionMetadata]

class actableai.regression.model.RegressionMetadata(*, features: List[str], feature_parameters: Dict[str, Any], problem_type: Literal['regression', 'quantile'], prediction_target: str, is_explainer_available: bool, intervened_column: Optional[str] = None, discrete_treatment: Optional[str] = None, quantile_levels: Optional[List[float]] = None)

Bases: actableai.models.autogluon.base.AAIAutogluonTabularMetadata

problem_type: Literal['regression', 'quantile']
quantile_levels: Optional[List[float]]
class actableai.regression.model.RegressionModel(autogluon_model, df_training: pandas.core.frame.DataFrame, explanation_model=None, intervention_model=None)

Bases: actableai.models.autogluon.base.AAIAutogluonTabularModel

actableai.regression.quantile module

class actableai.regression.quantile.GradientBoostQuantileRegressor(quantile_levels: list, **kwargs)

Bases: autogluon.core.models.abstract.abstract_model.AbstractModel

actableai.regression.quantile.ag_quantile_hyperparameters()

Returns a dictionary of Quantile Regressor Model for AutoGluon hyperparameters.

Returns
Models for AutoGluon hyperparameters.
Return type
dictionnary

Module contents

class actableai.regression.OneHotEncodingTransformer(df)

Bases: object

fit_transform(X, y=None)
transform(X)
class actableai.regression.PolynomialLinearPredictor(path: Optional[str] = None, name: Optional[str] = None, problem_type: Optional[str] = None, eval_metric: Optional[Union[str, autogluon.core.metrics.Scorer]] = None, hyperparameters=None)

Bases: autogluon.core.models.abstract.abstract_model.AbstractModel