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
11 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
35 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 ...
0
votes
1answer
32 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
34 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
29 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
41 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
36 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
12 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
19 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
71 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
40 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
28 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
44 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
34 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
57 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
38 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
60 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
30 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
130 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
24 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 ...
0
votes
0answers
40 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
81 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
29 views

ROC change after variable selection with glmnet

I was using glmnet in caret to select important variables. The code is like ...
0
votes
0answers
51 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
20 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
17 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
128 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
77 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
162 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
73 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
276 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
92 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
28 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
102 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
212 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; ...
0
votes
1answer
230 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
75 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
42 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
108 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
63 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
116 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, ...
0
votes
0answers
51 views

How is variable Importance using varImp (caret Package) calculated when doing repeated cross validation?

I was wondering how variable importance is calculated for repeated cross validation when using the function varImp from the caret package in R. I assume, the importance for a a 5 Fold CV is simply ...
2
votes
0answers
47 views

Comparison of models with transformed dependent variable

I want to check if transforming the dependent variable positively influences the model performance. For example, I have built two models using the caret package. ...
0
votes
0answers
31 views

Predict Soccer Match with empty variables in test set

I have a dataset with soccer results and a lot of meta data like corners, result in the half time, fouls etc. To traing the algorithm (in my case Support Vector Machine) is use all this variables. ...
0
votes
1answer
99 views

How is gbm package different from caret with gbm method?

I have a gbm problem and I am using the gbm package in R for it. But in most forums I see people using caret package for gbm. Is there any advantage of using caret instead of gbm package? If so, what ...
1
vote
0answers
19 views

Caret returns weird accuracy

I predict 9 values via Classification Tree based on 50 samples. For measuring the accuracy I use the function postResample(). It sais the accuracy is 80% but it ...
1
vote
0answers
46 views

Is R package caret relevant for multiple classes problem? [closed]

I am interested in a multiple classes problem with imbalanced classes and I was rather happy with the caret package so far but, I have some practical and ...
0
votes
0answers
31 views

Specifying probability threshold (CARET)

This seems like a fairly straight forward problem, but I am unable to find a resolution for this. I have just started using the CARET package, and I am trying to perform K-fold cross validation on a ...
0
votes
0answers
52 views

Understand outer cross validation with caret in R

I have a question that I cannot solve. Sorry if it is too naive, I am a beginner. I have a data set from wich I would like to predict a continuous variable Y based on a set of features. By now I ...