Packages

c

io.citrine.lolo.bags

BaggedMultiResult

case class BaggedMultiResult(predictions: Seq[PredictionResult[Double]], NibIn: Vector[Vector[Int]], bias: Option[Seq[Double]] = None, rescale: Double = 1.0) extends BaggedResult[Double] with RegressionResult with Product with Serializable

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 BaggedSingleResult, 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

Linear Supertypes
Serializable, Serializable, Product, Equals, RegressionResult, BaggedResult[Double], PredictionResult[Double], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BaggedMultiResult
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. RegressionResult
  7. BaggedResult
  8. PredictionResult
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BaggedMultiResult(predictions: Seq[PredictionResult[Double]], NibIn: Vector[Vector[Int]], bias: Option[Seq[Double]] = None, rescale: Double = 1.0)

    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. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. lazy val Nib: Vector[Vector[Int]]
  5. lazy val NibIJMat: DenseMatrix[Double]
  6. val NibIn: Vector[Vector[Int]]
  7. lazy val NibJMat: DenseMatrix[Double]
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. val bias: Option[Seq[Double]]
  10. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. lazy val expected: Seq[Double]
  13. lazy val expectedMatrix: Seq[Seq[Double]]
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def getBias(): Option[Seq[Double]]

    **EXPERIMENTAL** Get the estimated bias of each prediction, if possible

    **EXPERIMENTAL** Get the estimated bias of each prediction, if possible

    The bias is signed and can be subtracted from the prediction to improve accuracy. See https://en.wikipedia.org/wiki/Bias%E2%80%93variance_tradeoff

    It is unclear if this method will be a stable member of the interface. It should be reviewed before the next formal release.

    Definition Classes
    RegressionResult
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def getExpected(): Seq[Double]

    Return the ensemble average

    Return the ensemble average

    returns

    expected value of each prediction

    Definition Classes
    BaggedMultiResultPredictionResult
  18. def getGradient(): Option[Seq[Vector[Double]]]

    Average the gradients from the models in the ensemble

    Average the gradients from the models in the ensemble

    returns

    the gradient of each prediction as a vector of doubles

    Definition Classes
    BaggedResultPredictionResult
  19. def getImportanceScores(): Option[Seq[Seq[Double]]]

    Get the training row scores for each prediction

    Get the training row scores for each prediction

    returns

    sequence (over predictions) of sequence (over training rows) of importances

    Definition Classes
    BaggedMultiResultPredictionResult
  20. def getInfluenceScores(actuals: Seq[Any]): Option[Seq[Seq[Double]]]

    Return IJ scores

    Return IJ scores

    actuals

    to assess the improvement or damage against

    returns

    training row scores of each prediction

    Definition Classes
    BaggedMultiResultPredictionResult
  21. def getQuantile(quantile: Double, observational: Boolean = true): Option[Seq[Double]]
    Definition Classes
    RegressionResult
  22. def getQuantileMean(quantile: Double): Option[Seq[Double]]

    Get a quantile from the distribution of predicted means, if possible

    Get a quantile from the distribution of predicted means, if possible

    The distribution for which these quantiles are computed should have zero-mean (i.e. no bias)

    quantile

    to get, taken between 0.0 and 1.0 (i.e. not a percentile)

    Definition Classes
    RegressionResult
  23. def getStdDevMean(): Option[Seq[Double]]

    Get the standard deviation of the distribution of predicted mean observations, if possible

    Get the standard deviation of the distribution of predicted mean observations, if possible

    The variation is due to the finite size of the training data, which can be thought of as being sampled from some training data distribution. This statistic is related to the variance in the bias-variance trade-off https://en.wikipedia.org/wiki/Bias%E2%80%93variance_tradeoff

    Definition Classes
    BaggedMultiResultRegressionResult
  24. def getStdDevObs(): Option[Seq[Double]]

    Get the standard deviation of the distribution of predicted observations, if possible

    Get the standard deviation of the distribution of predicted observations, if possible

    Observations of the predicted variable are expected to have a stddev that matches this value. This statistic is related to the https://en.wikipedia.org/wiki/Prediction_interval It does not include estimated bias, even if the regression result contains a bias estimate.

    Definition Classes
    BaggedMultiResultRegressionResult
  25. def getTotalError(): Option[Seq[Double]]

    Get the expected error of the predicted mean observations, if possible

    Get the expected error of the predicted mean observations, if possible

    The mean of a large sample of repeated observations are expected to have a root mean squared error of the mean that matches this value. This statistic is related to the https://en.wikipedia.org/wiki/Confidence_interval This statistic includes the contribution of the estimated bias. E.g., for a normal distribution of predicted means, the total error is sqrt(bias**2 + variance)

    Definition Classes
    RegressionResult
  26. def getTotalErrorObs(): Option[Seq[Double]]

    Get the expected error of the observations, if possible

    Get the expected error of the observations, if possible

    This statistic is related to the https://en.wikipedia.org/wiki/Prediction_interval This statistic includes the contribution of the estimated bias. E.g., for a normal distribution of predicted means, the total error is sqrt(bias**2 + variance).

    Definition Classes
    RegressionResult
  27. def getTotalErrorQuantile(quantile: Double): Option[Seq[Double]]

    Get a quantile from the distribution of predicted means, if possible

    Get a quantile from the distribution of predicted means, if possible

    The distribution for which these quantiles are computed could be biased, e.g. if the bias is estimated but not corrected.

    quantile

    to get, taken between 0.0 and 1.0 (i.e. not a percentile)

    Definition Classes
    RegressionResult
  28. def getTotalErrorQuantileObs(quantile: Double): Option[Seq[Double]]

    Get a quantile from the distribution of predicted observations, if possible

    Get a quantile from the distribution of predicted observations, if possible

    Observations of the predicted variable are inferred to have a distribution with this quantile. This statistic is related to the https://en.wikipedia.org/wiki/Prediction_interval getObsQuantile(0.5) is a central statistic for the estimated bias, if the bias is estimated but not corrected.

    quantile

    to get, taken between 0.0 and 1.0 (i.e. not a percentile)

    Definition Classes
    RegressionResult
  29. def getUncertainty(observational: Boolean): Option[Seq[Any]]

    For the sake of parity, we were using this method

    For the sake of parity, we were using this method

    observational

    whether the uncertainty should account for observational uncertainty

    returns

    uncertainty of each prediction

    Definition Classes
    BaggedMultiResultRegressionResultPredictionResult
  30. def influences(meanPrediction: Vector[Double], actualPrediction: Vector[Double], modelPredictions: Seq[Seq[Double]], NibJ: DenseMatrix[Double], NibIJ: DenseMatrix[Double]): Seq[Vector[Double]]

    Compute the IJ training row scores for a prediction

    Compute the IJ training row scores for a prediction

    meanPrediction

    over the models

    modelPredictions

    prediction of each model

    NibJ

    sampling matrix for the jackknife-after-bootstrap estimate

    NibIJ

    sampling matrix for the infinitesimal jackknife estimate

    returns

    the score of each training row as a vector of doubles

  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. val predictions: Seq[PredictionResult[Double]]
    Definition Classes
    BaggedMultiResultBaggedResult
  36. val rescale: Double
  37. def scores(meanPrediction: Vector[Double], modelPredictions: Seq[Seq[Double]], NibJ: DenseMatrix[Double], NibIJ: DenseMatrix[Double]): Seq[Vector[Double]]

    Compute the IJ training row scores for a prediction

    Compute the IJ training row scores for a prediction

    meanPrediction

    over the models

    modelPredictions

    prediction of each model

    NibJ

    sampling matrix for the jackknife-after-bootstrap estimate

    NibIJ

    sampling matrix for the infinitesimal jackknife estimate

    returns

    the score of each training row as a vector of doubles

  38. lazy val scores: Seq[Vector[Double]]
  39. lazy val stdDevMean: Seq[Double]
  40. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  41. lazy val varObs: Seq[Double]
  42. def variance(meanPrediction: Vector[Double], modelPredictions: Seq[Seq[Double]], NibJ: DenseMatrix[Double], NibIJ: DenseMatrix[Double]): Seq[Double]

    Compute the variance of a prediction as the average of bias corrected IJ and J variance estimates

    Compute the variance of a prediction as the average of bias corrected IJ and J variance estimates

    meanPrediction

    over the models

    modelPredictions

    prediction of each model

    NibJ

    sampling matrix for the jackknife-after-bootstrap estimate

    NibIJ

    sampling matrix for the infinitesimal jackknife estimate

    returns

    the estimated variance

  43. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from RegressionResult

Inherited from BaggedResult[Double]

Inherited from PredictionResult[Double]

Inherited from AnyRef

Inherited from Any

Ungrouped