mcf_main.ModifiedCausalForest.train#
- ModifiedCausalForest.train(data_df, exit_after_commonsupport=False)#
Build the modified causal forest on the training data.
- Parameters:
data_df (DataFrame) – Data used to compute the causal forest. It must contain information about outcomes, treatment, and features.
exit_after_commonsupport (Boolean, optional) – If True, return the training-result dictionary after common-support processing. Data preparation and sample splitting still run, but local centering and causal forest training are skipped. To apply the fitted common-support rules to new data, call
predict()with ‘exit_after_commonsupport=True’. If ‘cs_type’ is 0, common-support processing is skipped and the method still returns before forest training. The default is False.
- Returns:
results – Training samples and common-support information. The same keys are returned for both values of ‘exit_after_commonsupport’.
- ’tree_df’DataFrame
Processed sample for building the trees.
- ’fill_y_df’DataFrame
Processed sample for filling the trees with outcome values.
- ’common_support_probabilities_tree’DataFrame or None
Common-support table for the sample used to build the trees, before trimming. Contains treatment probabilities, the observation identifier, and ‘on_support’ (1 if retained, 0 if excluded). None if ‘cs_type’ is 0 or ‘_int_with_output’ is False.
- ’common_support_probabilities_fill_y’DataFrame or None
Same information for the sample used to fill the trees, before trimming. None if ‘cs_type’ is 0 or ‘_int_with_output’ is False.
- ’path_output’Path or None
Directory in which output is saved. None if _int_with_output is False.
- Return type:
Dictionary.