pub trait Classifier: Send + Sync {
// Required methods
fn fit(
&mut self,
x: ArrayView2<'_, f64>,
y: ArrayView1<'_, f64>,
) -> Result<()>;
fn predict_proba(&self, x: ArrayView2<'_, f64>) -> Result<Array1<f64>>;
fn fresh(&self) -> Box<dyn Classifier>;
}Expand description
A classification learner returning P(label = 1 | X), used for
propensity scores in models with a binary treatment such as Irm.
Required Methods§
fn fit(&mut self, x: ArrayView2<'_, f64>, y: ArrayView1<'_, f64>) -> Result<()>
fn predict_proba(&self, x: ArrayView2<'_, f64>) -> Result<Array1<f64>>
fn fresh(&self) -> Box<dyn Classifier>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".