KernelPredictor

class rlscore.predictor.predictor.KernelPredictor(A, kernel)

Bases: object

Represents a dual model for making predictions.

New predictions are made by computing K*A, where K is the kernel matrix between test and training examples, and A contains the dual coefficients.

Parameters:
A : array-like, shape = [n_samples] or [n_samples, n_labels]

dual coefficients

kernel : kernel object

kernel object, initialized with the basis vectors and kernel parameters

Attributes:
A : array-like, shape = [n_samples] or [n_samples, n_labels]

dual coefficients

kernel : kernel object

kernel object, initialized with the basis vectors and kernel parameters

predict(X)

Computes predictions for test examples.

Parameters:
X : {array-like, sparse matrix}, shape = [n_samples, n_features]

test data matrix

Returns:
P : array, shape = [n_samples] or [n_samples, n_labels]

predictions