Package smile.deep.metric
Class Accuracy
java.lang.Object
smile.deep.metric.Accuracy
- All Implemented Interfaces:
Metric
The accuracy is the proportion of true results (both true positives and
true negatives) in the population.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecompute()Computes the metric value from the metric state, which are updated by previous update() calls.name()Returns the name of metric.voidreset()Resets the metric state variables to their default value.toString()voidUpdates the metric states with input data.
-
Constructor Details
-
Accuracy
public Accuracy()Constructor. -
Accuracy
public Accuracy(double threshold) Constructor.- Parameters:
threshold- The threshold for converting input into binary labels.
-
-
Method Details
-
toString
-
name
Description copied from interface:MetricReturns the name of metric. -
update
Description copied from interface:MetricUpdates the metric states with input data. This is often used when new data needs to be added for metric computation. -
compute
public double compute()Description copied from interface:MetricComputes the metric value from the metric state, which are updated by previous update() calls. The compute frequency can be less than the update frequency. -
reset
public void reset()Description copied from interface:MetricResets the metric state variables to their default value. Usually this is called at the end of every epoch to clean up metric states.
-