package bags
- Alphabetic
- Public
- Protected
Type Members
- case class BaggedClassificationResult(predictions: Seq[PredictionResult[Any]]) extends BaggedResult[Any] with Product with Serializable
- class BaggedModel[+T] extends Model[BaggedResult[T]]
Container holding a parallel sequence of models and the sample counts used to train them
- 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).
- class BaggedTrainingResult[+T] extends TrainingResult
- 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
methodimplements its own randomization)- randBasis
breeze RandBasis to use for generating breeze random numbers
- 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
- 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
- class MultiTaskBaggedModel extends MultiTaskModel
Container holding a parallel sequence of models, each of which predicts on multiple labels.
- 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)
- class MultiTaskBaggedTrainingResult extends MultiTaskTrainingResult
The result of training a bagger on a multi-label combined model.
- 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
- 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
- object BaggedResult
- object Bagger extends Serializable