The caret package (short for Classification And REgression Training) is a set of functions that attempt to streamline the process for creating predictive models.

learn more… | top users | synonyms

1
vote
1answer
25 views

R caret - how to combine principal components and non-principal-component predictors?

Consider the following example. Suppose I want to model x in DF2 using everything else. While it makes sense to do ...
0
votes
0answers
29 views

Obtaining sequence of lambda values for training glmnet model via `caret`

I have multiple models that I'm training using train in the caret package, all while using the same cross validation folds to ...
0
votes
1answer
41 views

Using the Caret package is it possible to obtain Confusion Matrices for specific threshold values?

I've obtained a logistic regression model (via train) for a binary response, and I've obtained the logistic confusion matrix via ...
0
votes
1answer
26 views

Caret: customizing feature selection, nested inside cross validation

Using caret, I want to train a SVM classifier and estimate its performance using repeated cross validation. My dataset has a very large number of predictors (300K) and I want to reduce this number ...
0
votes
1answer
32 views

Leave-one-subject-out cross validation in Caret

Hi Dear Colleagues, I wonder how to correctly setup a leave-one-subject-out cross validation (LOSO) for train() function in caret. Here is my example code: ...
0
votes
1answer
92 views

Caret varImp for randomForest model

I'm having trouble understanding how the varImp function works for a randomForest model with the caret package. In the example ...
0
votes
1answer
83 views

Confusion between caret randomForest predict() results and reported model performance

This question seems related, but the consensus was that the issue had to do scaling the data, which I do prior to training, so I don't think that's the issue: Issue on prediction with FinalModel of ...
0
votes
0answers
24 views

Predict feature combination with highest probability

I trained a Support Vector Machine with the caret package in R. My dataset looks the following: ...
1
vote
0answers
39 views

Running R caret in Python script [closed]

I am currently trying to transition from R into Python to streamline the process of working in web-based applications. I know that SciKit Learn has a ton of functionalities parallel to R's, including ...
0
votes
0answers
39 views

recursive feature elemination in R with caret

