sylvainschmitt / SSDM

Stacked Species Distribution Modelling R package
Other
41 stars 17 forks source link

RF default parameters #105

Closed BettyBoyse closed 4 months ago

BettyBoyse commented 3 years ago

Dear Sylvain,

For random forests, when I have previously run the command on an HPC I can see an error "Warning message: In randomForest.default(m, y, ...) : The response has five or fewer unique values. Are you sure you want to do regression?". Is there any way I can request to see the full output within the Rstudio environment? I also want to edit the parameters that I use for random forest which I know I can do using arg1 and arg2 in the modelling() function but I would also like to be able to check these have been used in the function, again through seeing the whole output. Is there a command for this?

Best wishes, Betty

BettyBoyse commented 3 years ago

I have continued to look into this further - I was wondering in particular where in this section of the code under get_model(): if(is.null(rf.args$do.classif)) rf.args$do.classif <- TRUE if(is.null(rf.args$ntree)) rf.args$ntree <- 2500 if(is.null(rf.args$nodesize)) rf.args$nodesize <- 1

Where does $do.classif come from as this is not an argument in the randomForest() from the randomForest package? Will this overwrite type = (the function in the RF package?

lukasbaumbach commented 3 years ago

Hi Betty,

I think you're on the correct track. The source models may be obtained with the internal get_model() function. Also I remember reviewing this piece of code and stumbling over the same question. In the end I think the do.classif argument was hidden somewhere in the lower level functions. Since I couldn't find any reference in the function documentation, it might as well be deprecated by now. Apparently the data type of the response y is used for deriving whether classification or regression is used. We should possibly adapt that for future SSDM versions, thanks for discovering it!

sylvainschmitt commented 4 months ago

Sorry but we do not have a lot of means to maintain the package yet, so no further enhancements are scheduled. If you wish to help this is an open source package and you could suggest pull requests. However if not I won't include this yet, and I'll thus close your issue. Don't hesitate to reopen it if you want to work on it and you want some guidance.