MCPcopy Create free account
hub / github.com/Open-Quant/openquant / SimpleClassifier

Interface SimpleClassifier

crates/openquant/src/cross_validation.rs:4–10  ·  view source on GitHub ↗

Simple classifier interface for cross-validation.

Source from the content-addressed store, hash-verified

2
3/// Simple classifier interface for cross-validation.
4pub trait SimpleClassifier {
5 fn fit(&mut self, x: &[Vec<f64>], y: &[f64], sample_weight: Option<&[f64]>);
6 fn predict_proba(&self, x: &[Vec<f64>]) -> Vec<f64>;
7 fn predict(&self, x: &[Vec<f64>]) -> Vec<f64> {
8 self.predict_proba(x).into_iter().map(|p| if p >= 0.5 { 1.0 } else { 0.0 }).collect()
9 }
10}
11
12#[derive(Clone, Copy)]
13pub enum Scoring {

Callers

nothing calls this directly

Implementers 3

hyperparameter_tuning.rscrates/openquant/tests/hyperparameter_
feature_importance.rscrates/openquant/tests/feature_importa
cross_validation.rscrates/openquant/tests/cross_validatio

Calls

no outgoing calls

Tested by

no test coverage detected