Hi Folks,

I have the following code snippet in Java that can calculate the precision
in Linear Regressor based model.

Dataset<Row> predictions = model.transform(testData);
long count = 0;
 for (Row r : predictions.select("features", "label",
"prediction").collectAsList()) {
               count++;
            }
  System.out.println("precision: " + (double) (count * 100) /
predictions.count());

Now, I would like to compute other evaluation metrics like *Recall
*and *F1-score
*etc. How could I do that?



Regards,
_________________________________
*Md. Rezaul Karim* BSc, MSc
PhD Researcher, INSIGHT Centre for Data Analytics
National University of Ireland, Galway
IDA Business Park, Dangan, Galway, Ireland
Web: http://www.reza-analytics.eu/index.html
<http://139.59.184.114/index.html>

Reply via email to