evaluatePlp: evaluatePlp

View source: R/EvaluatePlp.R

evaluatePlpR Documentation

evaluatePlp

Description

Evaluates the performance of the patient level prediction model

Usage

evaluatePlp(prediction, typeColumn = "evaluationType")

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

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'

Examples

 
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


OHDSI/PatientLevelPrediction documentation built on Feb. 14, 2025, 9:44 a.m.