Skip to main content

LinearScoreModel

Trait LinearScoreModel 

Source
pub trait LinearScoreModel {
    // Required methods
    fn name(&self) -> String;
    fn estimate_score(
        &self,
        input: &ScoreInput<'_>,
        folds: &[Fold],
    ) -> Result<ScoreEstimate>;

    // Provided methods
    fn validate(&self, _data: &DmlData) -> Result<()> { ... }
    fn strata(&self, _data: &DmlData) -> Option<Vec<usize>> { ... }
}
Expand description

A DML model whose orthogonal score is linear in θ.

Implement this to plug a new score into the shared machinery (repeated cross-fitting, aggregation, inference, bootstrap) via fit_model.

Required Methods§

Source

fn name(&self) -> String

Label for summaries, e.g. "PLR (partialling out)".

Source

fn estimate_score( &self, input: &ScoreInput<'_>, folds: &[Fold], ) -> Result<ScoreEstimate>

Cross-fit the nuisances on folds and return the score elements.

Provided Methods§

Source

fn validate(&self, _data: &DmlData) -> Result<()>

Reject data the model cannot handle (called once before fitting).

Source

fn strata(&self, _data: &DmlData) -> Option<Vec<usize>>

Strata for the default sample splits (e.g. treatment levels), so each fold holds about the same share of every stratum. None (the default) draws plain K-fold splits.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§