Class F1Score
java.lang.Object
smile.deep.metric.F1Score
- All Implemented Interfaces:
Metric
-
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
-
F1Score
public F1Score()Constructor for binary classification. -
F1Score
public F1Score(double threshold) Constructor for binary classification with a custom threshold.- Parameters:
threshold- the threshold for converting model output to binary label.
-
F1Score
Constructor for multi-class classification.- Parameters:
strategy- the averaging strategy (Macro, Micro, or Weighted).
-
-
Method Details
-
name
-
toString
-
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
-
reset
-