actableai.tasks.tests package

Submodules

actableai.tasks.tests.test_association_rules module

class actableai.tasks.tests.test_association_rules.TestAssociationRules

Bases: object

test_association_rules(association_rules_task: actableai.tasks.association_rules.AAIAssociationRulesTask)
test_association_rules_fpmax(association_rules_task: actableai.tasks.association_rules.AAIAssociationRulesTask)
test_association_rules_multi_group_by(association_rules_task: actableai.tasks.association_rules.AAIAssociationRulesTask)
test_association_rules_none(association_rules_task: actableai.tasks.association_rules.AAIAssociationRulesTask)
test_association_rules_wrong_association_metric(association_rules_task: actableai.tasks.association_rules.AAIAssociationRulesTask)
test_association_rules_wrong_frequent_method(association_rules_task: actableai.tasks.association_rules.AAIAssociationRulesTask)
test_empty_dataframe(association_rules_task: actableai.tasks.association_rules.AAIAssociationRulesTask)
actableai.tasks.tests.test_association_rules.association_rules_task()

actableai.tasks.tests.test_base module

class actableai.tasks.tests.test_base.TestBaseTask

Bases: object

pytestmark = [Mark(name='parametrize', args=('optimize_gpu_memory_allocation_nrmse_threshold', [0.0, 1.0]), kwargs={}), Mark(name='parametrize', args=('optimize_memory_allocation_nrmse_threshold', [0.0, 1.0]), kwargs={}), Mark(name='parametrize', args=('use_ray,optimize_memory_allocation,optimize_gpu_memory_allocation,collect_memory_usage,collect_gpu_memory_usage', [(True, True, True, True, True), (True, True, True, True, False), (True, True, True, False, True), (True, True, True, False, False), (True, True, False, True, True), (True, True, False, True, False), (True, True, False, False, True), (True, True, False, False, False), (True, False, True, True, True), (True, False, True, True, False), (True, False, True, False, True), (True, False, True, False, False), (True, False, False, True, True), (True, False, False, True, False), (True, False, False, False, True), (True, False, False, False, False), (False, False, False, False, False)]), kwargs={})]
test_simple(aai_simple_task, use_ray, optimize_memory_allocation, collect_memory_usage, optimize_memory_allocation_nrmse_threshold, optimize_gpu_memory_allocation, collect_gpu_memory_usage, optimize_gpu_memory_allocation_nrmse_threshold, resources_predictors_actor)
actableai.tasks.tests.test_base.aai_simple_task()
actableai.tasks.tests.test_base.init_ray_class()
actableai.tasks.tests.test_base.resources_predictors_actor(init_ray_class)

actableai.tasks.tests.test_bayesian_regression module

class actableai.tasks.tests.test_bayesian_regression.TestBayesianRegression

Bases: object

test_categorical_features(df, task)
test_full_data(df, task)
test_full_data_multivariate_result(df, task)
test_invalid_priors(df, task)
test_mix_features(df, task)
test_no_prediction(df, task)
test_no_validation(df, task)
test_polynomial_degree(df, task)
test_priors(df, task)
actableai.tasks.tests.test_bayesian_regression.df()
actableai.tasks.tests.test_bayesian_regression.task()

actableai.tasks.tests.test_causal module

class actableai.tasks.tests.test_causal.TestRemoteCausal

Bases: object

