API reference#

This is the class and function reference of scikit-lr. Each entry links to a page with its full description, and the user guide gives more details on how to use them.

sklr: Settings and information tools#

show_versions()

Print useful debugging information.

sklr.base: Base classes and utility functions#

LabelRankerMixin()

Mixin class for all label rankers in scikit-lr.

PartialLabelRankerMixin()

Mixin class for all partial label rankers in scikit-lr.

is_label_ranker(estimator)

Return True if the given estimator is (probably) a label ranker.

is_partial_label_ranker(estimator)

Return True if the given estimator is (probably) a partial label ranker.

sklr.dummy: Dummy estimators#

See the Dummy estimators section of the user guide for further details.

DummyLabelRanker(*[, strategy, constant, ...])

Label ranker that predicts the same ranking for every sample.

DummyPartialLabelRanker(*[, strategy, constant])

Partial label ranker that predicts the same bucket order for every sample.

sklr.metrics: Metrics#

See the Metrics and scoring: evaluating the rankers section of the user guide for further details.

Scoring interface#

get_scorer(scoring)

Get a scorer of label ranking or partial label ranking from its name.

get_scorer_names()

Get the names of all the scorers of label ranking and partial label ranking.

Label ranking metrics#

kendall_distance(y_true, y_pred, *[, ...])

Compute the Kendall distance between label rankings.

kendall_tau_score(y_true, y_pred, *[, ...])

Compute Kendall's \(\tau\) between label rankings.

spearman_rho_score(y_true, y_pred, *[, ...])

Compute Spearman's \(\rho\) between label rankings.

Partial label ranking metrics#

tau_x_score(y_true, y_pred, *[, sample_weight])

Compute the \(\tau_x\) coefficient between partial label rankings.

sklr.neighbors: Nearest neighbors#

See the Nearest neighbors section of the user guide for further details.

KNeighborsLabelRanker([n_neighbors, model, ...])

Label ranker based on the k-nearest neighbors.

KNeighborsPartialLabelRanker([n_neighbors, ...])

Partial label ranker based on the k-nearest neighbors.

sklr.reduction: Reduction to standard learning problems#

See the Reduction to standard learning problems section of the user guide for further details.

LabelwiseLabelRanker([estimator, loss, n_jobs])

Label ranker that learns the position of each label separately.

PairwiseLabelRanker([estimator, n_jobs])

Label ranker that learns the preference between each pair of labels.

sklr.tree: Decision trees#

See the Decision trees section of the user guide for further details.

DecisionTreeLabelRanker(*[, criterion, ...])

A decision tree label ranker.

DecisionTreePartialLabelRanker(*[, ...])

A decision tree partial label ranker.

sklr.utils: Utilities#

check_ranking(y, *[, allow_ties, ...])

Input validation on the rankings of a target.

type_of_ranking(y)

Determine the type of rankings indicated by the target.