Re: [R] Choosing glmnet lambda values via caret

2012-02-10 Thread Yang Zhang
t lets the > user manually specify the tuning parameters after the call to train(). > > On Thu, Feb 9, 2012 at 7:00 PM, Yang Zhang wrote: >> Usually when using raw glmnet I let the implementation choose the >> lambdas.  However when training via caret::train the lambda values

Re: [R] Custom caret metric based on prob-predictions/rankings

2012-02-10 Thread Yang Zhang
(I couldn't find answers to this question in the documentation) On Fri, Feb 10, 2012 at 11:59 AM, Yang Zhang wrote: > Sorry for not being more clear - I'm interested in accessing these > indices from within the trainControl summaryFunction, not afterward > (from the train obje

Re: [R] Custom caret metric based on prob-predictions/rankings

2012-02-10 Thread Yang Zhang
135] 1 2 3 4 6 7 8 9 11 12 ... >  $ Fold06: int [1:135] 1 2 3 4 5 6 7 8 9 10 ... >  $ Fold07: int [1:135] 1 2 3 4 5 7 8 9 10 11 ... >  $ Fold08: int [1:135] 2 3 4 5 6 7 8 9 10 11 ... >  $ Fold09: int [1:135] 1 2 3 4 5 6 7 8 9 10 ... >  $ Fold10: int [1:135] 1 2 4 5 6 7 8 10 11 12

[R] Recall@p plot using ROCR?

2012-02-10 Thread Yang Zhang
Is it possible to use ROCR to plot a simple recall@p plot? I.e., a plot where the x-axis is the position into the ranked test set, and the y-axis is the recall, so you can see what's the recall in the top 10% of the ranked results. I searched through the performance() manual but found nothing. (

Re: [R] Custom caret metric based on prob-predictions/rankings

2012-02-10 Thread Yang Zhang
Actually, is there any way to get at additional information beyond the classProbs? In particular, is there any way to find out the associated weights, or otherwise the row indices into the original model matrix corresponding to the tested instances? On Thu, Feb 9, 2012 at 4:37 PM, Yang Zhang

Re: [R] Custom caret metric based on prob-predictions/rankings

2012-02-09 Thread Yang Zhang
Oops, found trainControl's classProbs right after I sent! On Thu, Feb 9, 2012 at 4:30 PM, Yang Zhang wrote: > I'm dealing with classification problems, and I'm trying to specify a > custom scoring metric (recall@p, ROC, etc.) that depends on not just > the class ou

[R] Custom caret metric based on prob-predictions/rankings

2012-02-09 Thread Yang Zhang
I supply a trainControl summaryFunction, the data given to it contains only class predictions, so the only metrics possible are things like accuracy, kappa, etc. Is there any way to do this that I'm looking? If not, could I put this in as a feature request? Thanks! -- Yang Zhang ht

[R] Choosing glmnet lambda values via caret

2012-02-09 Thread Yang Zhang
Usually when using raw glmnet I let the implementation choose the lambdas. However when training via caret::train the lambda values are predetermined. Is there any way to have caret defer the lambda choices to caret::train and thus choose the optimal lambda dynamically? -- Yang Zhang http

[R] How to properly build model matrices

2012-02-09 Thread Yang Zhang
ve the Intercept from the model matrices, since it seems to always be redundant (I usually use caret). None of these is a big deal at all, but I'm just curious if I'm missing something simple in how I'm doing things. Thanks. -- Yang Zhang http://yz.mit.edu/ _

Re: [R] ROCR crashes for simple recall plot

2012-02-08 Thread Yang Zhang
On Wed, Feb 8, 2012 at 6:46 PM, David Winsemius wrote: > > On Feb 8, 2012, at 8:00 PM, Yang Zhang wrote: > >> I'm trying to use ROCR to create a simple cutoff vs recall plot >> (recall@p) on the example ROCR.simple dataset: >> >> library(ROCR) >

[R] ROCR crashes for simple recall plot

2012-02-08 Thread Yang Zhang
n the last line. I'm using R 2.14.1, ROCR 1.0-4.  Any ideas? Thanks in advance. -- Yang Zhang http://yz.mit.edu/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.

[R] Regression evaluation

2011-06-20 Thread Yang Zhang
Are there any utilities/packages for showing various performance metrics of a regression model on some labeled test data? Basic stuff I can easily write like RMSE, R-squared, etc., but maybe with some extra utilities for visualization, or reporting the distribution of prediction confidence/varianc

[R] caret for non-numeric data

2011-06-16 Thread Yang Zhang
caret has many useful preprocessing facilities for numeric predictors, such as removing near-zero-variance predictors, removing correlated predictors, removing linear combinations, centering/scaling, and Box-Cox transformations. However, these don't work for factor data, which is common in many le

Re: [R] Plotting from functions

2011-06-01 Thread Yang Zhang
On Wed, Jun 1, 2011 at 1:04 PM, Yang Zhang wrote: > I can plot to png's fine when i run this directly from the top-level > script/console: > > png('diamonds.png');qplot(carat,price,data=diamonds);dev.off() > > But for some reason it's not working when tha

[R] Plotting from functions

2011-06-01 Thread Yang Zhang
I can plot to png's fine when i run this directly from the top-level script/console: png('diamonds.png');qplot(carat,price,data=diamonds);dev.off() But for some reason it's not working when that's in a function: (function(){png('diamonds.png');qplot(carat,price,data=diamonds);dev.off()})() I su