i work with R caret software package to select the most important features from some set of data. My response is a factor of multiple classes (e.g. nominal ...
0
votes
2answers
37 views

How to get classification probabilities when running glmnet

I am trying to figure out how to get class probabilitis when running a classification using glmnet. I have built the model and done predictions. But all I have is a huge matrix which I don't really ...
0
votes
1answer
41 views

Find variables selected for each subset using caret feature selection

I am doing feature selection using the command 'rfe' in the caret package (http://caret.r-forge.r-project.org/featureselection.html). This command uses a metric to find the optimal amount of variables ...
0
votes
1answer
46 views

Caret retraining of neural network after finding optimal parameters?

I am applying a neural network and logistic regression to a classification problem. In order to evaluate the performance of the two classifiers I'm using 5-fold cross-validation (roughly 800 samples ...
0
votes
1answer
157 views

Train / Validate / Test sets in Caret

I want to use caret to compare two different classification algorithms. For example SVM and Elastic net. I want to put aside some samples for test set and then use the rest of the samples for ...
1
vote
1answer
39 views

The differences between models via their resampling distributions.

The caret package offers the ability to make statistical statements about the performance of different models used for classification. According to the description, ...
1
vote
0answers
51 views

Interpreting varImp using a GLMNET model on a 3-level factor

(tried stackoverflow but told I may have better luck here). I am looking for some help interpreting varImp using GLMNET multinomial model on a 3-level factor variable. The plot and the data don't make ...
0
votes
0answers
24 views

Discriminant analyses with NIRS in R

I am working with a NIR matrix consistent of 134 rows (samples) and 1529 columns (wavelengths), from which I want to discriminate between two categories (species). I have successfully used the plsda ...
2
votes
1answer
153 views

How to implement a hold-out validation in R

Let's say I'm using the Sonar data and I'd like to make a hold-out validation in R. I partitioned the data using the createFolds ...
0
votes
1answer
39 views

R's equivalente of scikit's KFold

I'm new to R and I'm trying to set up a basic k folds CV loop. In Python I'd use scikit's KFold. ...
0
votes
0answers
422 views

Caret with rxDForest as custom model

I'm trying to use the train function from the caret package to tune the parameters of the rxDForest from RevoScaleR package (I ...
0
votes
0answers
101 views

predictors and varImp functions in caret packages, should results match for a glmnet model?

I am using the train function in caret package. I have 55 predictors and a continuous outcome. The model that I selected is glmnet. Looking the results of using the "predictors" function-just to check ...
0
votes
1answer
116 views

How to use rfe object with function pickSizeTolerance in R package caret

I run caret's recursive feature selection with randomForest. While running rfe function with method repeatedcv, I had parameter ...
0
votes
1answer
162 views

Help requested with using custom model in caret() package

The caret package (terrific btw) has a lot of models built in but if you want to use a model that is not built in, there is a way as described in outline here ...
0
votes
1answer
86 views

What are RMSE SD and Rsquared SD metrics in resampling results using R package:caret?

I've been doing predictive modelling with R package caret. When resampling regression models, I get the traditional RMSE and Rsquared metrics, but also RMSE SD and ...
1
vote
1answer
304 views

Interpret Variable Importance (varImp) for Factor Variables

When I run variable importance on a random forest (or any other model), the factor/categorical variable names have the factor name as the suffix. For example, ...
3
votes
0answers
518 views

R - how to let glmnet choose lambda range when using caret?

To fit a lasso model using glmnet, you can simply do the following and glmnet will automatically calculate a reasonable range of ...
0
votes
2answers
75 views

Machine Learning with Skewed Classes in R

I am looking for some suggestions on what methods are appropriate for training a dataset with a high skew in the outcome classes. The ratio of Class 0: Class 1 is about 20:1 and I am looking to ...
1
vote
0answers
298 views

Backward stepwise regression with cross validation in R

I would like to do model selection using backward stepwise procedure and cross validation. https://www.otexts.org/fpp/5/3 I have used stepAIC in ...
0
votes
0answers
210 views

How does knnimpute of the preprocess function work?

I am new to R and I use a script I do not completely understand. It preprocesses a dataset for data mining. At one point, the data (stored in fil) should be ...
3
votes
1answer
585 views

Understanding the output of C5.0 classification model using the CARET package

The C5.0 classification model was used in this 4-class problem data with $N_{train}$=165, $P$=11, using caret R-package by ...
2
votes
1answer
213 views

How to interpret this cross-validated sparse LDA figure using CARET package?

Training data with $p$ =11 predictors and $n$ =165 with 4-class problem was cross-validated (5 times repeated 10-fold CV) using the sparse LDA (aka SDA) using caret ...
1
vote
1answer
574 views

What is the best strategy to train and validate classification using PLS-[classifier] in caret package?

I have 4 clusters (see plot below) extracted from data of medical samples N=218 measured for 11 genes/predictors P=11 by this ...
1
vote
1answer
1k views

Issue on prediction with FinalModel of RandomForest in R using the CARET package

I use the caret package for training a randomForest object with 10x10CV. ...
0
votes
0answers
300 views

Using caret train function to perform lm with 10 repeated 10-fold cross validation

I'm using the caret package at the moment to perform different forms of analysis on my dataset. I did the following to do 10-fold cross validation, 10 times:- ...
1
vote
1answer
269 views

What is the difference between function createFolds and createDataPartition in caret

I think the two functions are all to split the data, but I really can't get the difference between both of them, even I has read the help manual of them.
2
votes
1answer
359 views

Question about performing k-fold CV with caret

I have read the help manual of caret carefully: see A Short Introduction to the caret Package. In its example, I found it split the data with createDataPartition before a model training. ...
0
votes
1answer
111 views

Caret package Varimp - feature selection question

I decided to use RFE using the caret package for feature selection for a logistic regression model. The documentation says the Varimp for linear model uses the absolute value of the t-statistic for ...
0
votes
0answers
180 views

Metric warning using caret's rfe

I am using the caret package to do feature selection with rfe while training a knn ...
0
votes
0answers
29 views

Recursive Feature Elimination Fails to Output as Expected

Currently I am using rfe function in the "caret" package to do feature selection. There are 380 variables as input candidates. I have done many trials and I noticed that something weird always ...
2
votes
1answer
379 views

Time-series machine learning methods and R packages

I am trying to determine how to use machine learning models such as for eg., random Forest with (non-financial) time-series data. Using an example, suppose we wanted to find based on monthly scores ...
3
votes
3answers
328 views

lambda value in glmnet tunning cross validation changes when repeating test

I'm using glmnet package to build a linear regression with $\alpha$ = 0.5, to find best $\lambda$. xMatrix [44x15000] ...
5
votes
1answer
757 views

Does caret train function for glmnet cross-validate for both alpha and lambda?

Does the R caret package cross-validate over both alpha and lambda for the ...
1
vote
1answer
230 views

Number of trees using cforest in caret

I have read some of the previous posts about this issue and I still do not understand how caret decides on the number of trees when you use the model=cforest from ...
1
vote
1answer
331 views

R caret difference between ROC curve and accuracy for classification

In case of caret package test function metric option, one can use either accuracy or ROC as a metric that will be used to finalize values of tuning parameters. I felt that accuracy and ROC are the ...
1
vote
1answer
362 views

LGOCV caret package R

i am learning data mining through book . During classification chapters about Neural Networks the authors have below code. I have below questions: ...
2
votes
1answer
629 views

Caret and coefficients (glmnet)

I am interested in utilizing caret for making inferences on a particular data set... Is it possible to do the following: produce coefficients of a glmnet model I trained in caret. I would like to ...
3
votes
1answer
580 views

R/caret: train and test sets vs. cross-validation?

This may be perhaps a silly question, but when generating a model with caret and using something like LOOCV or (even more to the point) ...
2
votes
1answer
379 views

caret rfe variable selection and test prediction

I have ~800 continuous variables and a categorical response variable (disease/non-disease) and I have been using caret to classify disease based on the continuous variables. I have used caret and ...
1
vote
1answer
263 views

R caret package question

...