mcf_main.ModifiedCausalForest.predict#
- ModifiedCausalForest.predict(data_df, new_keywords=None)#
Compute all effects.
meth:~ModifiedCausalForest.train method must be run beforehand.
- Parameters:
data_df (DataFrame) – Data used to compute the predictions. It must contain information about features (and treatment if effects for treatment specific subpopulations are desired as well).
new_keywords (Dictionary (or None). Default is None.) – Parameters of mcf instance to be changed. The keys in the dictionary are the parameters to be changed when running this method (and all methods that are run subsequently, like analyse or sensitivity), and the values corresponding to the keys are the new value (None is not allowed as new value). However, not all parameters can differ from those used during training. The following parameters can be changed, and thus specified as keys in this dictionary (some of these will however not influence the results of this method, but of other other used with the same instance): ‘gen_output_type’; ‘var_x_name_balance_test_ord’, ‘var_x_name_balance_test_unord’, ‘var_x_name_balance_bgate’, ‘var_x_name_ba’, ‘var_z_name_ord’, ‘var_z_name_unord’, ‘p_ba’, ‘p_ba_adj_method’, ‘p_ba_pos_weights_only’, ‘p_ba_use_x’, ‘p_ba_use_prop_score’, ‘p_ba_use_prog_score’, ‘p_ate_no_se_only’, ‘p_atet’, ‘p_gatet’, ‘p_bgate’, ‘p_cbgate’, ‘p_iate’, ‘p_iate_se’, ‘p_iate_m_ate’, ‘p_bgate_sample_share’, ‘p_gates_minus_previous’, ‘p_gates_smooth_bandwidth’, ‘p_gates_smooth’, ‘p_gates_smooth_no_evalu_points’, ‘p_gates_no_evalu_points’, ‘p_qiate’, ‘p_qiate_se’, ‘p_qiate_m_mqiate’, ‘p_qiate_m_opp’, ‘p_qiate_no_of_quantiles’, ‘p_qiate_smooth’ ‘p_qiate_smooth_bandwidth’, ‘p_qiate_bias_adjust’, ‘p_bt_yes’, ‘p_choice_based_sampling’, ‘p_choice_based_probs’, ‘p_cond_var’, ‘p_knn’, ‘p_knn_const’, ‘p_knn_min_k’, ‘p_nw_bandw’, ‘p_nw_kern’, ‘p_ci_level’, ‘p_se_boot_ate’, ‘p_se_boot_gate’, ‘p_se_boot_iate’, ‘p_se_boot_qiate’; ‘post_bin_corr_threshold’, ‘post_bin_corr_yes’, ‘post_est_stats’, ‘post_kmeans_yes’, ‘post_kmeans_no_of_groups’, ‘post_kmeans_max_tries’, ‘post_kmeans_min_size_share’, ‘post_kmeans_replications’, ‘post_kmeans_single’, ‘post_random_forest_vi’, ‘post_relative_to_first_group_only’, ‘post_plots’, ‘post_tree’.
- Returns:
results – Contains the results. This dictionary has the following structure: ‘ate’: ATE, ‘ate_se’: Standard error of ATE, ‘ate_effect_list’: List of names of estimated effects, ‘gate’: GATE, ‘gate_se’: SE of GATE, ‘gate_diff’: GATE minus ATE, ‘gate_diff_se’: Standard error of GATE minus ATE, ‘cbgate’: cbGATE (all covariates balanced), ‘cbgate_se’: Standard error of CBGATE, ‘cbgate_diff’: CBGATE minus ATE, ‘cbgate_diff_se’: Standard error of CBGATE minus ATE, ‘bgate’: BGATE (only prespecified covariates balanced), ‘bgate_se’: Standard error of BGATE, ‘bgate_diff’: BGATE minus ATE, ‘bgate_diff_se’: Standard errror of BGATE minus ATE, ‘gate_names_values’: Dictionary: Order of gates parameters and name and values of GATE effects. ‘qiate’: QIATE, ‘qiate_se’: Standard error of QIATEs, ‘qiate_diff’: QIATE minus QIATE at median, ‘qiate_diff_se’: Standard error of QIATE minus QIATE at median, ‘iate_data_df’: DataFrame with IATEs, ‘iate_names_dic’: Dictionary containing names of IATEs, ‘bala’: Effects of balancing tests, ‘bala_se’: Standard error of effects of balancing tests, ‘bala_effect_list’: Names of effects of balancing tests. ‘common_support_probabilities’ : pd.DataFrame containing treatment probabilities for all treatments, the identifier of the observation, and a dummy variable indicating whether the observation is inside or outside the common support. None if _int_with_output is False. ‘path_output’: Pathlib object, location of directory in which output is saved.
- Return type:
Dictionary.