pub struct RLearner { /* private fields */ }Expand description
R-learner (Nie & Wager, 2021): with cross-fitted m̂(x) = E[Y | X] and
propensity ê(x), minimise Σ (Ỹ − τ(X)·D̃)², i.e. a weighted regression
of Ỹ/D̃ on X with weights D̃². The effect learner must support
Regressor::fit_weighted.
Implementations§
Source§impl RLearner
impl RLearner
pub fn new( outcome: impl Regressor + 'static, propensity: impl Classifier + 'static, effect: impl Regressor + 'static, ) -> Self
pub fn from_boxed( outcome: Box<dyn Regressor>, propensity: Box<dyn Classifier>, effect: Box<dyn Regressor>, ) -> Self
pub fn n_folds(self, n_folds: usize) -> Self
pub fn seed(self, seed: u64) -> Self
Sourcepub fn clipping_threshold(self, t: f64) -> Self
pub fn clipping_threshold(self, t: f64) -> Self
Propensities are clipped to [t, 1 − t] (default 0.01).
pub fn fit(&self, data: &DmlData) -> Result<CateFit>
pub fn fit_with_folds(&self, data: &DmlData, folds: &[Fold]) -> Result<CateFit>
Auto Trait Implementations§
impl !RefUnwindSafe for RLearner
impl !UnwindSafe for RLearner
impl Freeze for RLearner
impl Send for RLearner
impl Sync for RLearner
impl Unpin for RLearner
impl UnsafeUnpin for RLearner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more