I was trying to produced bagged importance estimates of attributes in earth using the caret package with the following commands: fit2 <- bagEarth(loyalty ~ ., data=model1, B = 10) bagImpGCV <- varImp(fit2,value="gcv") My bootstrap estimates are produced however the second command "varImp" produces the following error: Error in UseMethod("varImp") : no applicable method for "varImp" Not sure what is going on, any advice would be appreciated, Thanks, Joe Retzer [[alternative HTML version deleted]]
On Sat, 2009-05-16 at 08:57 -0700, Joseph Retzer wrote:> I was trying to produced bagged importance estimates of attributes in earth using the caret package with the following commands: > > fit2 <- bagEarth(loyalty ~ ., data=model1, B = 10) > bagImpGCV <- varImp(fit2,value="gcv") > > My bootstrap estimates are produced however the second command "varImp" produces the following error: > > Error in UseMethod("varImp") : no applicable method for "varImp" > > Not sure what is going on, any advice would be appreciated,The example in ?bagEarth works for me with caret and earth loaded> library(earth) > data(trees) > fit1 <- earth(trees[,-3], trees[,3]) > fit2 <- bagEarth(trees[,-3], trees[,3], B = 10) > varImp(fit2)Overall Girth 100.000000 Height 2.387985> packageDescription("earth")$Version[1] "2.3-2"> packageDescription("caret")$Version[1] "4.15" Have you loaded the relevant packages and are they up-to-date? Can you run the example above? If the example works, then you'll probably need to supply data and code that fails for you or contact the package maintainer for expert help. HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>> I was trying to produced bagged importance estimates of attributes in earth using the caret package with the following commands: >> >> ?fit2 <- bagEarth(loyalty ~ ., data=model1, B = 10) >> ?bagImpGCV <- varImp(fit2,value="gcv") >> >> My bootstrap estimates are produced however the second command "varImp" produces the following error: >> >> ?Error in UseMethod("varImp") : no applicable method for "varImp" >> >> Not sure what is going on, any advice would be appreciated,If you want to send me the data (off-list please) or a reproducible example, I will take a look at it. Max
Thanks for your response Gavin. I get the same error as I noted before when running the example from bagEarth. earth and caret are the most recent versions (on the MAC) available on CRAN binaries, 2.0-5 and 3.45 respectively. I see that the CRAN checks for caret lists an error status for version 4.15 r-release-macosx-ix86, which is probably why it is not available in binary form. I also suspect, but am not sure, that this is why varImp fails. Joe --- On Sat, 5/16/09, Gavin Simpson <gavin.simpson@ucl.ac.uk> wrote: From: Gavin Simpson <gavin.simpson@ucl.ac.uk> Subject: Re: [R] bagged importance estimates in earth problem To: "Joseph Retzer" <joe_retzer@yahoo.com> Cc: "R help" <r-help@stat.math.ethz.ch> Date: Saturday, May 16, 2009, 5:19 PM On Sat, 2009-05-16 at 08:57 -0700, Joseph Retzer wrote:> I was trying to produced bagged importance estimates of attributes in earth using the caret package with the following commands: > > fit2 <- bagEarth(loyalty ~ ., data=model1, B = 10) > bagImpGCV <- varImp(fit2,value="gcv") > > My bootstrap estimates are produced however the second command "varImp" produces the following error: > > Error in UseMethod("varImp") : no applicable method for "varImp" > > Not sure what is going on, any advice would be appreciated,The example in ?bagEarth works for me with caret and earth loaded> library(earth) > data(trees) > fit1 <- earth(trees[,-3], trees[,3]) > fit2 <- bagEarth(trees[,-3], trees[,3], B = 10) > varImp(fit2)Overall Girth 100.000000 Height 2.387985> packageDescription("earth")$Version[1] "2.3-2"> packageDescription("caret")$Version[1] "4.15" Have you loaded the relevant packages and are they up-to-date? Can you run the example above? If the example works, then you'll probably need to supply data and code that fails for you or contact the package maintainer for expert help. HTH G -- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% [[alternative HTML version deleted]]
Max, If you read my message closely, you'll see I'm indicating that the check error "may" explain why carat 4.15 _is not available in CRAN binaries_. Because of this (not having the latest version) I suspect varImp is returning the error I detailed. Can you provide information as to why 4.15 is not available? That would be useful. Also, as far a reproducible example is concerned, I noted that the example in bagEarth produces the same error as my original problem (i.e. I can reproduce the error on my machine with that code/data which is also available to others). Again, a more careful read of my original email would have made that clear. Thanks, --- On Mon, 5/18/09, Max Kuhn <mxkuhn@gmail.com> wrote: From: Max Kuhn <mxkuhn@gmail.com> Subject: Re: [R] bagged importance estimates in earth problem To: "Joseph Retzer" <joe_retzer@yahoo.com> Cc: gavin.simpson@ucl.ac.uk, "R help" <r-help@stat.math.ethz.ch> Date: Monday, May 18, 2009, 12:08 PM Joe, On Mon, May 18, 2009 at 11:01 AM, Joseph Retzer <joe_retzer@yahoo.com> wrote:> Thanks for your response Gavin. I get the same error as I noted before when running the example from bagEarth. > > earth and caret are the most recent versions (on the MAC) available on CRAN binaries, 2.0-5 and 3.45 respectively.That is probably your problem. caret is at 4.15 and earth is now at 2.3-2. caret 3.45 was released on 2008-10-17 and many changes have been made to both packages since then.> I see that the CRAN checks for caret lists an error status for version 4.15 r-release-macosx-ix86, which is probably why it is not available in binary form. I also suspect, but am not sure, that this is why varImp fails.No, not at all true. I build it on OS X and R-Forge checks it every night. Please don't extrapolate, especially if you haven't sent a reproducible example. Max [[alternative HTML version deleted]]
Thanks for the info. some notes below: --- On Mon, 5/18/09, Max Kuhn <mxkuhn@gmail.com> wrote: From: Max Kuhn <mxkuhn@gmail.com> Subject: Re: [R] bagged importance estimates in earth problem To: "Joseph Retzer" <joe_retzer@yahoo.com> Cc: gavin.simpson@ucl.ac.uk, "R help" <r-help@stat.math.ethz.ch> Date: Monday, May 18, 2009, 1:03 PM> If you read my message closely, you'll see I'm indicating that the check > error "may" explain why carat 4.15 _is not available in CRAN binaries_. > Because of this (not having the latest version) I suspect varImp is > returning the error I detailed.Ok, but your diagnosis of the issue may have been careless. More speculation than diagnosis, but that's your opinion.> Can you provide information as to why 4.15 is not available? That would be > useful.It is available here: http://cran.r-project.org/src/contrib/Archive/caret Do you mean a binary for OS X? If so, you can look more closely at the "caret Results" link: http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/caret-00check.html you'll see it doesn't build because one of the dependencies (proxy) isn't installed on the test machine. The package homepage listed in the DESCRIPTION file shows the package building on OS X without any errors. There is a OS X binary for the latest version there. I suggest using the OS X disk (or the apple website) to install Xcode and build packages from source. You're almost always better off installing packages in that way. This is very useful information. I did not realize this was best practice and/or necessary generally speaking. Thanks for letting me know. Also, I did look closely at the source code. The latest release is 4.12 which compiled with errors on my machine, not sure why.> Also, as far a reproducible example is concerned, I noted that the example > in bagEarth produces the same error as my original problem (i.e. I can > reproduce the error on my machine with that code/data which is also > available to others). Again, a more careful read of my original email would > have made that clear.It is not reproducible if it works for me and others. It is reproducible using the latest binaries on CRAN, I _think_. However I don't know of anyone other than myself who has tried. Sorry for the frustration, but in your original email you didn't follow the posting guide: email the package author first, provide information about your system or an example that I can try. No need to apologize, I appreciate knowing the source of the problem. I should have contacted you directly however it did not seem to be an issue with the package, my mistake. If you dig around a little, I think the issues would be more clear, especially why there is no OS X binary. Running code with the latest CRAN binaries available and having problems seems to me to justify a brief note asking for help. Also note that I checked the documentation, the CRAN binaries and source files and past listserve messages. I appreciate your information though since it makes clear what the problem actually is. Max [[alternative HTML version deleted]]