test_binary_outcome(causal_inference_task, simple_linear_dataset, init_ray)
test_boolean_treatment(causal_inference_task, single_binary_treatment_dataset, init_ray)
test_categorical_effect_modifier(causal_inference_task, cat_em_dataset, init_ray)
test_categorical_outcome(causal_inference_task)
test_dml(causal_inference_task, init_ray, dml_model, dml_model_params)
test_linear_dataset(causal_inference_task, init_ray)
test_log_cat_outcome(causal_inference_task, single_cont_treatment_dataset, init_ray)
test_log_treatment(causal_inference_task, single_cont_treatment_dataset, init_ray)
test_make_pretty_tree()
test_missing_common_causes(causal_inference_task, simple_linear_dataset, init_ray)
test_missing_effect_modifiers(causal_inference_task, simple_linear_dataset, init_ray)
test_missing_outcome(causal_inference_task, simple_linear_dataset, init_ray)
test_missing_treatment(causal_inference_task, simple_linear_dataset, init_ray)
test_no_common_causes(causal_inference_task, simple_linear_dataset, init_ray)
test_no_effect_modifiers(causal_inference_task, simple_linear_dataset, init_ray)
test_no_effect_modifiers_and_common_causes(causal_inference_task, simple_linear_dataset, init_ray)
test_non_dml(causal_inference_task, simple_linear_dataset, init_ray, dml_model, dml_model_params)
test_not_enough_values(causal_inference_task: actableai.tasks.causal_inference.AAICausalInferenceTask, simple_linear_dataset, init_ray)
test_single_binary_treatment(causal_inference_task, single_binary_treatment_dataset, init_ray)
test_single_cont_treatment(causal_inference_task, single_cont_treatment_dataset, init_ray)
actableai.tasks.tests.test_causal.cat_em_dataset()
actableai.tasks.tests.test_causal.causal_inference_task()
actableai.tasks.tests.test_causal.epsilon_sample(n)
actableai.tasks.tests.test_causal.eta_sample(n)
actableai.tasks.tests.test_causal.simple_linear_dataset()
actableai.tasks.tests.test_causal.single_binary_treatment_dataset()
actableai.tasks.tests.test_causal.single_cont_treatment_dataset()
actableai.tasks.tests.test_causal.treatment_values_filler(pd_table: pandas.core.frame.DataFrame, treatment: str = 'v0') pandas.core.frame.DataFrame

actableai.tasks.tests.test_causal_discovery module

class actableai.tasks.tests.test_causal_discovery.TestCausalDiscoveryTask

Bases: object

test_invalid_algorithm(causal_discovery_task, tmp_path)
test_run_success(causal_discovery_task, algo, tmp_path)
actableai.tasks.tests.test_causal_discovery.causal_discovery_task()

actableai.tasks.tests.test_classification module

class actableai.tasks.tests.test_classification.TestDebiasing

Bases: object

test_debiasing_text_column(classification_task, tmp_path)
test_mixed_debiasing_feature_cat(classification_task, tmp_path)
test_mixed_debiasing_feature_num(classification_task, tmp_path)
test_simple_debiasing_feature(classification_task, tmp_path)
test_simple_debiasing_feature_refit_full(classification_task, tmp_path)
class actableai.tasks.tests.test_classification.TestRemoteClassification

Bases: object

test_available_models_binary_explain()
test_available_models_binary_gpu()
test_available_models_binary_gpu_noautomm()
test_available_models_binary_nogpu()
test_available_models_binary_nogpu_explain()
test_available_models_multiclass_explain()
test_available_models_multiclass_gpu()
test_available_models_multiclass_gpu_noautomm()
test_available_models_multiclass_nogpu()
test_available_models_multiclass_nogpu_explain()
test_boolean_str_target_column(classification_task, tmp_path)
test_boolean_target_column(classification_task, tmp_path)
test_categorical(classification_task, tmp_path)
test_datetime(classification_task, tmp_path)
test_datetime_target(classification_task, tmp_path)
test_drop_duplicates(classification_task, tmp_path)
test_drop_duplicates_insufficient(classification_task, tmp_path)
test_empty_column(classification_task, tmp_path)
test_explain_bool_sample_with_nan(classification_task, tmp_path, init_ray)
test_extra_columns(classification_task, tmp_path)
test_hpo_default_binary(classification_task, tmp_path, model_type, is_gpu_available)

Test default settings for HPO models for binary classification

