sqmprank - squared magniture preserving ranking error

rlscore.measure.sqmprank(Y, P)

Squared magnitude preserving ranking error.

A performance measure for ranking problems. Computes the sum of (Y[i]-Y[j]-P[i]+P[j])**2 over all index pairs. normalized by the number of pairs. For query-structured data, one would typically want to compute the error separately for each query, and average.

If 2-dimensional arrays are supplied as arguments, then error is separately computed for each column, after which the errors are averaged.

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

Correct utility values, can be any real numbers

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

Predicted utility values, can be any real numbers.

Returns:
error : float