LinearPredictor

class rlscore.predictor.predictor.LinearPredictor(W, b=0.0)

Bases: object

Represents a linear model for making predictions.

New predictions are made by computing X*W+b.

Parameters:
W : array-like, shape = [n_features] or [n_features, n_labels]

primal coefficients

b : float or array-like with shape = [n_labels]

bias term(s)

Attributes:
W : array-like, shape = [n_features] or [n_features, n_labels]

primal coefficients

b : float or array-like with shape = [n_labels]

bias term(s)

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, n_labels]

predictions