test_hpo_default_multiclass(classification_task, tmp_path, model_type, is_gpu_available)

Test default settings for HPO models for multiclass classification

test_insufficient_class(classification_task, tmp_path)
test_insufficient_cls_sample(classification_task, tmp_path)
test_insufficient_data(classification_task, tmp_path)
test_insufficient_valid_data(classification_task, tmp_path)
test_invalid_column(classification_task, tmp_path)
test_mix_feature_column(classification_task, tmp_path)
test_mix_target_column(classification_task, tmp_path)
test_multiclass_cat(classification_task, tmp_path)
test_multiclass_num(classification_task, tmp_path)

AutoGluon infers your prediction problem is: ‘regression’ (because dtype of label-column == float and many unique label-values observed).

test_numeric(classification_task, tmp_path)
test_numeric_and_categorical_and_datetime(classification_task, tmp_path)
test_numeric_refit_full(classification_task, tmp_path)
test_ray(tmp_path, init_ray)
test_reproducible_results(classification_task_seed, tmp_path, is_gpu_available)

Check if two tasks run with the same seed yield the same results

test_run_eval_metric_roc_auc_task_binary(classification_task, tmp_path)
test_run_temporal_split_column(classification_task, tmp_path)
test_suggest_analytic(classification_task, tmp_path)
test_tabpfn_activated(classification_task, tmp_path)
test_tabpfn_not_activated(classification_task, tmp_path)
test_unencoded_binary(classification_task, tmp_path)
class actableai.tasks.tests.test_classification.TestRemoteClassificationCrossValidation

Bases: object

test_cross_val(classification_task, tmp_path)
test_cross_val_refit_full(classification_task, tmp_path)
test_cross_val_with_text(classification_task, tmp_path)
test_cross_val_with_text_fail(classification_task, tmp_path)
test_debiasing_feature(classification_task, tmp_path)
actableai.tasks.tests.test_classification.available_models(problem_type, gpu, explain_samples=False, ag_automm_enabled=False, tabpfn_enabled=False)
actableai.tasks.tests.test_classification.classification_task()
actableai.tasks.tests.test_classification.classification_task_seed(seed=0)
actableai.tasks.tests.test_classification.run_classification_task(classification_task: actableai.tasks.classification.AAIClassificationTask, tmp_path, *args, drop_duplicates=False, **kwargs)
actableai.tasks.tests.test_classification.run_classification_task_seed(classification_task_seed: actableai.tasks.classification.AAIClassificationTask, tmp_path, *args, drop_duplicates=False, **kwargs)

actableai.tasks.tests.test_clustering module

class actableai.tasks.tests.test_clustering.TestRemoteSegmentation

Bases: object

test_insufficent_data(clustering_task)
test_invalid_n_cluster_data(clustering_task)
test_max_train_samples(clustering_task)
test_segment_1_col(clustering_task)
test_segment_bool_col(clustering_task)
test_segment_categorical_cols(clustering_task, clustering_model, clustering_model_parameters)
test_segment_empty_col(clustering_task)
test_segment_mixed_type(clustering_task, clustering_model, clustering_model_parameters, project_model, projection_model_parameters)
test_segment_mutiple_cols(clustering_task)
test_segment_with_explanations(clustering_task, init_ray)
test_text_column(clustering_task)
actableai.tasks.tests.test_clustering.clustering_task()

actableai.tasks.tests.test_correlation module

class actableai.tasks.tests.test_correlation.TestRemoteCorrelation

Bases: object

