topepo / caret

caret (Classification And Regression Training) R package that contains misc functions for training and plotting classification and regression models
http://topepo.github.io/caret/index.html
1.61k stars 634 forks source link

hdrda from sparsediscrim does not run #1331

Open muequadrat opened 1 year ago

muequadrat commented 1 year ago

If you are making a feature request or starting a discussion, you can ignore everything below and go wild =D However, please request new models using the project page.

If you are filing a bug, make sure these boxes are checked before submitting your issue— thank you!

Minimal, reproducible example:

Minimal dataset and code:

library(caret)
set.seed(1)
dat <- twoClassSim(100)
X <- dat[,1:5]
y <- dat[["Class"]]

#### Minimal dataset:
model_class <- train(
  X, y, 
  metric='ROC',
  trControl=trainControl(
    method="cv", 
    number=5,
    classProbs=TRUE, 
    summaryFunction=twoClassSummary,
    savePredictions="final"), method = "hdrda"
)
print(model_class)

I get an error message very quickly, I imagine that this has to do with the fact that the corresponding function in sparsediscrim is now called rda_high_dim and no longer hdrda


Something is wrong; all the ROC metric values are missing:
      ROC           Sens          Spec    
 Min.   : NA   Min.   : NA   Min.   : NA  
 1st Qu.: NA   1st Qu.: NA   1st Qu.: NA  
 Median : NA   Median : NA   Median : NA  
 Mean   :NaN   Mean   :NaN   Mean   :NaN  
 3rd Qu.: NA   3rd Qu.: NA   3rd Qu.: NA  
 Max.   : NA   Max.   : NA   Max.   : NA  
 NA's   :18    NA's   :18    NA's   :18   
Fehler: Stopping
Zusätzlich: Es gab 50 oder mehr Warnungen (Anzeige der ersten 50 mit warnings())
> head(warnings())
Warnmeldungen:
1: model fit failed for Fold1: gamma=0.0, lambda=0.0, shrinkage_type=ridge Error : 'hdrda' is not an exported object from 'namespace:sparsediscrim'

2: model fit failed for Fold1: gamma=0.5, lambda=0.0, shrinkage_type=ridge Error : 'hdrda' is not an exported object from 'namespace:sparsediscrim'

3: model fit failed for Fold1: gamma=1.0, lambda=0.0, shrinkage_type=ridge Error : 'hdrda' is not an exported object from 'namespace:sparsediscrim'

4: model fit failed for Fold1: gamma=0.0, lambda=0.5, shrinkage_type=ridge Error : 'hdrda' is not an exported object from 'namespace:sparsediscrim'

5: model fit failed for Fold1: gamma=0.5, lambda=0.5, shrinkage_type=ridge Error : 'hdrda' is not an exported object from 'namespace:sparsediscrim'

6: model fit failed for Fold1: gamma=1.0, lambda=0.5, shrinkage_type=ridge Error : 'hdrda' is not an exported object from 'namespace:sparsediscrim'
### Session Info:
> sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.utf8  LC_CTYPE=German_Germany.utf8    LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C                    LC_TIME=German_Germany.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] caret_6.0-93    lattice_0.20-45 ggplot2_3.4.1  

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.0     purrr_1.0.1          reshape2_1.4.4       listenv_0.9.0        splines_4.2.2        colorspace_2.1-0     vctrs_0.5.2          generics_0.1.3      
 [9] stats4_4.2.2         utf8_1.2.3           survival_3.4-0       prodlim_2019.11.13   rlang_1.0.6          ModelMetrics_1.2.2.2 pillar_1.8.1         glue_1.6.2          
[17] withr_2.5.0          foreach_1.5.2        lifecycle_1.0.3      plyr_1.8.8           lava_1.7.2.1         stringr_1.5.0        timeDate_4022.108    munsell_0.5.0       
[25] gtable_0.3.1         bdsmatrix_1.3-6      mvtnorm_1.1-3        future_1.31.0        recipes_1.0.5        codetools_0.2-18     sparsediscrim_0.3.0  parallel_4.2.2      
[33] class_7.3-20         fansi_1.0.4          Rcpp_1.0.10          corpcor_1.6.10       scales_1.2.1         ipred_0.9-13         parallelly_1.34.0    digest_0.6.31       
[41] stringi_1.7.12       dplyr_1.1.0          grid_4.2.2           hardhat_1.2.0        cli_3.6.0            tools_4.2.2          magrittr_2.0.3       tibble_3.1.8        
[49] randomForest_4.7-1.1 future.apply_1.10.0  pkgconfig_2.0.3      MASS_7.3-58.1        Matrix_1.5-1         data.table_1.14.8    pROC_1.18.0          lubridate_1.9.2     
[57] timechange_0.2.0     gower_1.0.1          iterators_1.0.14     R6_2.5.1             globals_0.16.2       rpart_4.1.19         nnet_7.3-18          nlme_3.1-160        
[65] compiler_4.2.2