Struct juice::solver::regression_evaluator::RegressionEvaluator
source · pub struct RegressionEvaluator { /* private fields */ }
Expand description
Sampled Evaluator for Regression Problems
Produces measure of accuracy for regression problems up to Capacity
elements in a
First-In First-Out stack.
Implementations§
source§impl RegressionEvaluator
impl RegressionEvaluator
sourcepub fn new(evaluation_metric: Option<String>) -> RegressionEvaluator
pub fn new(evaluation_metric: Option<String>) -> RegressionEvaluator
Create an evaluator for Regression Problems
§Arguments
evaluation_metric
- Regression metric to use for evaluation - i.e. ‘mse’
sourcepub fn add_sample(&mut self, prediction: f32, target: f32)
pub fn add_sample(&mut self, prediction: f32, target: f32)
Add a sample by providing the expected target
value and the prediction
.
sourcepub fn add_samples(&mut self, predictions: &[f32], targets: &[f32])
pub fn add_samples(&mut self, predictions: &[f32], targets: &[f32])
Add a batch of samples.
See add_sample.
sourcepub fn get_predictions(&self, network_out: &mut SharedTensor<f32>) -> Vec<f32>
pub fn get_predictions(&self, network_out: &mut SharedTensor<f32>) -> Vec<f32>
Get the predicted value from the output of a network.
sourcepub fn set_capacity(&mut self, capacity: Option<usize>)
pub fn set_capacity(&mut self, capacity: Option<usize>)
Set the capacity
of the Regression Evaluator
sourcepub fn accuracy(&self) -> impl RegressionLoss
pub fn accuracy(&self) -> impl RegressionLoss
Return the accuracy of the collected predictions.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for RegressionEvaluator
impl Send for RegressionEvaluator
impl Sync for RegressionEvaluator
impl Unpin for RegressionEvaluator
impl UnwindSafe for RegressionEvaluator
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more