lightning.ranking.KernelPRank

class lightning.ranking.KernelPRank(n_iter=10, shuffle=True, random_state=None, kernel='linear', gamma=None, degree=3, coef0=1, kernel_params=None)[source]

Kernelized online algorithm for learning an ordinal regression model.

Parameters:

n_iter : int

Number of iterations to run.

shuffle : boolean

Whether to shuffle data.

random_state : RandomState or int

The seed of the pseudo random number generator to use.

kernel: “linear” | “poly” | “rbf” | “sigmoid” | “cosine” | “precomputed” :

Kernel. Default: “linear”

degree : int, default=3

Degree for poly kernels. Ignored by other kernels.

gamma : float, optional

Kernel coefficient for rbf and poly kernels. Default: 1/n_features. Ignored by other kernels.

coef0 : float, optional

Independent term in poly and sigmoid kernels. Ignored by other kernels.

kernel_params : mapping of string to any, optional

Parameters (keyword arguments) and values for kernel passed as callable object. Ignored by other kernels.

Attributes:

dual_coef_ : array, shape=[n_samples]

Estimated weights.

thresholds_ : array, shape=[n_classes]

Estimated thresholds.

Methods

fit(X, y) Fit model according to X and y.
get_params([deep]) Get parameters for this estimator.
n_nonzero([percentage])
predict(X)
score(X, y)
set_params(**params) Set the parameters of this estimator.
__init__(n_iter=10, shuffle=True, random_state=None, kernel='linear', gamma=None, degree=3, coef0=1, kernel_params=None)[source]
fit(X, y)[source]

Fit model according to X and y.

Parameters:

X : array-like, shape = [n_samples, n_features]

Training vectors, where n_samples is the number of samples and n_features is the number of features.

y : array-like, shape = [n_samples]

Target values.

Returns:

self : classifier

Returns self.

get_params(deep=True)

Get parameters for this estimator.

Parameters:

deep: boolean, optional :

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:

params : mapping of string to any

Parameter names mapped to their values.

set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Returns:self :