Metrics

snap_ml_spark.Metrics.accuracy(dataWithPredictions)
Parameters:dataWithPredictions – binary predictions computed by the LogisticRegression or SupportVectorMachine predict() function
Returns:accuracy computed based on the binary predictions of a classifier (LogisticRegression, SupportVectorMachines)
Return type:double
snap_ml_spark.Metrics.f1score(dataWithPredictions)
Parameters:dataWithPredictions – binary predictions computed by the LogisticRegression or SupportVectorMachine predict() function
Returns:f1score metric (2*(precision*recall)/(precision+recall)), computed based on the binary predictions of a classifier (LogisticRegression, SupportVectorMachines)
Return type:double
snap_ml_spark.Metrics.logisticLoss(dataWithPredictions)
Parameters:dataWithPredictions – probabilities computed by the LogisticRegression predict_proba() function
Returns:logistic loss computed by the logistic regression predicted probabilities
Return type:double
snap_ml_spark.Metrics.meanSquaredError(dataWithPredictions)
Parameters:dataWithPredictions – linear regression predictions, predicted by the RidgeRegression predict() function
Returns:mean squared error computed based on the provided dataWithPredictions parameter
Return type:double
snap_ml_spark.Metrics.precision(dataWithPredictions)
Parameters:dataWithPredictions – binary predictions computed by the LogisticRegression or SupportVectorMachine predict() function
Returns:precision metric (TP/(TP+FP)), computed based on the binary predictions of a classifier (LogisticRegression, SupportVectorMachines)
Return type:double
snap_ml_spark.Metrics.recall(dataWithPredictions)
Parameters:dataWithPredictions – binary predictions computed by the LogisticRegression or SupportVectorMachine predict() function
Returns:recall metric (TP/(TP+FN)), computed based on the binary predictions of a classifier (LogisticRegression, SupportVectorMachines)
Return type:double