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§
Sourcefn fit(
&mut self,
x: &ArrayView2<'_, Float>,
y: &ArrayView1<'_, Float>,
) -> SklResult<()>
fn fit( &mut self, x: &ArrayView2<'_, Float>, y: &ArrayView1<'_, Float>, ) -> SklResult<()>
Fit the estimator
Sourcefn predict(&self, x: &ArrayView2<'_, Float>) -> SklResult<Array1<f64>>
fn predict(&self, x: &ArrayView2<'_, Float>) -> SklResult<Array1<f64>>
Predict using the fitted estimator
Sourcefn score(
&self,
x: &ArrayView2<'_, Float>,
y: &ArrayView1<'_, Float>,
) -> SklResult<f64>
fn score( &self, x: &ArrayView2<'_, Float>, y: &ArrayView1<'_, Float>, ) -> SklResult<f64>
Score the estimator
Provided Methods§
Sourcefn predict_proba(&self, x: &ArrayView2<'_, Float>) -> SklResult<Array2<f64>>
fn predict_proba(&self, x: &ArrayView2<'_, Float>) -> SklResult<Array2<f64>>
Predict probabilities (for classifiers)
Sourcefn feature_importances(&self) -> Option<Array1<f64>>
fn feature_importances(&self) -> Option<Array1<f64>>
Get feature importance (if available)