rankeval.scoring package¶
The rankeval.scoring
module includes utilities to score a model on a given dataset.

class
rankeval.scoring.
Scorer
(model, dataset)[source]¶ Bases:
object
Class for efficient scoring of an ensemblebased model composed of binary regression trees on a given dataset.
This class can be used for simple or detailed scoring, depending on the mode selected at scoring time. The document scores are cached as to avoid useless rescoring. Thus, calling multiple times the score method does not involve the scoring activity to be executed again, except for a detailed scoring following a basic scoring. Indeed in this situation the scoring has to be repeated as to analyze in depth the scoring behaviour.
 model: RTEnsemble
 The model to use for scoring
 dataset: Dataset
 The dataset to use for scoring
 model : RTEnsemble
 The model to use for scoring
 dataset : Dataset
 The dataset to use for scoring
 y_pred : numpy array of float
 The predicted scores produced by the given model for each sample of the given dataset X
 partial_y_pred : numpy 2darray of float
 The predicted score of each tree of the model for each dataset instance

get_partial_predicted_scores
()[source]¶ Provide an accessor to the partial scores produced by the given model for each sample of the given dataset X. Each partial score reflects the score produced by a single tree of the ensemble model to a single dataset instance. Thus, the returned numpy matrix has a shape of (n_instances, n_trees). The partial scores does not take into account the tree weights, thus for producing the final score is needed to multiply each row for the tree weight vector.
 scores : numpy 2darray of float
 The predicted score of each tree of the model for each dataset instance
Submodules¶
rankeval.scoring.scorer module¶
Class for efficient scoring of an ensemblebased model composed of binary regression trees on a given dataset.

class
rankeval.scoring.scorer.
Scorer
(model, dataset)[source]¶ Bases:
object
Class for efficient scoring of an ensemblebased model composed of binary regression trees on a given dataset.
This class can be used for simple or detailed scoring, depending on the mode selected at scoring time. The document scores are cached as to avoid useless rescoring. Thus, calling multiple times the score method does not involve the scoring activity to be executed again, except for a detailed scoring following a basic scoring. Indeed in this situation the scoring has to be repeated as to analyze in depth the scoring behaviour.
 model: RTEnsemble
 The model to use for scoring
 dataset: Dataset
 The dataset to use for scoring
 model : RTEnsemble
 The model to use for scoring
 dataset : Dataset
 The dataset to use for scoring
 y_pred : numpy array of float
 The predicted scores produced by the given model for each sample of the given dataset X
 partial_y_pred : numpy 2darray of float
 The predicted score of each tree of the model for each dataset instance

get_partial_predicted_scores
()[source]¶ Provide an accessor to the partial scores produced by the given model for each sample of the given dataset X. Each partial score reflects the score produced by a single tree of the ensemble model to a single dataset instance. Thus, the returned numpy matrix has a shape of (n_instances, n_trees). The partial scores does not take into account the tree weights, thus for producing the final score is needed to multiply each row for the tree weight vector.
 scores : numpy 2darray of float
 The predicted score of each tree of the model for each dataset instance