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
2answers
36 views

Feature selection before neural network classification

I have a training set of 87 samples and 9480 variables. My predictors are continuous and my response variable is binary. I'd like to use the caret package in R to tune a neural network classification ...
0
votes
0answers
27 views

How to use the r package to compare different models on 10-fold CV [on hold]

I want to compare the classification performances of 5 different models on 21 datasets using caret with 10-fold CV. I have read the manual and examples and was wondering whether the package is ...
0
votes
0answers
12 views

R language: Can the function rfe of the package caret be used with a mixed effect model [migrated]

I would like to do feature selection with a mixed effect model in R, but I cannot manage to combine the function rfe of the package caret with the function me of ...
0
votes
1answer
14 views

I was expecting 0 and 1 as an answer of a predict function in r

I'm doing a binomial family with method="glm" in train function (caret package) and as result I'm getting predicted numbers like "0.62325028 0.51807017 0.67119878 ..." and I was expecting vector ...
0
votes
1answer
35 views

Model Selection and RFE using caret

I'm faced with a high dimensional (samples=148, features=20000), supervised binary classification problem. Which I would like to approach with an ensemble of classifiers, that will classify using a ...
1
vote
1answer
20 views

How to do test set evaluation using a regression model in Caret?

I'm used to using Caret to do classification but now I need to use it for regression. I have successfully trained a model on my training set but I'm not sure what ...
0
votes
1answer
14 views

train multiples observations from the same person in caret

I have data where persons were give four different tasks under three different conditions (intensities). The data looks like this: ...
0
votes
0answers
35 views

In recursive feature elimination in random forest, why are all features selected?

I am trying to use the recursive feature elimination in caret package. Here's the code; ...
0
votes
0answers
20 views

Optimize Probability Thresholds for class imbalances in glmnet models in caret

In direct relation to the topic discussed here I intend to retrain the model in order to optimize the probability threshold for classification of both classes. Currently the model achieves high ...
0
votes
1answer
43 views

Custom resampling method in caret

I need to create a custom resampling method in R package caret where: For each leave-pair-out-cross-validation, from the training set I derive new data using a function I implemented. Then it is used ...
0
votes
2answers
54 views

Data partitioning according two variables

I am working with the following dataset: ...
0
votes
0answers
10 views

manually obtain caret importance for logistic regression

with the caret package in R http://topepo.github.io/caret/varimp.html it is possible to obtain a rank of the variables for linear model. I would like to know how can I get this rank manually when the ...
1
vote
1answer
49 views

How does caret handle factors?

I have been testing conditional trees and random forests with caret, and I've noticed it does something weird with factors. So, for example, a ctree using the base dataset ...
0
votes
0answers
6 views

Formula behind variables importance in linear model with caret library

The caret library can measure the importance of predictors http://topepo.github.io/caret/varimp.html The importance for a Linear Models is computed as: 'the absolute value of the t-statistic for ...
0
votes
1answer
34 views

What does the varImp function in the caret package actually compute for a glmnet (elastic net) object

I am fitting an elastic net model with glmnet via the caret package with 189 predictors and a binomial criteria (a,b) ...
0
votes
0answers
13 views

ordinal variables and caret when preprocessing

I have found that many examples in the APM book by Dr. Max Kuhn tend to cover data sets that have continuous variables as the predictor set. If working with a data set that has ordinal factors, would ...
0
votes
1answer
144 views

Metrics for multi-class problems in R caret package for various method tags

The caret package for R provides a variety of error metrics predominantly aimed at 2-class classification models with limited error metrics. Here is a multi-class function to allow caret:::train to ...
3
votes
1answer
48 views

Check a status of training process in R

I'm training a model using caret package in R for almost 3 days. The calculations are running in parallel (multiple processes). Unfortunately there is no output in ...
1
vote
1answer
54 views

Which performance measure to report?

I've trained a random forest regression model using boot632 resampling and the caret package. The output of the model tuning process gives a few different performance measures. ...
0
votes
1answer
37 views

Outer crossvalidation cycle in caret package (R)?

Could somebody provide a nice example code how to best implement an outer crossvalidation cycle using the caret package in R? The package provides a convenient trainControl() argument to ajust the ...
2
votes
2answers
83 views

How to prepare a dataset for text classification

