This function trains a given unfitted model with the provided data and parameters, according to model type and learner type.
fit_model(model, X, Y, D, model_type, learner_type, model_params, propensity)The fitted model object.
An unfitted model object, as returned by `set_model`.
A matrix or data frame of covariates for the samples.
A vector of outcome values.
A vector of binary treatment indicators (1 for treated, 0 for untreated).
The model type for policy learning. Options include "causal_forest", "s_learner", and "m_learner". Default is "causal_forest".
The learner type for the chosen model. Options include "ridge" for Ridge Regression and "fnn" for Feedforward Neural Network. Default is "ridge".
A list of additional parameters to pass to the model, which can be any parameter defined in the model reference package. Defaults to NULL.
The propensity score