Precision, recall and F1 are metrics for binary classifiers, not regression
models. Can you clarify what you intend to do?

On Tue, Dec 6, 2016, 19:14 Md. Rezaul Karim <rezaul.ka...@insight-centre.org>
wrote:

> 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