Packages

package bags

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. case class BaggedClassificationResult(predictions: Seq[PredictionResult[Any]]) extends BaggedResult[Any] with Product with Serializable
  2. class BaggedModel[+T] extends Model[BaggedResult[T]]

    Container holding a parallel sequence of models and the sample counts used to train them

  3. trait BaggedResult[+T] extends PredictionResult[T]

    Interface defining the return value of a BaggedModel

    Interface defining the return value of a BaggedModel

    This allows the implementation to depend on the number of simultaneous predictions, which has performance implications. For background on the uncertainty calculation, see Wager, S.; Hastie, T and Efron, B. Confidence Intervals for Random Forests: The Jackknife and Infinitesimal Jackknife. Journal of Machine Learning Research 15 (2014).

  4. class BaggedTrainingResult[+T] extends TrainingResult
  5. case class Bagger(method: Learner, numBags: Int = -1, useJackknife: Boolean = true, biasLearner: Option[Learner] = None, uncertaintyCalibration: Boolean = true, disableBootstrap: Boolean = false, randBasis: RandBasis = Rand) extends Learner with Product with Serializable

    A bagger creates an ensemble of models by training the learner on random samples of the training data

    A bagger creates an ensemble of models by training the learner on random samples of the training data

    Created by maxhutch on 11/14/16.

    method

    learner to train each model in the ensemble

    numBags

    number of base models to aggregate (default of -1 sets the number of models to the number of training rows)

    useJackknife

    whether to enable jackknife uncertainty estimate

    biasLearner

    learner to use for estimating bias

    uncertaintyCalibration

    whether to enable empirical uncertainty calibration

    disableBootstrap

    whether to disable bootstrap (useful when method implements its own randomization)

    randBasis

    breeze RandBasis to use for generating breeze random numbers

  6. case class BaggerHelper(models: ParSeq[Model[PredictionResult[Any]]], trainingData: Seq[(Vector[Any], Any)], Nib: Vector[Vector[Int]], useJackknife: Boolean, uncertaintyCalibration: Boolean) extends Product with Serializable

    Helper class to subsume shared functionality of Bagger and MultiTaskBagger.

    Helper class to subsume shared functionality of Bagger and MultiTaskBagger.

    models

    collection of trained models

    trainingData

    on which models were trained

    Nib

    vector (over models) of vectors (over training data) of the number of repeats in each model's bag

    useJackknife

    whether to use jackknife for uncertainty quantification

    uncertaintyCalibration

    whether to apply empirical uncertainty calibration

    Attributes
    protected
  7. case class MultiPredictionBaggedResult(predictions: Seq[PredictionResult[Double]], NibIn: Vector[Vector[Int]], bias: Option[Seq[Double]] = None, rescale: Double = 1.0, disableBootstrap: Boolean = false) extends BaggedResult[Double] with RegressionResult with Product with Serializable

    Container with model-wise predictions and logic to compute variances and training row scores

    Container with model-wise predictions and logic to compute variances and training row scores

    These calculations are implemented using matrix arithmetic to make them more performant when the number of predictions is large. This obfuscates the algorithm significantly, however. To see what is being computed, look at SinglePredictionBaggedResult, which is more clear. These two implementations are tested for consistency.

    predictions

    for each constituent model

    NibIn

    the sample matrix as (N_models x N_training)

    bias

    model to use for estimating bias

  8. class MultiTaskBaggedModel extends MultiTaskModel

    Container holding a parallel sequence of models, each of which predicts on multiple labels.

  9. case class MultiTaskBaggedResult(baggedPredictions: Seq[BaggedResult[Any]], realLabels: Seq[Boolean], NibIn: Vector[Vector[Int]]) extends BaggedResult[Seq[Any]] with MultiTaskModelPredictionResult with Product with Serializable

    Container with model-wise predictions for each label and the machinery to compute (co)variance.

    Container with model-wise predictions for each label and the machinery to compute (co)variance.

    baggedPredictions

    bagged prediction results for each label

    realLabels

    a boolean sequence indicating which labels are real-valued

    NibIn

    the sampling matrix as (# bags) x (# training)

  10. class MultiTaskBaggedTrainingResult extends MultiTaskTrainingResult

    The result of training a bagger on a multi-label combined model.

  11. case class MultiTaskBagger(method: MultiTaskLearner, numBags: Int = -1, useJackknife: Boolean = true, biasLearner: Option[Learner] = None, uncertaintyCalibration: Boolean = true, randBasis: RandBasis = Rand) extends MultiTaskLearner with Product with Serializable

    Create an ensemble of multi-task models

    Create an ensemble of multi-task models

    method

    learner to train each model in the ensemble

    numBags

    number of models in the ensemble

    useJackknife

    whether to enable jackknife uncertainty estimate

    biasLearner

    learner to use for estimating bias

    uncertaintyCalibration

    whether to empirically recalibrate the predicted uncertainties

    randBasis

    breeze RandBasis to use for generating breeze random numbers

  12. case class SinglePredictionBaggedResult(predictions: Seq[PredictionResult[Double]], NibIn: Vector[Vector[Int]], bias: Option[Double] = None, rescale: Double = 1.0, disableBootstrap: Boolean = false) extends BaggedResult[Double] with RegressionResult with Product with Serializable

    Container with model-wise predictions at a single input point.

    Container with model-wise predictions at a single input point. Assuming a single input allows for performance optimizations and more readable code. See MultiPredictionBaggedResult for a generic implementation.

    predictions

    for each constituent model

    NibIn

    the sample matrix as (N_models x N_training)

    bias

    model to use for estimating bias

Value Members

  1. object BaggedResult
  2. object Bagger extends Serializable

Ungrouped