This function trains the OASIS model from a data.frame produced by an element from the output of the function oasis_train_dataframe

oasis_training(..., formula = GoldStandard ~ FLAIR_10 * FLAIR + FLAIR_20 *
  FLAIR + PD_10 * PD + PD_20 * PD + T2_10 * T2 + T2_20 * T2 + T1_10 * T1 + T1_20
  * T1, remove_preproc = FALSE)

Arguments

...

data.frame(s) produced by the oasis_train_dataframe function

formula

formula to be fit by glm model

remove_preproc

a logical stating if oasis_dataframe needs to be extracted from the list of objects. Will call list$oasis_dataframe

Value

Returns a glm object containing the trained OASIS coefficients to be used by the function oasis_predict.

Examples

df = oasis::example_oasis_df
df$GoldStandard = df$GOLD_Lesions
oasis_training(df)
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> 
#> Call:  glm(formula = formula, family = binomial, data = train_vectors_multi)
#> 
#> Coefficients:
#>    (Intercept)        FLAIR_10           FLAIR        FLAIR_20           PD_10  
#>        -362.47          801.00           92.67          -60.34          778.51  
#>             PD           PD_20           T2_10              T2           T2_20  
#>          81.85         -927.57         -737.81          228.65         -722.48  
#>          T1_10              T1           T1_20  FLAIR_10:FLAIR  FLAIR:FLAIR_20  
#>          53.35          194.49         -264.31          180.83         -924.15  
#>       PD_10:PD        PD:PD_20        T2_10:T2        T2:T2_20        T1_10:T1  
#>       -2155.77         3324.50         1136.34        -1330.78         -602.51  
#>       T1:T1_20  
#>        1386.51  
#> 
#> Degrees of Freedom: 99 Total (i.e. Null);  79 Residual
#> Null Deviance:	    138.6 
#> Residual Deviance: 4.88e-08 	AIC: 42