50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

PatientLevelPrediction (version 6.4.0)

evaluatePlp: evaluatePlp

Description

Evaluates the performance of the patient level prediction model

Usage

evaluatePlp(prediction, typeColumn = "evaluationType")

Value

An object of class plpEvaluation containing the following components

  • evaluationStatistics: A data frame containing the evaluation statistics'

  • thresholdSummary: A data frame containing the threshold summary'

  • demographicSummary: A data frame containing the demographic summary'

  • calibrationSummary: A data frame containing the calibration summary'

  • predictionDistribution: A data frame containing the prediction distribution'

Arguments

prediction

The patient level prediction model's prediction

typeColumn

The column name in the prediction object that is used to stratify the evaluation

Details

The function calculates various metrics to measure the performance of the model

Examples

Run this code
  # takes too long to run 
data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n= 1500)
population <- createStudyPopulation(plpData, outcomeId = 3, 
                                    populationSettings = createStudyPopulationSettings())
data <- splitData(plpData, population, splitSettings=createDefaultSplitSetting(splitSeed=42))
data$Train$covariateData <- preprocessData(data$Train$covariateData, 
                                           createPreprocessSettings())
path <- file.path(tempdir(), "plp")
model <- fitPlp(data$Train, modelSettings=setLassoLogisticRegression(seed=42),
                analysisId=1, analysisPath = path)
evaluatePlp(model$prediction) # Train and CV metrics

Run the code above in your browser using DataLab