rankeval.scoring package — RankEval 0.00 documentation

# rankeval.scoring package

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

class `rankeval.scoring.` `Scorer`(model, dataset)

  Bases: `object`

  Class for efficient scoring of an ensemble-based 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 re-scoring. 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 2d-array of float
    The predicted score of each tree of the model for each dataset instance
  `get_partial_predicted_scores`()

    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 2d-array of float
      The predicted score of each tree of the model for each dataset instance
  `get_predicted_leaves`()

    Provide an accessor to the leaves that identify the exit nodes of each sample of the given dataset X using the given model.

    Each leaf value reflects the output node of 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).

    scores : numpy 2d-array of int
      The leaves predicted by each tree of the model on scoring each dataset instance.
  `get_predicted_scores`()

    Provide an accessor to the predicted scores produced by the given model for each sample of the given dataset X

    scores : numpy array of float
      The predicted scores produced by the given model for each sample of the given dataset X
  `score`(detailed)
    detailed : bool
      True if the class has to performs a detailed scoring, false otherwise
    y : numpy array of float
      the predicted scores produced by the given model for each sample of the given dataset X
    self.y : array of float
      The predicted scores of each dataset instance

## Submodules

## rankeval.scoring.scorer module

Class for efficient scoring of an ensemble-based model composed of binary regression trees on a given dataset.

class `rankeval.scoring.scorer.` `Scorer`(model, dataset)

  Bases: `object`

  Class for efficient scoring of an ensemble-based 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 re-scoring. 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 2d-array of float
    The predicted score of each tree of the model for each dataset instance
  `get_partial_predicted_scores`()

    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 2d-array of float
      The predicted score of each tree of the model for each dataset instance
  `get_predicted_leaves`()

    Provide an accessor to the leaves that identify the exit nodes of each sample of the given dataset X using the given model.

    Each leaf value reflects the output node of 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).

    scores : numpy 2d-array of int
      The leaves predicted by each tree of the model on scoring each dataset instance.
  `get_predicted_scores`()

    Provide an accessor to the predicted scores produced by the given model for each sample of the given dataset X

    scores : numpy array of float
      The predicted scores produced by the given model for each sample of the given dataset X
  `score`(detailed)
    detailed : bool
      True if the class has to performs a detailed scoring, false otherwise
    y : numpy array of float
      the predicted scores produced by the given model for each sample of the given dataset X
    self.y : array of float
      The predicted scores of each dataset instance