Skip to contents

tidycate 0.1.1

  • New vignette, vignette("tidycate"): an introduction to the ideas behind the five learners and the uplift metrics, then an S-learner and an R-learner fit to two simulated email campaigns with different base models and scored with every metric.

tidycate 0.1.0

  • Added the S-learner. s_learner() creates a learner from any tidymodels workflow, fit() checks the treatment and fits the workflow, and predict() returns the estimated effect (.pred_cate) or the potential outcomes (.pred_control, .pred_treated). Numeric and binary outcomes are supported.

  • Added the T-learner. t_learner() creates a learner from any tidymodels workflow that leaves out the treatment, fit() fits it separately on the treated and control units, and predict() returns the estimated effect (.pred_cate) or the potential outcomes (.pred_control, .pred_treated). Numeric and binary outcomes are supported.

  • Added the X-learner. x_learner() takes a tidymodels workflow for the outcome model, an optional model specification for the effect models, and a propensity: a known number, or a classification workflow that estimates it. fit() fits the outcome model in each treatment group, estimates each unit’s effect from the other group’s model, and fits the effect models to those estimates. predict() returns the propensity-weighted estimated effect (.pred_cate). Numeric and binary outcomes are supported.

  • Added the R-learner. r_learner() takes a tidymodels workflow for the outcome model (without the treatment), an optional model specification for the effect model, and a propensity: a known number, or a classification workflow that estimates it. fit() cross-fits the outcome and propensity models (folds: a number of folds or an rsample object), computes each unit’s pseudo-outcome, and fits the effect model to them with case weights. It warns when any propensity is below 0.01 or above 0.99. predict() returns the estimated effect (.pred_cate). Numeric and binary outcomes are supported.

  • Added the DR-learner. dr_learner() takes a tidymodels workflow for the outcome model (without the treatment), an optional model specification for the effect model, and a propensity: a known number, or a classification workflow that estimates it. fit() cross-fits the outcome model in each treatment group and the propensity model (folds: a number of folds or an rsample object), computes each unit’s doubly robust pseudo-outcome, and fits the effect model to them. It warns when any propensity is below 0.01 or above 0.99. predict() returns the estimated effect (.pred_cate). Numeric and binary outcomes are supported.

  • Added uplift metrics, which score estimated effects on held-out data from a randomized experiment using only the observed outcomes. qini_coef() and uplift_at_k() are yardstick metrics (with _vec() versions) that take a treatment column and work in yardstick::metric_set() and on grouped data. qini_curve() returns the Qini curve as a tibble, and cate_cal_table() compares estimated with observed effects in bins of the estimates. augment() adds a fitted learner’s estimated effects (.pred_cate) to new data.

  • Learners print a short summary. Before fitting, it lists the learner’s models with their formula, recipe steps, or variables, and the propensity. After fitting, it also shows the outcome, the treatment’s coding, and the number of treated and control rows. For the R- and DR-learners, it shows the cross-fitting folds and the range of any estimated propensities.