Skip to contents

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 "causal_forest", "s_learner", and "m_learner". Default is "causal_forest".

learner_type

The learner type for the chosen model. Options include "ridge" for Ridge Regression and "fnn" for Feedforward Neural Network. Default is "ridge".

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 NULL.

propensity

The propensity score

Value

The fitted model object.