Closed washcycle closed 7 years ago
R/caretList.R:263:24: style: Only use double-quotes.
if(class(modelList)!='list'){
^~~~~~
R/caretList.R:267:23: style: Only use double-quotes.
class(modelList) <- 'caretList'
^~~~~~~~~~~
I don't like is.caretList changing the object's type.
I'd prefer a new as.caretList function.
Sent from my iPhone
On Sep 7, 2016, at 11:37 PM, Matt notifications@github.com wrote:
Added ability to convert list of caret models into a caretList object.
You can view, comment on, or merge this pull request online at:
https://github.com/zachmayer/caretEnsemble/pull/211
Commit Summary
Added as.caretList function File Changes
M R/caretList.R (12) Patch Links:
https://github.com/zachmayer/caretEnsemble/pull/211.patch https://github.com/zachmayer/caretEnsemble/pull/211.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Hmmm this is an as.caretList
function? Did I misunderstand your comment? The reason I wanted this was because I trained several models and one of them didn't work out. I wanted to drop it.
I could subset the models by models[1:3]
dropping the reaming model(s). However, to ensemble them they needed to be of type caretList. I looked at how the caretList was created which led me to write this function which worked great.
I think we could write a [
method for caretList
that doesn't drop the class on subsetting.
I like that idea, and I saw where I goofed btw. That new function was suppose to be an as.caret
function)
2 more notes:
as
is an S4
method, so we should write an S4 method here. I dunno how to do that, but I'll do some research.Just so we are on the same page, as
is an S4 method, but as.'classname'
is an S3 method. getS3method('as.data.frame', 'data.frame')
I'll probably go and stop being lazy and clone and make these changes and add a test(s) this weekend. I'll make a new request once i'm done and close/references these ones out. I'll take a stab at adding the [
method too.
That would be perfect, thanks!
Sent from my iPhone
On Sep 8, 2016, at 7:11 PM, Matt notifications@github.com wrote:
As is an S4 method, but as.classname is an S3 method. getS3method('as.data.frame', 'data.frame') I'll probably go and stop being lazy and clone and make these changes and add a test(s) this weekend. I'll make a new request once i'm done and close/references these ones out.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Added ability to convert list of caret models into a caretList object.