similar to: Training with very few positives

Displaying 20 results from an estimated 300 matches similar to: "Training with very few positives"

2013 Feb 07
1
Saving model and other objects from caret
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, KNN = KNNmodel, NN = NNmodel )) Thanks,
2013 Feb 07
0
FW: Sourcing my file does not print command outputs
Forgot to send to R-help From: Nordlund, Dan (DSHS/RDA) Sent: Thursday, February 07, 2013 2:09 PM To: 'James Jong' Subject: RE: [R] Sourcing my file does not print command outputs James, Your code seems to have ‘…’ sitting on a line all by itself (maybe should be at the end of the preceding comment? Anyway, when I eliminated that problem and sourced the script using the following call
2013 Feb 07
4
Sourcing my file does not print command outputs
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 anything. How can I get summary(resamps) to print when I source a file with this command?
2013 Mar 06
1
CARET and NNET fail to train a model when the input is high dimensional
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]*trX[,2]^2+runif(1)*trX[,3]/trX[,4] trY <-
2012 Jul 12
1
Caret: Use timingSamps leads to error
I want to use the caret package and found out about the timingSamps obtion to obtain the time which is needed to predict results. But, as soon as I set a value for this option, the whole model generation fails. Check this example: ------------------------- library(caret) tc=trainControl(method='LGOCV', timingSamps=10) tcWithout=trainControl(method='LGOCV')
2017 Oct 22
0
Test set and Train set in Caret package train function
Hey all, Does anyone know how we can get train set and test set for each fold of 5 fold cross validation in Caret package? Imagine if I want to do cross validation by random forest method, I do the following in Caret: set.seed(12) train_control <- trainControl(method="cv", number=5,savePredictions = TRUE) rfmodel <- train(Species~., data=iris, trControl=train_control,
2013 Nov 06
1
R help-classification accuracy of DFA and RF using caret
Hi, I am a graduate student applying published R scripts to compare the classification accuracy of 2 predictive models, one built using discriminant function analysis and one using random forests (webpage link for these scripts is provided below). The purpose of these models is to predict the biotic integrity of streams. Specifically, I am trying to compare the classification accuracy (i.e.,
2010 Apr 06
1
Caret package and lasso
Dear all, I have used following code but everytime I encounter a problem of not having coefficients for all the variables in the predictor set. # code rm(list=ls()) library(caret) # generating response and design matrix X<-matrix(rnorm(50*100),nrow=50) y<-rnorm(50*1) # Applying caret package con<-trainControl(method="cv",number=10) data<-NULL data<- train(X,y,
2011 Aug 28
1
Trying to extract probabilities in CARET (caret) package with a glmStepAIC model
Dear developers, I have jutst started working with caret and all the nice features it offers. But I just encountered a problem: I am working with a dataset that include 4 predictor variables in Descr and a two-category outcome in Categ (codified as a factor). Everything was working fine I got the results, confussion matrix etc. BUT for obtaining the AUC and predicted probabilities I had to add
2011 Jun 22
1
caret's Kappa for categorical resampling
Hello, When evaluating different learning methods for a categorization problem with the (really useful!) caret package, I'm getting confusing results from the Kappa computation. The data is about 20,000 rows and a few dozen columns, and the categories are quite asymmetrical, 4.1% in one category and 95.9% in the other. When I train a ctree model as: model <- train(dat.dts,
2011 Jan 24
5
Train error:: subscript out of bonds
Hi, I am trying to construct a svmpoly model using the "caret" package (please see code below). Using the same data, without changing any setting, I am just changing the seed value. Sometimes it constructs the model successfully, and sometimes I get an ?Error in indexes[[j]] : subscript out of bounds?. For example when I set seed to 357 following code produced result only for 8
2012 Nov 29
1
Help with this error "kernlab class probability calculations failed; returning NAs"
I have never been able to get class probabilities to work and I am relatively new to using these tools, and I am looking for some insight as to what may be wrong. I am using caret with kernlab/ksvm. I will simplify my problem to a basic data set which produces the same problem. I have read the caret vignettes as well as documentation for ?train. I appreciate any direction you can give. I
2010 Jan 25
0
glmnet in caret packge
Dear all, I want to train my model with LASSO using caret package (glmnet). So, in glmnet, there are two parameters, alpha and lambda. How can I fix my alpha=1 to get a lasso model? con<-trainControl(method="cv",number=10) model <- train(X, y, "glmnet", metric="RMSE",tuneLength = 10, trControl = con) Thanks Alex Roy [[alternative HTML
2013 Nov 15
1
Inconsistent results between caret+kernlab versions
I'm using caret to assess classifier performance (and it's great!). However, I've found that my results differ between R2.* and R3.* - reported accuracies are reduced dramatically. I suspect that a code change to kernlab ksvm may be responsible (see version 5.16-24 here: http://cran.r-project.org/web/packages/caret/news.html). I get very different results between caret_5.15-61 +
2012 Nov 23
1
caret train and trainControl
I am used to packages like e1071 where you have a tune step and then pass your tunings to train. It seems with caret, tuning and training are both handled by train. I am using train and trainControl to find my hyper parameters like so: MyTrainControl=trainControl( method = "cv", number=5, returnResamp = "all", classProbs = TRUE ) rbfSVM <- train(label~., data =
2011 May 12
2
Can ROC be used as a metric for optimal model selection for randomForest?
Dear all, I am using the "caret" Package for predictors selection with a randomForest model. The following is the train function: rfFit<- train(x=trainRatios, y=trainClass, method="rf", importance = TRUE, do.trace = 100, keep.inbag = TRUE, tuneGrid = grid, trControl=bootControl, scale = TRUE, metric = "ROC") I wanted to use ROC as the metric for variable
2011 Dec 22
0
randomforest and AUC using 10 fold CV - Plotting results
Here is a snippet to show what i'm trying to do. library(randomForest) library(ROCR) library(caret) data(iris) iris <- iris[(iris$Species != "setosa"),] fit <- randomForest(factor(Species) ~ ., data=iris, ntree=50) train.predict <- predict(fit,iris,type="prob")[,2]
2013 Feb 19
0
CARET. Relationship between data splitting trainControl
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 the interplay between trainControl and the data splitting functions in caret
2008 Sep 18
1
caret package: arguments passed to the classification or regression routine
Hi, I am having problems passing arguments to method="gbm" using the train() function. I would like to train gbm using the laplace distribution or the quantile distribution. here is the code I used and the error: gbm.test <- train(x.enet, y.matrix[,7], method="gbm", distribution=list(name="quantile",alpha=0.5), verbose=FALSE,
2012 May 15
1
caret: Error when using rpart and CV != LOOCV
Hy, I got the following problem when trying to build a rpart model and using everything but LOOCV. Originally, I wanted to used k-fold partitioning, but every partitioning except LOOCV throws the following warning: ---- Warning message: In nominalTrainWorkflow(dat = trainData, info = trainInfo, method = method, : There were missing values in resampled performance measures. ----- Below are some