added trainFraction to the initialization of the splitSettings#34
Open
Volpym wants to merge 1 commit intoOHDSI:mainfrom
Open
added trainFraction to the initialization of the splitSettings#34Volpym wants to merge 1 commit intoOHDSI:mainfrom
Volpym wants to merge 1 commit intoOHDSI:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using ATLAS’ export function for predictions, all generated prediction workflows pass through
BackwardsComp.Rviaexecute()inMain.R.Currently,
splitSettingsfrom predictionAnalysis.json only contains testFraction, butcreateDefaultSplitSettings()is called with this single parameter, causing trainFraction to default to 75%, regardless of the provided testFraction.This results in incorrect and inconsistent dataset splits.
Problem Description
Because trainFraction is not derived from the provided testFraction, the following issues occur:
- testFraction < 25%
- Training set defaults to 75%
- Test set uses the provided fraction (e.g. 10%)
- The remaining subjects (e.g. 15%) are unused
Proposed Fix
This PR calculates trainFraction dynamically as:
trainFraction = 1 - testFractionand passes it explicitly tocreateDefaultSplitSettings().This ensures that the train and test sets are mutually exclusive and fully account for the population, matching the intent of
predictionAnalysis.json.Although this package has not been updated since 2022, it is still actively used by ATLAS exports.
Fixing this behavior prevents incorrect model evaluation and aligns the exported R code with the split configuration defined in ATLAS.