Re: [R] CARET and NNET fail to train a model when the input is high dimensional

2013-03-06 Thread James Jong
let's you fit > the model. Off the top of my head, you could use something like: > >MaxNWts = length(levels(trY))*(max(my.grid$.size) * (nCol + 1) + > max(my.grid$.size) + 1) > > Also, this one of the methods for getting help (the other is to just email > me). I also try

[R] CARET and NNET fail to train a model when the input is high dimensional

2013-03-05 Thread James Jong
The following code fails to train a nnet model in a random dataset using caret: nR <- 700 nCol <- 2000 myCtrl <- trainControl(method="cv", number=3, preProcOptions=NULL, classProbs = TRUE, summaryFunction = twoClassSummary) trX <- data.frame(replicate(nR, rnorm(nCol))) trY <- runif(1)*trX[,1

[R] CARET. Relationship between data splitting trainControl

2013-02-19 Thread James Jong
I have carefully read the CARET documentation at: http://caret.r-forge.r-project.org/training.html, the vignettes, and everything is quite clear (the examples on the website help a lot!), but I am still a confused about the relationship between two arguments to trainControl: "method" "index" and

[R] party::cforest - predict?

2013-02-14 Thread James Jong
What is the function call interface for predict in the package party for cforest? I am looking at the documentation (the vignette) and ?cforest and from the examples I see that one can call the function predict on a cforest classifier. The method predict seems to be a method of the class RandomFor

Re: [R] CARET: Any way to access other tuning parameters?

2013-02-14 Thread James Jong
really need to read the documentation. Almost every question that >>> you have has been addressed in the existing material. For this one, there >>> is a section on custom models here: >>> >>>http://caret.r-forge.r-project.org/training.html >>> >

Re: [R] CARET: Any way to access other tuning parameters?

2013-02-13 Thread James Jong
rge.r-project.org/training.html > > Max > > > On Wed, Feb 13, 2013 at 9:58 AM, James Jong wrote: > >> The documentation for caret::train shows a list of parameters that one can >> tune for each method classification/regression method. For example, for >> the

[R] CARET: Any way to access other tuning parameters?

2013-02-13 Thread James Jong
The documentation for caret::train shows a list of parameters that one can tune for each method classification/regression method. For example, for the method randomForest one can tune mtry in the call to train. But the function call to train random forests in the original package has many other p

[R] Putting priors on which factors to sample more from, in random forests

2013-02-12 Thread James Jong
I was wondering if anyone knows of a random forest implementation (or way of tweaking the standard randomForest library) that allows one to specify some sort of variable importance a* *priori. For example, say that I know that some variables/factors could be more informative than others for class

Re: [R] caret: Errors with createGrid for rf (randomForest)

2013-02-12 Thread James Jong
That was the problem. Thanks David! James On Tue, Feb 12, 2013 at 2:08 PM, David Winsemius wrote: > > On Feb 12, 2013, at 10:53 AM, James Jong wrote: > > > When I try to crate a grid of parameters for training with caret I get >

[R] caret: Errors with createGrid for rf (randomForest)

2013-02-12 Thread James Jong
When I try to crate a grid of parameters for training with caret I get various errors: > my_grid <- createGrid("rf") Error in if (p <= len) { : argument is of length zero > my_grid <- createGrid("rf", 4) Error in if (p <= len) { : argume

[R] Training with very few positives

2013-02-10 Thread James Jong
I have a binary classification problem where the fraction of positives is very low, e.g. 20 positives in 10,000 examples (0.2%) What is an appropriate cross validation scheme for training a classifier with very few positives? I currently have the following setup: =

[R] Statistics of prediction for multiple models with caret

2013-02-10 Thread James Jong
I am trying to get statistics of prediction for binary classification problems and for various training models with caret. Below is an example that illustrates my need: -- library(caret) # ... Get X and Y for training a binary classification problem. X is i

[R] rpy2 (Python <--> R)

2013-02-09 Thread James Jong
Hi - I am having trouble installing rpy2. I have already compiled R as a shared library, but I do not have admin privileges on so I am trying to install rpy2 with: pip install -user rpy2 but I am getting the following error: ./rpy/rinterface/_rinterface.c

[R] Correct value of R_HOME

2013-02-09 Thread James Jong
What is the purpose of the variable R_HOME? What value should I set it to? Thanks, James [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

[R] Questions about caret - Best place to ask?

2013-02-09 Thread James Jong
Hi there. I am relatively new to R and to the community. I have previously asked my R questions at R-help (through Nabble, not sure if there is a better way other than Nabble or regular email), and StackOverflow with the [R] tag. I have some questions that are somewhat specific about the packag

Re: [R] Sourcing my file does not print command outputs

2013-02-07 Thread James Jong
** ** > > The summary information and dotplot printed just fine. > > ** ** > > Dan > > ** ** > > Daniel J. Nordlund > > Washington State Department of Social and Health Services > > Planning, Performance, and Accountability > > Research a

Re: [R] Saving model and other objects from caret

2013-02-07 Thread James Jong
What are the *RDS counterparts? What is the difference? James On Thu, Feb 7, 2013 at 5:00 PM, Michael Weylandt wrote: > > > On Feb 7, 2013, at 9:51 PM, James Jong wrote: > > > Thanks Stephan. I can't believe I didn't try that first. I greatly > > appreciat

Re: [R] Saving model and other objects from caret

2013-02-07 Thread James Jong
**loading-a-model-in-r<http://stackoverflow.com/questions/14761496/saving-and-loading-a-model-in-r> > > Best, > Stephan > > > > > On 07.02.2013 22:33, James Jong wrote: > >> Say I train a model in caret, e.g.: >> >> RFmodel <- train(X,Y,method=

[R] Fwd: Sourcing my file does not print command outputs

2013-02-07 Thread James Jong
; Daniel J. Nordlund > Washington State Department of Social and Health Services > Planning, Performance, and Accountability > Research and Data Analysis Division > Olympia, WA 98504-5204 > > From: James Jong [mailto:ribonucle...@gmail.com] > Sent: Thursday, February 07, 2013 1:30

[R] Saving model and other objects from caret

2013-02-07 Thread James Jong
Say I train a model in caret, e.g.: RFmodel <- train(X,Y,method='rf',trControl=myCtrl,tuneLength=1) How can I save this to disk and load it later in R? How about an object of the class "resamples"? resamps <- resamples( list( RF = RFmodel, SVM = SVMmodel,

Re: [R] Sourcing my file does not print command outputs

2013-02-07 Thread James Jong
(DSHS/RDA) < nord...@dshs.wa.gov> wrote: > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > > project.org] On Behalf Of John Kane > > Sent: Thursday, February 07, 2013 10:57 AM > > To: James Jong; r-help@r-project.org

[R] Saving history across sessions

2013-02-07 Thread James Jong
I have an environment variable `$R_HISTFILE` pointing to `/home/my.username/.RHistory` and the following code in my `.Rprofile` in my home directory: .Last <- function() { if (!any(commandArgs()=='--no-readline') && interactive()){ require(utils)

[R] Sourcing my file does not print command outputs

2013-02-07 Thread James Jong
I looked at the documentation of source() and summary(), and I could not find the reason why calling something like: > summary(resamps) from the command line, works (it prints the summary) whereas calling summary(resampls) from a file that I source with source("my_file.r") does not print anyth