test_bool(correlation_task)
test_bool_missing_values(correlation_task)
test_bool_target(correlation_task)
test_categorical_vs_categorical(correlation_task)
test_categorical_vs_categorical_nan(correlation_task)
test_categorical_vs_categorical_nan_target(correlation_task)
test_categorical_vs_continuous(correlation_task)
test_categorical_vs_continuous_nan(correlation_task)
test_categorical_vs_mix(correlation_task)
test_chart_sorted_by_corr(correlation_task)
test_continuous_vs_categorical(correlation_task)
test_continuous_vs_categorical_nan(correlation_task)
test_continuous_vs_continuous(correlation_task)
test_continuous_vs_continuous_nan(correlation_task)
test_continuous_vs_continuous_nan_target(correlation_task)
test_continuous_vs_mix(correlation_task)
test_control(correlation_task)
test_empty_columns(correlation_task)
test_empty_target(correlation_task)
test_feat_col_is_datetime(correlation_task)
test_nan_in_categorical_column(correlation_task)
test_target_col_is_datetime(correlation_task)
test_target_value_in_row_contains_nan(correlation_task)
test_target_value_non_object(correlation_task)
test_textngram(correlation_task)
test_top_k(correlation_task)
test_use_bonferroni(correlation_task)
actableai.tasks.tests.test_correlation.correlation_task()

actableai.tasks.tests.test_data_imputation module

class actableai.tasks.tests.test_data_imputation.TestDataImputation

Bases: object

test_data_contain_datetime_column(data_imputation_task, date_range)
test_impute_boolean(data_imputation_task)
test_impute_datetime(data_imputation_task, date_range)
test_impute_null(data_imputation_task)
test_impute_timeseries(data_imputation_task, date_range)
test_mix_single_and_multi_row_rule(data_imputation_task)
test_multi_row_rule(data_imputation_task)
test_single_row_rule(data_imputation_task)
actableai.tasks.tests.test_data_imputation.data_imputation_task()
actableai.tasks.tests.test_data_imputation.date_range()
actableai.tasks.tests.test_data_imputation.test_construct_rules(raw, expect_rule_str)

actableai.tasks.tests.test_direct_causal module

class actableai.tasks.tests.test_direct_causal.TestCausalFeatureSelection

Bases: object

test_mixed_dataset()

actableai.tasks.tests.test_forecast module

class actableai.tasks.tests.test_forecast.TestTimeSeries

Bases: object

test_cat_features(np_rng, forecast_task, freq)
test_date_fmt(np_rng, forecast_task)
test_date_interp(np_rng, forecast_task)
test_empty_column(np_rng, forecast_task, freq)
test_hyperopt(np_rng, forecast_task, n_targets, freq)
test_insufficient_data(np_rng, forecast_task, freq)
test_invalid_column(np_rng, forecast_task, freq)
test_invalid_date_column(np_rng, forecast_task, freq)
test_invalid_frequency(np_rng, forecast_task, freq)
test_invalid_prediction_length(np_rng, forecast_task, freq)
test_mix_target_column(np_rng, forecast_task, freq)
test_ray(np_rng, init_ray, freq)
test_simple(np_rng, forecast_task, n_group_by, n_targets, use_features, sorted_data, freq)
actableai.tasks.tests.test_forecast.forecast_task()

actableai.tasks.tests.test_intervention module

class actableai.tasks.tests.test_intervention.TestIntervention

Bases: object

