lightning.ranking.PRank¶
- class lightning.ranking.PRank(n_iter=10, shuffle=True, random_state=None)[source]¶
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.
- coef_¶
Estimated weights.
- Type
array, shape=[n_features]
- thresholds_¶
Estimated thresholds.
- Type
array, shape=[n_classes]
References
Pranking with Ranking Koby Crammer, Yoram Singer NIPS 2001
- property classes_¶
- 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 – Returns self.
- Return type
classifier
- get_params(deep=True)¶
Get parameters for this estimator.
- Parameters
deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns
params – Parameter names mapped to their values.
- Return type
dict
- n_nonzero(percentage=False)¶
- score(X, y)¶
- set_params(**params)¶
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline
). The latter have parameters of the form<component>__<parameter>
so that it’s possible to update each component of a nested object.- Parameters
**params (dict) – Estimator parameters.
- Returns
self – Estimator instance.
- Return type
estimator instance