fit_model {cramR} | R Documentation |
Cram Policy: Fit Model
Description
This function trains a given unfitted model with the provided data and parameters, according to model type and learner type.
Usage
fit_model(model, X, Y, D, model_type, learner_type, model_params, propensity)
Arguments
model |
An unfitted model object, as returned by 'set_model'. |
X |
A matrix or data frame of covariates for the samples. |
Y |
A vector of outcome values. |
D |
A vector of binary treatment indicators (1 for treated, 0 for untreated). |
model_type |
The model type for policy learning. Options include |
learner_type |
The learner type for the chosen model. Options include |
model_params |
A list of additional parameters to pass to the model, which can be any parameter defined in the model reference package. Defaults to |
propensity |
The propensity score |
Value
The fitted model object.