I would like to compare some algorithms for performing sentiment classification (Naive Bayes, SVM, and ...
0
votes
0answers
36 views

Standard error of prediction MARS splines earth package

I'm using the earth package (using caret train function) MARS spline implementation in order to perform non - linear regression modeling. I would like to obtain a measure of prediction uncertainty ...
2
votes
1answer
134 views

R caret package - number of principal components when preprocessing using PCA

I am using the caret package in R for training of binary SVM classifiers. For reduction of features I am preprocessing with PCA using the built in feature [preProc=c("pca")] when calling train(). How ...
1
vote
0answers
145 views

Caret feature selection with customized random forest classifier

I'm following the Caret package tutorial for constructing customized functions for a recursive feature elimination. I can reproduce the provided example which is a random forest regression. However, ...
0
votes
1answer
46 views

How to define samples in caret package?

I am using the caret package and need to train a random forest, where only certain samples should be in the held-out set. I want to define the sampling for each tree in the random forest, for say 100 ...
1
vote
1answer
72 views

Glmnet Caret Package with small number of observations

I have a regression problem where I’m attempting to train a data set with 70 predictors, but only 35 observations with glmnet in the caret package. I’m trying to determine the best resampling method. ...
2
votes
0answers
84 views

Why does glmnet in caret give different predictions for different alphas even though lambda is zero?

In R, when using caret to train an elastic net regularization model, I find that different values of alpha give different predictions when the lambda parameter equals zero. This should not be the ...
0
votes
1answer
87 views

Rpart using Caret changes names of Factors

If I have a factor e.g. sexe with two levels MALE and FEMELLE let's say, using rpart alone I get splits that say for example Sexe = Male and then a yes no split. However using rpart with caret I get a ...
0
votes
1answer
347 views

Random Forest confusion matrix

I've been creating some random forest models using the caret package in R. I don't have a large amount of data to work with so I'm using 10 x 10-fold CV in lieu of an independent test set. When I ...
0
votes
1answer
69 views

Probabilistic importance value for Caret linear SVM classifier

In a linear SVM model, inside caret I would like to get the variable importance after recursive feature elimination, so according to the documentation: ...
0
votes
1answer
122 views

GBM Bootstrap Prediction Interval Code Error

based on code presented in thread: How to find a GBM Prediction Interval I am trying to apply this to my dataset. Below is my full code, and I am having issues with the bootstrap function. ...
2
votes
1answer
252 views

How to find a GBM Prediction Interval

I am working with GBM models using the caret package and looking to find a method to solve the prediction intervals for my predicted data. I have searched extensively but only come up with a few ...
0
votes
1answer
33 views

preprocessing and dummy variables order of procedure

I would please like to know when I should conduct pre-processing procedures (removing near-zero variance, highly correlated predictor variables, and linear dependencies) when planning to create dummy ...
1
vote
2answers
241 views

Training nnet and avNNet models with caret when the output has negatives

My question is about the typical feed-forward single-hidden-layer backprop neural network, as implemented in package nnet, and trained with 'train()' in package caret. This is related to this question ...
0
votes
1answer
66 views

mtry tuning given by caret higher than the number of predictors

According to this discussion, it seems that the train function of the caret package returns a ...
0
votes
1answer
117 views

Feature Importance in each fold and repeat after repeated cross validation in caret

this is my first post on Cross Validated so I apologize in advance if I'm not yet familiar with any conventions regarding forum posts. Currently, I'm working on a feature selection task using elastic ...
0
votes
1answer
126 views

How to get Sub-Training and Sub-Test from cross validation in Caret

I am using Caret function I have divided my data into training(75%) and test (25%) sets. Now I am running 10-Fold CV on training data. When i fit following model train_control <- ...
0
votes
0answers
94 views

A question about warning that performing k-fold CV with caret

I am trying to createFolds function in caret to use k-fold cross-validation in R. But I came across this warning: ...
0
votes
1answer
94 views

Error: object 'descr' not found

I am trying to follow up the example code in the "Building Predictive Models in R Using the caret Package" paper from Max Kuhn[1]. Here is the part of the code: ...
0
votes
1answer
38 views

Perform analysis about model prediction diferrences using CARET

Using CARET package one can perform an analysis on differences between various models obtained using a dataset (the training dataset, trainSet) and the model that best fits the trainSet: For example, ...
0
votes
1answer
62 views

import kernlad model to caret

I'd like to test the anova rbf kernel included in the kernlab package in caret. Following excelent tutorial (https://topepo.github.io/caret/custom_models.html) I've come up with the following code: ...
0
votes
1answer
376 views

Caret package in R - get top Variable of Importance

I am facing two problems while using caret package in R. I am reproducing an example below: ...
1
vote
1answer
117 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
191 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 ...
1
vote
2answers
1k 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
168 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
190 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
2k 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 ...
1
vote
1answer
1k 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
40 views

Predict feature combination with highest probability

I trained a Support Vector Machine with the caret package in R. My dataset looks the following: ...