test_intervention_categorical(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_categorical_cate(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_categorical_outcome_with_common_causes(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_no_common_causes_drop_features(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_numeric(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_numeric_cate(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_numeric_treatment_categorical_outcome(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_numeric_treatment_categorical_outcome_not_enough_classes(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_with_common_causes(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_with_common_causes_cate(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
test_intervention_with_common_causes_date(intervention_task: actableai.tasks.intervention.AAIInterventionTask, tmp_path)
actableai.tasks.tests.test_intervention.intervention_task()

actableai.tasks.tests.test_regression module

class actableai.tasks.tests.test_regression.TestDebiasing

Bases: object

test_debiasing_text_column(regression_task, tmp_path)
test_evaluate_has_data(regression_task, data, tmp_path)
test_mixed_debiasing_feature_cat(regression_task, tmp_path)
test_mixed_debiasing_feature_num(regression_task, tmp_path)
test_simple_debiasing_feature(regression_task, tmp_path)
test_simple_debiasing_feature_refit_full(regression_task, tmp_path)
class actableai.tasks.tests.test_regression.TestRemoteRegression

Bases: object

test_autogluon_multiclass_case(regression_task, tmp_path)

AutoGluon infers your prediction problem is: ‘multiclass’ (because dtype of label-column == int, but few unique label-values observed).

test_available_models_quantile_gpu()
test_available_models_quantile_nogpu()
test_available_models_regression_explain()
test_available_models_regression_gpu()
test_available_models_regression_gpu_noautomm()
test_available_models_regression_nogpu()
test_available_models_regression_nogpu_explain()
test_complex_text(regression_task, tmp_path)
test_datetime(regression_task, tmp_path)
test_datetime_target(regression_task, tmp_path)
test_drop_duplicates(regression_task, tmp_path)
test_drop_duplicates_insufficient(regression_task, tmp_path)
test_empty_feature_column(regression_task, tmp_path)
test_empty_target_column(regression_task, tmp_path)
test_explain_samples(regression_task, tmp_path)
test_explain_samples_quantiles(regression_task, tmp_path)
test_explain_samples_with_datetime(regression_task, tmp_path)
test_feature_missing_value(regression_task, tmp_path)
test_hpo_default_quantile(regression_task, tmp_path, model_type, is_gpu_available)

Test default settings for HPO models for quantile regression

test_hpo_default_regression(regression_task, tmp_path, model_type, is_gpu_available)

Test default settings for HPO models for regression

test_hyperparam_multimodal(regression_task, tmp_path)
test_insufficient_data(regression_task, tmp_path)
test_invalid_column(regression_task, tmp_path)
test_invalid_eval_metric(regression_task, tmp_path, data)
test_mixed_datetime(regression_task, tmp_path)
test_mixed_feature_column(regression_task, tmp_path)
test_mixed_target_column(regression_task, tmp_path)
test_num_vs_categorical(regression_task, tmp_path)
test_num_vs_mix(regression_task, tmp_path)
test_num_vs_num(regression_task, tmp_path)
test_num_vs_num_refit_full(regression_task, tmp_path)
test_reproducible_results(regression_task_seed, tmp_path, is_gpu_available)

Check if two tasks run with the same seed yield the same results

test_run_temporal_split_column(regression_task, tmp_path)
test_suggest_analytic(regression_task, tmp_path)
test_validation_has_prediction(regression_task, tmp_path)
class actableai.tasks.tests.test_regression.TestRemoteRegressionCrossValidation

Bases: object

test_causal_feature_selection(regression_task, tmp_path)
test_causal_feature_selection_no_causal_feature(regression_task, tmp_path)
test_cross_val(regression_task, tmp_path)
test_cross_val_refit_full(regression_task, tmp_path)
test_cross_val_with_explain(regression_task, tmp_path)
test_cross_val_with_quantiles(regression_task, tmp_path)
test_debiasing_feature(regression_task, tmp_path)
test_with_quantile(regression_task, tmp_path)
actableai.tasks.tests.test_regression.available_models(problem_type, gpu, explain_samples=False, ag_automm_enabled=False, tabpfn_enabled=False)
actableai.tasks.tests.test_regression.data()
actableai.tasks.tests.test_regression.regression_task()
actableai.tasks.tests.test_regression.regression_task_seed(seed=0)
actableai.tasks.tests.test_regression.run_regression_task(regression_task: actableai.tasks.regression.AAIRegressionTask, tmp_path, *args, **kwargs) Dict[str, Any]
actableai.tasks.tests.test_regression.run_regression_task_seed(regression_task_seed: actableai.tasks.regression.AAIRegressionTask, tmp_path, *args, **kwargs) Dict[str, Any]

Module contents