Skip to contents

Calculates the prediction distribution

Usage

getPredictionDistribution(
  prediction,
  predictionType = "binary",
  typeColumn = "evaluation"
)

Arguments

prediction

A prediction object

predictionType

The type of prediction (binary or survival)

typeColumn

A column that is used to stratify the results

Value

The 0.00, 0.1, 0.25, 0.5, 0.75, 0.9, 1.00 quantile pf the prediction, the mean and standard deviation per class

Details

Calculates the quantiles from a predition object

Examples

prediction <- data.frame(rowId = 1:100, 
                         outcomeCount = stats::rbinom(1:100, 1, prob=0.5), 
                         value = runif(100), 
                         evaluation = rep("Train", 100))
getPredictionDistribution(prediction)
#>   class PersonCount averagePredictedProbability StDevPredictedProbability
#> 1     0          48                   0.5471241                 0.3068856
#> 2     1          52                   0.4971234                 0.2977646
#>   MinPredictedProbability P05PredictedProbability P25PredictedProbability
#> 1            0.0066707600              0.02998843               0.2367639
#> 2            0.0004546265              0.03746040               0.2364466
#>   MedianPredictedProbability P75PredictedProbability P95PredictedProbability
#> 1                  0.6408440               0.8202945               0.9098819
#> 2                  0.5059827               0.7649538               0.9523072
#>   MaxPredictedProbability evaluation
#> 1               0.9710433      Train
#> 2               0.9879653      Train