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

0
votes
0answers
3 views

best debug procedure for caret variable selection 'functions'? [migrated]

I'm trying to use caret's 'filter' functions to do variable selections before training a model using the following code: ...
18
votes
5answers
980 views

Overfitting: No silver bullet?

My understanding is that even when following proper cross validation and model selection procedures, overfitting will happen if one searches for a model hard enough, unless one imposes restrictions on ...
0
votes
1answer
26 views

How does cross-validation in train (caret) precisely work?

I have read quite a number of posts on the caret package and I am specifically interested in the train function. However, I am not completely sure if I have understood correctly how the train function ...
0
votes
0answers
40 views

Recursive feature elimination and class imbalance

I am trying to apply the recursive feature elimination in the R package caret following the example in the caret website: ...
0
votes
0answers
4 views

LOOCV in R returns error [migrated]

In the past days I began getting familiar with R (I come from MATLAB and Python). I wanted to try out the caret package (pretty awesome) and I keep getting the following error message when I try to ...
1
vote
1answer
54 views

Using Random Forest Variable Importance to train SVM models (R)

I have trained a Random Forest model in R with the caret package but the results are not very promising. I have decided to try with SVM models but I have a great ...
0
votes
0answers
4 views

R “Floating point exception: 8” with caret and rbf [migrated]

I was digging to learn how to use caret::train function with rbf method. I found this questions, resolved with a basic R example:...
8
votes
4answers
541 views

Gradient boosting machine accuracy decreases as number of iterations increases

I'm experimenting with the gradient boosting machine algorithm via the caret package in R. Using a small college admissions dataset, I ran the following code: <...
0
votes
0answers
14 views

optimise sharpe ratio with caret package

I am trying to see if what I used to do manually can fit into the caret package framework. Given a set of potential signals (=features), I need to select a subset that optimises the out of sample ...
1
vote
1answer
57 views

Results from rfe function (caret) to compute average metrics - R

I am computing a SVM-RFE model with the rfe function of the caret package, but I am a bit confused about the results. My code is:...
0
votes
1answer
40 views

Accessing PCA components from caret object in R

I know how to build a model using PCA components in caret package, however I don't know which variables explain which PCA components. I need some help on it. When I perfom the preProcessing ...
0
votes
1answer
44 views

L2-regularized MLR using caret and how to make sure I am using the best tuned model

I am trying to do L2-regularized MLR on a data set using caret. Following is what I have done so far to achieve this: ...
0
votes
1answer
32 views

Logistic regression categorical variable interpretation after transformed into dummy variable

Before training a glm model (in R), predictors were transformed into matrix and highly correlated/near zero variance variables were excluded: ...
0
votes
0answers
54 views

Caret classification: feature selection & unbalanced data

I have a two-class classification problem with very unbalanced data (~1:1000 Yes/No ratio). The initial model class I'd like to try is regular glm. So there are two issues need to be addressed: 1) ...
0
votes
1answer
46 views

Model Underperforming

I am a quite new to machine learning but I have tried to implement some prediction on a data to predict if a customer would churn of not.And for this I have used many features but I am unable to ...
0
votes
0answers
16 views

R Caret train / rfe optimize for positive predictive value instead of Accuracy or Kappa

In train or rfe I can only set Accuracy or Kappa. Is there a way to edit the functions to define a scoring function? I am using Kappa at the moment but I need to optimize for positive predictive Value ...
0
votes
0answers
21 views

caret for hierarchical classification

I am wondering if there are algorithms in the awesome caret package that deal with hierarchical classification tasks? That is, assume each item can be of class A or ...
1
vote
0answers
80 views

R - suggested precedures in caret to fit stable precise binary classifiers to financial data

Building a binary precise classifier to forecast financial outcomes (stock rise vs. fall) brings up some nifty complications within caret. 1. classifier selection: there are tons of classifiers ...
0
votes
0answers
51 views

Understanding the approach behind variable importance returned with Xgboost method in R package caret

I recently implemented the R package caret, for a binary categorical outcome regarding a transcriptomic microarray dataset. As i used the method from the xgboost package(method="xgbtree"), then i used ...
0
votes
0answers
30 views

ROC calculation in LOOCV context - caret

I am not sure how caret handle the ROC calculation when used with LOOCV. From what I understand, in the more common case where a 10-fold cross validation is used, the ROC value is calculated for each ...
0
votes
1answer
49 views

Is there a way to return the standard error of cross-validation predictions using caret `train`

In the book Applied Predictive Modelling Ch 4., there is the following table: The standard error here is used in the following graph, and to use the "one-standard error method" to find the optimal ...
2
votes
0answers
39 views

How to extract the predictions and probabilities of each training sample in a cross-validation result in caret (R)?

I'm learning the caret package in R for classifications by Naive Bayes. I'm following the tutorial from: http://topepo.github.io/caret/training.html Thanks for the great tutorial! But I have one ...
0
votes
2answers
60 views

Do we have to scale new unseen feature data for prediction

In machine learning most algorithms require some kind of scaling to decrease error. This is my code: ...
0
votes
0answers
47 views

Difference in results for predict on caret package “train” object and “train$finalModel” object

Newish to R and new to CrossValidated. I have a question about the predict method for caret "train" objects. I'm running a randomForest model using caret package and am trying to produce some simple ...
1
vote
0answers
74 views

Splitting Longitudinal Data into Training & Test Sets

I'm trying to find a simple way to split some longitudinal data into a training and test set. I'm familiar with using the Caret package in R to make stratified splits, but only with wide-form data. It ...
1
vote
0answers
32 views

Why does predict() in PCA makes an additional scaling when the data is already scaled?

