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
1answer
16 views

How to get the predicted class instead of class probabilities? [on hold]

I have trained a random forest using caret package for predicting a binary classification task. ...
0
votes
0answers
15 views

Extract specific coefficients from Caret and glmnet [on hold]

I'm using caret and glmnet to train my classification model. I would like to extract the coefficients for a specific alpha and lambda. ...
0
votes
0answers
13 views

Inconsistent validation results (CARET and DNN)

G'day, I have a R script below which I run twice. ...
0
votes
0answers
16 views

flexible discriminant analysis computational completixy

I'm using mda package + caret infrastucture to perform a flexible discriminant analysis for a classification problems. I have 26 features of mixed type. I found little if any guidance on the ...
0
votes
1answer
18 views

What metric to use as the cross validation error in the training set for a binary classification problem?

When I am running cross validation on the training set for a binary classification problem, what metric should I use if I am only interested in obtaining the largest AUC (area under receiver operating ...
1
vote
1answer
23 views

Does “caret” avoid data snooping due to preprocessing in model tuning? [closed]

Although the obvious answer to my question is yes, since caret is a professional, well-known tool, I tend to be skeptical when using implemented functionality from ...
0
votes
0answers
3 views

RFE (Recursive Feature Elimination) for Poisson Regression with offset [migrated]

It's my first post so I hope I don't make any editing mistakes. Here's my issue : I'm working on count data and am implementing a Poisson Regression with an exposure factor (that needs to go in the "...
0
votes
0answers
22 views

Poisson xgboost with exposure

I was trying to model a count dependent variable with uneven exposure. Classical glms would use log(exposure) as offset, also gbm does, but xgboost does not allow for offset until now... Trying to ...
0
votes
0answers
20 views

How to use same metric in rfe and train?

I'm running a feature selection together with a model tuning using caret's rfe and train methods on a multi-class problem. I would like to select my features in rfe, as well tune my model parameters ...
0
votes
0answers
70 views

Different results with “xgboost” vs. “caret” in R

I am new to R programming language and I need to run "xgboost" for some experiments. The problem is that I need to cross-validate the model and get the accuracy and I found two ways that give me ...
1
vote
1answer
26 views

caret preProcess knnImpute error more nearest neighbours than there are points

I am trying to impute missing data using preProcess function in caret with kNNImpute method. ...
0
votes
1answer
46 views

Identical variable importance values for different model types

I trained two different caret models on the same multi-class training data using repeated cross validation and computed the variable importance. What strikes me, is that for both models varImp returns ...
0
votes
1answer
46 views

Caret Package in R [closed]

I'm starting with the caret package in R and I was wondering when we use train() if all the work was done by the function? I ...
19
votes
5answers
1k 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
39 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
48 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: ...
1
vote
1answer
63 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 ...
8
votes
4answers
603 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
67 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
59 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
62 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
34 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
65 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
60 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
29 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
86 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
72 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
31 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
61 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
46 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
72 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
57 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
88 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
36 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
255 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
35 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
46 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
93 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
35 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
75 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
22 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
20 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
184 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
125 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
241 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
107 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
304 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 ...