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
10 views

Prediction for non-negative data using PLS/alternative

I am currently using PLS (the set of predictors are quite highly-dimensional) to predict a particular variable, $age$, and I am using Caret's train implementation using the pls method: ...
0
votes
1answer
18 views

Preprocessing via PCA in Caret, then fitting PLS

I am dealing with quite highly-dimensional data, and am using (in R) Caret's preprocessing 'pca' method to reduce the dimensionality. However, dependent on the number of components I choose, I seem to ...
0
votes
1answer
21 views

Which parameters to tune in CART?

I am using caret package in R to train CART model. train function seems to tune only the complexity parameter (which in a way determines depth of the tree and number of terminal nodes). Is this ...
0
votes
1answer
12 views

Lattice formula syntax for 'calibration' function in caret

I would like to use the function 'calibration' from the caret package to produce calibration plots for a few classifiers that I have. Unfortunately I am having trouble understanding the documentation ...
1
vote
1answer
32 views

Naive Bayes Classifier in R with class weights

I'm searching for a Naive Bayes classifier in R where I can add a paramter for class weights. I need this, because my data is highly unbalanced. Eg.: Class1: 1000 examples Class2: 800 examples ...
1
vote
1answer
35 views

One class SVM with caret in R using cross validation

I am using one class SVM to train and predict anomalies. I would like to train the model using cross validation in an easy way as I have done with a multiclass SVM with caret in R. Now, I train the ...
2
votes
1answer
96 views

How to create a data partition in R using categorical and numerical columns?

I'm using the createDataPartition method of the caret package as following: ...
3
votes
3answers
73 views

Do we have to fix splits before 10-folds cross validation if we want to compare different algorithms?

I work with R and let's say that I have a train set and a test set. I want to test different algorithms (for example neural networks and svm). I will perform a first 10-folds cross validation on my ...
0
votes
0answers
43 views

Running repeated cross-validation for multiple models using same dataset (caret package)

I'm currently using the train() function in the caret package to run 10-fold repeated cv on a random forest model. I would also like to explore other statistical and machine learning models for use ...
1
vote
2answers
39 views

Which data split should I use to determine cutoff point for classification?

I'm building a classification model using the caret package. I'm splitting my dataset in train and test (80/20) and training using 10-fold cross-validation repeated ...
0
votes
2answers
34 views

Which data transformation can improve the performance of MLP neural networks for classification?

I am trying to fit several MLP neural networks models with a single hidden layer using the caret R-package. My main concern now is in the preprocessing step. My train data features (16 in total) are ...
1
vote
0answers
65 views

Problem in passing parameter 'maximize´ through to xgbTree from caret train function [closed]

I am using train in caret package to train a xgbTree model. I want to use the early.stop.round parameter of ...
0
votes
1answer
102 views

Class weights in caret

I'm using the R package caret to generate classifiers using a variety of different models on an imbalanced dataset. To overcome the class imbalance problem, I am using the "weights" parameter in the ...
4
votes
0answers
99 views

How to interpret caret's variable importance and feature selection plots?

I am having some problems understanding the variable importance and feature selection graphs from ...
0
votes
1answer
61 views

Using partial AUC as Caret metric for cross-validation?

I'm evaluating a grid of tuning parameters using Caret with metric="ROC" for cross-validation. Is there any simple way to use as metric the area under the curve for an specified interval of the ROC ...
0
votes
1answer
43 views

How can I use negative binomial regression with caret?

I'd like to use negative binomial regression with caret. However in the list of supported models I can't find it. I tried to use: ...
0
votes
0answers
27 views

Error Output - Wrong model type for regression

I am trying to constructs an Learning Vector Quantization (LVQ) model. ...
1
vote
0answers
43 views

Pass custom weight function to 'kknn' model in Caret package

I am working on school project, where I'm trying to implement improvement for weighted kNN in CARET package. I basically need to replace standard 'weight' function used in KKNN model to something more ...
0
votes
0answers
38 views

Feature selection + classification in Caret

I'm using Caret to apply a bunch of different machine learning algorithms for phenotype prediction from gene expression data. With about 20,000 genes, I'd like to perform filter feature selection ...
1
vote
1answer
71 views

Most Parsimonious Elastic Net Model - choosing $\alpha$ and $\lambda$

How do I calculate which Elastic Net model is the most regularized/parsimonious? I am recreating GLMnet in another language as an exercise. I want to do a grid search over several values of alpha and ...
1
vote
0answers
41 views

Formula to derive probabilities when using 'gbm' method through 'caret' package in R

I am training a classification problem by 'gbm' algorithm through 'caret' package in r.The response variable is a yes/nope type. Here 'objmodel' is the model I trained through method='gbm' and package ...
1
vote
1answer
191 views

Area under ROC curve for random forest

Does the area under ROC curve depends on which class is defined as default positive class by the random forest model? I am using ...
0
votes
1answer
85 views

Predictions for rpart model require more variables than shown in the classification tree

Using rpart from the caret package, when plotting the final model I get a classification tree that seems fairly simple (6 variables shown in tree). However, when I request the final variables from ...
0
votes
0answers
117 views

Caret - Changing tuneGrid gives different results for same parameters

I'm having an issue training a GBM model in caret. I'm quite new to all of this, but I'll try to explain things as best as possible, but please let me know if you need any further info. My code looks ...
0
votes
0answers
106 views

rpart model has zero splits after using caret's train

I am using rpart to get a classification model for my data but I do not know how to allocate the bucket size so as to avoid getting an overfitted or underfitted model. To get the optimal bucket size, ...
0
votes
0answers
54 views