Imagine I have my PCs after scaling the data with log10: preProc<-preProcess(log10(training[,-58]+1), method="pca", pcaComp = 2) Here preProc$rotation ...
0
votes
1answer
180 views

Optimizing probability thresholds in a glm model in caret

I've been building a logistic regression model (using the "glm" method in caret). The training dataset is extremely imbalanced (99% of the observations in the majority class), so I've been trying to ...
0
votes
0answers
25 views

nzv filtering for continuous features in caret

I am a beginner to practical machine learning using R, specifically caret. I am currently applying a random forest algorithm for a microbiome dataset. The values are relative abundance transformed so ...
3
votes
0answers
33 views

Variable Importance results and beyond

This is something I thought sometime ago, forgot about and now remembered. When using predictive models it is useful to evaluate the relationship between each predictor and the outcome. A very good R-...
0
votes
0answers
43 views

Perform various random iterations with feature selection in Caret R package, to select a constant subset of features

I would like to use the rfe function from the R package caret, for applying feature selection--with the custom pre-defined function rfFuncs--, in order to select a subset of features regarding a ...
3
votes
0answers
82 views

Important question regarding feature selection methodologies in R concerning the randomness of the results

I'm currently testing some feature selection methodologies/algorithms in R, like the Recursive Feature Elimination from the R caret package, and also the RRF R package, to select a subset of features ...
0
votes
0answers
30 views

ROC change after variable selection with glmnet

I was using glmnet in caret to select important variables. The code is like ...
0
votes
1answer
57 views

In R package caret, how is linear regression model trained by using resampling?

Resampling is usually used to find the best tuning parameters for a model. However, for some models, such as linear regression model, there is no tuning parameters. In this case, what can we get from ...
0
votes
0answers
21 views

Loss function selection for weighting errors differently

I am building a regression model where I want to score/optimize/train 'over-predictions' to be twice costly as under predictions. I am attempting to do this in R and hopefully with caret package. ...
0
votes
0answers
19 views

Aggregation of Cross-Validated Results

I am using satellite weather features to predict agricultural productivity. I have several models that predict at the daily level. However, I would also like to predict average yield for each week ...
0
votes
1answer
163 views

Naive Bayes error with caret

I want to predict a variable with Naive Bayes. I tried it with another one from the same dataset and it worked perfect but not with the desired. The variable to predict contains values like "OL","DL" ...
0
votes
1answer
95 views

R nnet (Caret) not giving results for size = 8 and above

This is my first post in CrossValidated hence please let me know if I may have inadvertently violated forum rules. I am working with nnet using Caret in R and when I am running experiments using the ...
0
votes
1answer
203 views

PreProcess from Caret doesn't work with a smaller dataset

I am trying to use Caret to train some prediction models. As part of this, I would like to use 'PreProcess'. I have, however, come to the conclusion that PreProcess requires a certain number of ...
1
vote
0answers
89 views

Difference in execution times between caret and randomForest (even with method = “none”)

I have a dataset with 1205 observations and 285 predictors (all but one categorical). It is a binary classification task. When I run randomForest, it executes in less than 1 second. When I run ...
0
votes
0answers
291 views

Interpretation of results using caret R package and random forests regarding training a classifier

In conjuction to one of my previous posts, (Important questions regarding the methodology for constructing classifiers with R package caret and tree based algorithms) i used the R package caret and ...
1
vote
1answer
96 views

Important questions regarding the methodology for constructing classifiers with R package caret and tree based algorithms

I'm currently playing with caret R package, with one merged microarray affymetrix dataset(paired tissue samples), in order to build and test various classifiers, mostly based on trees-such as random ...
0
votes
1answer
29 views

caret - get standard errors of glm model

When estimating a glm model with caret, using the summary function the standard errors are ...
4
votes
0answers
129 views

Caret - Repeated K-fold cross-validation vs Nested K-fold cross validation, repeated n-times

The caret package is a brilliant R library for building multiple machine learning models, and has several functions for model building and evaluation. For parameter tuning and model training, the ...
2
votes
1answer
226 views

Is it necessary to split dataset for cross validation?

I am using caret package in R for training dataset and cross validation process. I am confused about cross validation process. Now, i am splitting the dataset to two subset, training and testing; <...
1
vote
1answer
248 views

Different randomForest results via caret and randomForest package using seeds on train control

After following the questions Different results from randomForest via caret and the basic randomForest package Fully reproducible parallel models using caret Below there is a reproducible example ...
0
votes
2answers
77 views

In what situations would cross validations scores be inaccurate?

I'm trying to fit a SVM model on times series stock return data, predicting a buy, hold, or sell signal of the stock. I'm using 10-fold cross validation (using the R package ...
1
vote
1answer
44 views

Is this an anomaly detection problem?

The following is a plot of a response (y) variable. It's a continuous variable (one month future returns on a set of stocks). I'm particularly interested in predicting the tails. Many machine ...
0
votes
1answer
115 views

pickSizeBest() for recursive feature elimination

I'm struggling providing my recursive feature elimination (RFE) function with valid arguments. This question is technically pretty specific so I hope I've hit the right Forum to ask it. I want to ...
0
votes
0answers
73 views

Why is there a difference between using the package rpart and using the method “rpart” in the caret package?

When I'm running rpart on my train set, it suggests a different cp than rpart does, even though I'm using the same seed. The two formulas I am using are: Using the Caret package fitControl <- ...
0
votes
0answers
149 views

Extracting underlying model output from Caret's train() function

I am using the great {caret} package to run a lot of models, however I would like to analyse the model as one usually does having run that model in its own right, i....