Re: [R] running crossvalidation many times MSE for Lasso regression

2023-11-01 Thread David Winsemius
> On Oct 22, 2023, at 4:01 PM, Bert Gunter wrote: > > No error message shown Please include the error message so that it is > not necessary to rerun your code. This might enable someone to see the > problem without running the code (e.g. downloading packages, etc.) > > -- Bert > > On Sun,

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-24 Thread varin sacha via R-help
Dear Rui, I really thank you a lot for your response and your R code. Best, Sacha Le mardi 24 octobre 2023 à 16:37:56 UTC+2, Rui Barradas a écrit : Às 20:12 de 23/10/2023, varin sacha via R-help escreveu: > Dear R-experts, > > I really thank you all a lot for your responses. So, here

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-24 Thread Rui Barradas
Às 20:12 de 23/10/2023, varin sacha via R-help escreveu: Dear R-experts, I really thank you all a lot for your responses. So, here is the error (and warning) messages at the end of my R code. Many thanks for your help. Error in UseMethod("predict") :   no applicable method for 'predict'

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-23 Thread Jin Li
Hi Ben, Martin and all, The function, glmnetcv, in the spm2 package was developed for the following main reasons: 1. The training and testing samples were generated using a stratified random sampling method instead of a simple random sampling method. By doing this, we hoped that it may be able to

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-23 Thread varin sacha via R-help
Dear R-experts, I really thank you all a lot for your responses. So, here is the error (and warning) messages at the end of my R code. Many thanks for your help. Error in UseMethod("predict") :   no applicable method for 'predict' applied to an object of class "c('matrix', 'array', 'double',

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-23 Thread Ben Bolker
For what it's worth it looks like spm2 is specifically for *spatial* predictive modeling; presumably its version of CV is doing something spatially aware. I agree that glmnet is old and reliable. One might want to use a tidymodels wrapper to create pipelines where you can more easily

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-23 Thread Martin Maechler
> Jin Li > on Mon, 23 Oct 2023 15:42:14 +1100 writes: > If you are interested in other validation methods (e.g., LOO or n-fold) > with more predictive accuracy measures, the function, glmnetcv, in the spm2 > package can be directly used, and some reproducible examples

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-22 Thread Jin Li
If you are interested in other validation methods (e.g., LOO or n-fold) with more predictive accuracy measures, the function, glmnetcv, in the spm2 package can be directly used, and some reproducible examples are also available in ?glmnetcv. On Mon, Oct 23, 2023 at 10:59 AM Duncan Murdoch wrote:

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-22 Thread Duncan Murdoch
On 22/10/2023 7:01 p.m., Bert Gunter wrote: No error message shown Please include the error message so that it is not necessary to rerun your code. This might enable someone to see the problem without running the code (e.g. downloading packages, etc.) And it's not necessarily true that someone

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-22 Thread Bert Gunter
No error message shown Please include the error message so that it is not necessary to rerun your code. This might enable someone to see the problem without running the code (e.g. downloading packages, etc.) -- Bert On Sun, Oct 22, 2023 at 1:36 PM varin sacha via R-help wrote: > > Dear

[R] running crossvalidation many times MSE for Lasso regression

2023-10-22 Thread varin sacha via R-help
Dear R-experts, Here below my R code with an error message. Can somebody help me to fix this error?  Really appreciate your help. Best, # MSE CROSSVALIDATION Lasso regression  library(glmnet)