PluginEstimator

Trait PluginEstimator 

Source
pub trait PluginEstimator: PluginComponent {
    // Required methods
    fn fit(
        &mut self,
        x: &ArrayView2<'_, Float>,
        y: &ArrayView1<'_, Float>,
    ) -> SklResult<()>;
    fn predict(&self, x: &ArrayView2<'_, Float>) -> SklResult<Array1<f64>>;
    fn score(
        &self,
        x: &ArrayView2<'_, Float>,
        y: &ArrayView1<'_, Float>,
    ) -> SklResult<f64>;
    fn is_fitted(&self) -> bool;

    // Provided methods
    fn predict_proba(&self, x: &ArrayView2<'_, Float>) -> SklResult<Array2<f64>> { ... }
    fn feature_importances(&self) -> Option<Array1<f64>> { ... }
}
Expand description

Plugin-based estimator

Required Methods§

Source

fn fit( &mut self, x: &ArrayView2<'_, Float>, y: &ArrayView1<'_, Float>, ) -> SklResult<()>

Fit the estimator

Source

fn predict(&self, x: &ArrayView2<'_, Float>) -> SklResult<Array1<f64>>

Predict using the fitted estimator

Source

fn score( &self, x: &ArrayView2<'_, Float>, y: &ArrayView1<'_, Float>, ) -> SklResult<f64>

Score the estimator

Source

fn is_fitted(&self) -> bool

Check if estimator is fitted

Provided Methods§

Source

fn predict_proba(&self, x: &ArrayView2<'_, Float>) -> SklResult<Array2<f64>>

Predict probabilities (for classifiers)

Source

fn feature_importances(&self) -> Option<Array1<f64>>

Get feature importance (if available)

Implementors§