LinearPairwisePredictor¶
-
class
rlscore.predictor.pairwise_predictor.
LinearPairwisePredictor
(W, inds_X1training=None, inds_X2training=None, weights=None)¶ Bases:
object
Linear pairwise predictor.
Parameters: - W : {array-like}, shape = [n_features1, n_features2]
primal coefficients for the Kronecker product features
Attributes: - W : {array-like}, shape = [n_features1, n_features2]
primal coefficients for the Kronecker product features
-
predict
(X1pred, X2pred, inds_X1pred=None, inds_X2pred=None, pko=None)¶ Computes predictions for test examples.
Parameters: - X1pred : array-like, shape = [n_samples1, n_features1]
the first part of the test data matrix
- X2pred : array-like, shape = [n_samples2, n_features2]
the second part of the test data matrix
- inds_X1pred : list of indices, shape = [n_test_pairs], optional
maps rows of X1pred to vector of predictions P. If not supplied, predictions are computed for all possible test pair combinations.
- inds_X2pred : list of indices, shape = [n_test_pairs], optional
maps rows of X2pred to vector of predictions P. If not supplied, predictions are computed for all possible test pair combinations.
Returns: - P : array, shape = [n_test_pairs] or [n_samples1*n_samples2]
predictions, either ordered according to the supplied row indices, or if no such are supplied by default prediction for (X1[i], X2[j]) maps to P[i + j*n_samples1].