greenplum-db / PivotalR-archive

An convenient R tool for manipulating tables in PostgreSQL type databases and a wrapper of Apache MADlib.
https://pivotalsoftware.github.io/gp-r/
125 stars 53 forks source link

generic.cv.R #33

Closed whizzalan closed 9 years ago

whizzalan commented 9 years ago

May I use predict function with other output type? like predict(object, newdata, type="response") How do I do in fucntion generic.cv?

walkingsparrow commented 9 years ago

It is easy. Just do something like:

generic.cv(
    train=..., 
    predict=function(model, newdata) predict(model, newdata, type="response"), 
    metric=...., .....)

generic.cv also works with normal functions besides those from PivotalR. Recently I found generic.cv is very useful and flexible. It is easier to use than those similar functions in package 'caret'. Maybe I will send a pull request to add more examples to its manual.

whizzalan commented 9 years ago

Thanks a lot. If it can use similar in package 'caret', that help me a lot. It mean I can use a lot of algorithm in package 'caret'.