Open arani11 opened 5 months ago
The screenshot is actually missing the important bits. This is how it looks for me:
Can you confirm there is no row at the bottom (In a section with subheading Table
like in my picture with a blue button to the right called Actions
?
Hi, yes I can confirm that there is no row at the bottom. We have tried running it again today and had the same problem: the app was empty. Please find screenshot attached. Shiny screenshot.docx Are you able to help with this please? Many thanks @egillax @jreps
Hi @arani11,
This sounds like a java error we used to get when running shiny apps on ubuntu. How are you running the shiny app? I can see you are opening it in Windows, but maybe there's a server somewhere running it? Are you maybe running rstudio server? Do you get the same error if you hit the "Open in browser" button at the top below the URL ?
Hi @egillax
Thanks for your reply.
I am running it on an Rstudio server. Yes I get the same error when I open in browser too.
Are you able to help please?
Thanks
The fix for the java error was putting the following in your .Rprofile
file:
options(java.parameters = "-Xss3m")
If you don't know how to edit that file you can use usethis::edit_r_profile()
to open it.
You need to restart you rsession for this to take effect. Let me know if this works. I'm not sure if this works on Rstudio server but hopefully it does.
Thanks for your reply @egillax. I tried doing the above and this time had the following error message: Github shiny error.docx
It says an error report errorReportSql.txt
was created. Could you share that file ?
@egillax please find attached.
The error indicates the time-at-risk
related fields are empty. These are defined in your populationSettings
. (riskWindowStart
, riskWindowEnd
, startAnchor
and endAnchor
.). They all have default values so should never be empty even if you don't specify them explicitly. Either something went wrong with creating that object or possibly saving/loading it before uploading to database.
How are you defining your modelDesign
or study population ?
Please see screenshot - does this help to answer your question? Thanks
Yes that shows it's defined correctly. The output directory of your model development should look something like this:
plpResult/ ├── model │ ├── attributes.json │ ├── covariateImportance.csv │ ├── modelDesign.json │ ├── model.json │ ├── preprocessing.json │ └── trainDetails.json └── runPlp.rds
In the modelDesign.json
the populationSettings should be stored like so:
Can you find the file and check it's the same for you?
populationSettings <- createStudyPopulationSettings( firstExposureOnly = TRUE, removeSubjectsWithPriorOutcome = TRUE, priorOutcomeLookback = 99999, riskWindowStart = 1, riskWindowEnd = 1825, startAnchor = 'cohort start', endAnchor = 'cohort start', minTimeAtRisk = 1, requireTimeAtRisk = TRUE, includeAllOutcomes = TRUE )
splitSettings <- createDefaultSplitSetting( testFraction = 0.1, trainFraction = 0.9, type = 'subject', nfold = 5, splitSeed = 11061992 )
sampleSettings <- createSampleSettings(type = "none")
featureEngineeringSettings <- createFeatureEngineeringSettings()
preprocessSettings <- createPreprocessSettings( minFraction = 0.1, normalize = T, removeRedundancy = T )
if(isTRUE(run_individual_lr)){ lrModel <- setLassoLogisticRegression()
lrResults <- runPlp( plpData = plpData, outcomeId = workingOutcomeCohortid, analysisId = db_name, analysisName = workingOutputFolder, populationSettings = populationSettings, splitSettings = splitSettings, sampleSettings = sampleSettings, featureEngineeringSettings = featureEngineeringSettings, preprocessSettings = preprocessSettings, modelSettings = lrModel, logSettings = createLogSettings(), executeSettings = createExecuteSettings( runSplitData = T, runSampleData = T, runfeatureEngineering = T, runPreprocessData = T, runModelDevelopment = T, runCovariateSummary = T ), saveDirectory = here::here("results", analysis_name))
saveRDS(lrResults, "results/workingOutputFolder/lrResults.rds") }
if(isTRUE(run_individual_xgb)){
lrXGB <- setGradientBoostingMachine( ntrees = c(10, 100), nthread = 20, earlyStopRound = 25, maxDepth = c(4, 5), minChildWeight = 1, learnRate = c(0.05, 0.1, 0.3), scalePosWeight = 1, lambda = 1, alpha = 0, seed = sample(1e+07, 1) )
lrXGBResults <- runPlp( plpData = plpData, outcomeId = workingOutcomeCohortid, analysisId = db_name, analysisName = workingOutputFolder, populationSettings = populationSettings, splitSettings = splitSettings, sampleSettings = sampleSettings, featureEngineeringSettings = featureEngineeringSettings, preprocessSettings = preprocessSettings, modelSettings = lrXGB, logSettings = createLogSettings(), executeSettings = createExecuteSettings( runSplitData = T, runSampleData = T, runfeatureEngineering = T, runPreprocessData = T, runModelDevelopment = T, runCovariateSummary = T ), saveDirectory = here::here("results", analysis_name)) saveRDS(lrResults, "results/workingOutputFolder/lrResults.rds") }
@egillax please see above - is this the correct file? thanks
Not exactly. But if you execute the following you should get the info:
lrResults <- readRDS("results/workingOutputFolder/lrResults.rds")
modelDesign <- lrResults$model$modelDesign
modelDesign$populationSettings
That should print the info.
I assume after you developed the model you call viewPlp
straight on the result object like viewPlp(lrResult)
? Could you paste in the whole log after you do that, or up until the error happens. It looks like this for me:
PatientLevelPrediction::viewPlp(lrResults)
Connecting using SQLite driver
All or some PLP result tables do not exist, tables being recreated
Deleting existing tables
Creating PLP results tables
|======================================================================| 100%
Executing SQL took 0.0238 secs
PLP result migrration being applied
Migrating data set
Migrator using SQL files in PatientLevelPrediction
Connecting using SQLite driver
Creating migrations table
|======================================================================| 100%
Executing SQL took 0.00358 secs
Migrations table created
Executing migration: Migration_1-store_version.sql
|======================================================================| 100%
Executing SQL took 0.00442 secs
Saving migration: Migration_1-store_version.sql
|======================================================================| 100%
Executing SQL took 0.00378 secs
Migration complete Migration_1-store_version.sql
Closing database connection
Updating version number
Connecting using SQLite driver
|======================================================================| 100%
Executing SQL took 0.00427 secs
Connecting using SQLite driver
Adding TAR
|======================================================================| 100%
Executing SQL took 0.00392 secs
tarId: 1
Please see below @egillax
lrResults <- readRDS("results/workingOutputFolder/lrResults.rds") modelDesign <- lrResults$model$modelDesign modelDesign$populationSettings $binary [1] TRUE
$includeAllOutcomes [1] TRUE
$firstExposureOnly [1] TRUE
$washoutPeriod [1] 0
$removeSubjectsWithPriorOutcome [1] TRUE
$priorOutcomeLookback [1] 99999
$requireTimeAtRisk [1] TRUE
$minTimeAtRisk [1] 1
$riskWindowStart [1] 1
$startAnchor [1] "cohort start"
$riskWindowEnd [1] 1825
$endAnchor [1] "cohort start"
$restrictTarToCohortEnd [1] FALSE
attr(,"class") [1] "populationSettings"
Please see above (and also attached, in case that is easier to read for you) for the second part of your question. Thanks github shiny error 2.docx
Hi @arani11,
You seem to be getting a different error now? How are you generating the es
object?
Hi @egillax Sorry I don't understand your question. Would it be better to jump on a quick Teams call to resolve this? Thanks
Sure if you send me an invite to e.fridgeirsson@erasmusmc.nl I can hop on a quick call
We ran the shiny app for our PLP prediction model, but after running it, the app was empty - it did not contain any of the data. Are you able to help with this please? Screenshot attached below. Thank you.