Clustered bootstrap for multilevel data with caret train in R

The clustered bootstrap would be appropriate for assessing predictive performance of a model with multilevel data where, for example, students are nested within schools such that there is a non-zero ...
0
votes
0answers
98 views

Caret feature selection [RFE] yields different features depending on reference level of two-class dependent measure

I'm using RFE from the caret package in R to select variables to be used in a linear discriminant analysis. The outcome is a binary factor, but depending on which level of the factor is used as the ...
2
votes
0answers
159 views

Isn't caret SVM classification wrong when class probabilities are included?

*Please note this question is about the Platt probabilistic output and SVM class assignment, not about the code or the package itself. It just happens to be the code where I stumbled on the issue. In ...
2
votes
1answer
61 views

How do I rank coefficients returned from a ridge regression?

I am running a ridge regression using GLMNET (alpha = 0) and would like to interpret the coefficients returned. I know there isn't really a significance test for this, but can I at least rank the ...
0
votes
2answers
32 views

How to use a varImp function to select features from training set?

Till now I have used a following flow for training a random forest model. ...
0
votes
0answers
42 views

predictions with caret and logistic with restricted cubic splines

I am fitting a logistic regression using RMS's R package restricted cubic splines and within the caret package infrastructure. I fit the model well, but when I ask the model to predict new samples it ...
0
votes
1answer
171 views

r - choosing correct nnet model

Language: R Background data = 1800 observations (rows) x 5 variables (columns) I am using library(caret) and training regression models using ...
0
votes
1answer
92 views

Extracting Standard Errors Caret Model

I have tuned a glm net model with caret using the train function. I am trying to extract the coefficients and standard errors of those coefficients for the best tuned model. Following this CV post I ...
0
votes
1answer
87 views

LOOCV $R^2$ higher than regular $R^2$ in RF

I am working with RF and the caret package, and I am having a confusion because sometimes the LOOCV $R^2$ is higher than the regular $R^2$. Is it right? How can I interpret this? Here an example ...
0
votes
1answer
40 views

Including class probabilities might skew a model in caret?

I've been training SVMs over some particular data for some time. I was quite happy with the Kappa and Accuracy measures caret gives, but adding some other metrics was not a bad idea at all. The thing ...
0
votes
1answer
83 views

what is the meaning of RMSE in caret::train [duplicate]

I'm confused by the exercise solutions of the book Applied Predictive Modeling. In https://github.com/topepo/APM_Exercises/blob/master/Ch_06.pdf at the beginning of page 4 ...
0
votes
0answers
109 views

When converting categorical data to numeric in R is it important to use the same value to numeric mapping across columns

If I have a dataset consisting of categorical data and I want to see if there is a correlation between the values I will need to convert it to numeric in order to run corr() in R but I have a few ...
1
vote
0answers
79 views

Plot the training and cross-validation deviance [closed]

I'm running the gbm model using R caret package. To tune the model I used 10-fold cross-validation. I tried to get the following plots to guide my model tuning but didn't succeed: Plot the training ...
0
votes
0answers
192 views

caret: using random forest and include cross-validation

I used the caret package to train a random forest, including repeated cross-validation. I’d like to know whether the OOB, as in the original RF by Breiman, is used or whether this is replaced by the ...
0
votes
1answer
108 views

R caret and NAs

I very much prefer caret for its parameter tuning ability and uniform interface, but I have observed that it always requires complete datasets (i. e. without NAs) even if the applied "naked" model ...
0
votes
1answer
43 views

Model validation using features (R)

I'm trying to create a classification model in R, at the moment i'm using 10 fold CV (using the train function of caret package) ...
0
votes
1answer
104 views

r, caret - preprocessing range vs scale

I noticed that caret preprocessing has a range method to "scale predictors between 0,1". When does this option become more desirable than center and scaling?
1
vote
1answer
324 views

Explain “validation” process of repeated k-fold cross-validation?

My understanding is currently that the canonical repeated k-fold cross-validation (CV) process might do the following if $n=100$ observations in sample, $k=5$ folds, $i= 10$ iterations (see iteration ...
0
votes
1answer
124 views

Comparing classification algorithms using cross validation and caret's train

I am having issues understanding some concepts of algorithm comparison/parameter optimization/cross-validation in R Let's say I want to compare two classification algorithms, such as Random Forests ...
0
votes
1answer
199 views

Feature selection in GBM

I am using gradient boosting (caret package in R). As far as I understand, the feature selection is already included in this package. However, I slightly ...
0
votes
0answers
192 views

using caret and glmnet for variable selection

Im using the caret and glmnet package for variable selection. I only want to find the best model and the coefficients and use ...
1
vote
1answer
57 views

Random forest regression on a given interval

I'm training a random forest regression model on a dataset that consinsts of values in the range of 0-50. It has many values close to zero and only 500 observations. The R^2 is also small, about ...
0
votes
1answer
238 views

Change settings in the prediction model (caret package)

I am using the package caret and GBM method for my predictions. ...
0
votes
0answers
84 views

Effect of Alpha and Lambda in Glm Net on Prediction Probabilties in Caret

I've run a number of different glm net classification models using Caret. I was trying to optimize by CV ROC and so tried a number of different tuning grids. Looking at several models with similar ...
2
votes
0answers
1k views

Different results from randomForest via caret and the basic randomForest package

I am a bit confused: How can the results of a trained Model via caret differ from the model in the original package? I read Issue on prediction with FinalModel of RandomForest in R using the CARET ...