search for: rfmodel

Displaying 5 results from an estimated 5 matches for "rfmodel".

Did you mean: fmodel
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,...
2017 Oct 22
0
Test set and Train set in Caret package train function
...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, method="rf") first_holdout <- subset(rfmodel$pred, Resample == "Fold1") str(first_holdout) 'data.frame': 90 obs. of 5 variables: $ pred : Factor w/ 3 levels "setosa","versicolor",..: 1...
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 Feb 07
0
FW: Sourcing my file does not print command outputs
...y Y <- as.factor(ifelse(sign(Y)>0,'X1','X0')) #Create bootstrap samples for fitting models library(caret) print("Creating bootstrap samples") tmp <- createResample(Y,times = 25) myCtrl <- trainControl(method = "boot", index = tmp, timingSamps = 10) RFmodel <- train(X,Y,method='rf',trControl=myCtrl,tuneLength=1) NNmodel <- train(X,Y,method='nnet',trControl=myCtrl,tuneLength=3, trace = FALSE) ## GLMnet = GLMmodel, ... #Assess re-sampled (out of sample) accuracy print("Assessing re-sampled (OOB) accuracy&quo...
2013 Feb 10
1
Training with very few positives
...e the following setup: ======================================== library(caret) tmp <- createDataPartition(Y, p = 9/10, times = 3, list = TRUE) myCtrl <- trainControl(method = "boot", index = tmp, timingSamps = 2, classProbs = TRUE, summaryFunction = twoClassSummary) RFmodel <- train(X,Y,method='rf',trControl=myCtrl,tuneLength=1, metric="ROC") SVMmodel <- train(X,Y,method='svmRadial',trControl=myCtrl,tuneLength=3, metric="ROC") KNNmodel <- train(X,Y,method='knn',trControl=myCtrl,tuneLength=10, metric="RO...