Package com.jml.core
Class Metrics
java.lang.Object
com.jml.core.Metrics
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
accuracy(double[][] predictions, double[][] targets)
Computes the accuracy between predictions and the true targets.static double
accuracy(double[] predictions, double[] targets)
Computes the accuracy between predictions and the true targets.static double
accuracy(int[] predictions, int[] targets)
Computes the accuracy between predictions and the true targets.
-
Method Details
-
accuracy
public static double accuracy(double[][] predictions, double[][] targets)Computes the accuracy between predictions and the true targets.- Parameters:
predictions
- Predictions of the true targets.targets
- True targets.- Returns:
- The percentage of correct predictions
-
accuracy
public static double accuracy(double[] predictions, double[] targets)Computes the accuracy between predictions and the true targets.- Parameters:
predictions
- Predictions of the true targets.targets
- True targets.- Returns:
- The percentage of correct predictions
-
accuracy
public static double accuracy(int[] predictions, int[] targets)Computes the accuracy between predictions and the true targets.- Parameters:
predictions
- Predictions of the true targets.targets
- True targets.- Returns:
- The percentage of correct predictions
-