fscore - F1-score

rlscore.measure.fscore(Y, P)

F1-Score.

A performance measure for binary classification problems. F1 = 2*(Precision*Recall)/(Precision+Recall)

If 2-dimensional arrays are supplied as arguments, then macro-averaged F-score is computed over the columns.

Parameters:
Y : {array-like}, shape = [n_samples] or [n_samples, n_labels]

Correct labels, must belong to set {-1,1}

P : {array-like}, shape = [n_samples] or [n_samples, n_labels]

Predicted labels, can be any real numbers. P[i]>0 is treated as a positive, and P[i]<=0 as a negative class prediction.

Returns:
fscore : float

number between 0 and 1