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

Need help with nearZeroVar function in caret [migrated]

when i run the following code all the variables in my dataset are removed, data <- data[, -nearZeroVar(data)] i am fairly new to R and my expectation was that ...
0
votes
0answers
3 views

When to use index and seeds arguments of train() in caret package in R [migrated]

Primary Question: After reading the documentation and google searching, I am still stumped as to what the situations are where it is advisable to pre-define resampling indices such as: ...
0
votes
0answers
7 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
0answers
9 views

Problem with R Caret J48 [migrated]

My code is below: ...
0
votes
1answer
68 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 ...
0
votes
0answers
2 views

Predict method of caret package gives error :Error in models[[1]]$trainingData$.outcome [migrated]

I am new to neural network and caret package and struggling with an issue. I am training the model using train() method of caret package with method='nnet', and getting model fit without any error. ...
0
votes
0answers
2 views

Error in train.default(x, y, weights = w, …) : final tuning parameters could not be determined [migrated]

I am very new at machine learning and am attempting the forest cover prediction competition on Kaggle, but I am getting hung up pretty early on. I get the following error when I run the code below. ...
3
votes
1answer
36 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
40 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
29 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
1answer
69 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
29 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
94 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
102 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
37 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
67 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
72 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
63 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
200 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
54 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
98 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
191 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
26 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
165 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
54 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
98 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
103 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
65 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
81 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
32 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
48 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
277 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
94 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
179 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
727 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
146 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
131 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
914 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
36 views

Predict feature combination with highest probability

I trained a Support Vector Machine with the caret package in R. My dataset looks the following: ...
1
vote
0answers
131 views

Running R caret in Python script [closed]

I am currently trying to transition from R into Python to streamline the process of working in web-based applications. I know that SciKit Learn has a ton of functionalities parallel to R's, including ...
0
votes
0answers
163 views

recursive feature elemination in R with caret

i work with R caret software package to select the most important features from some set of data. My response is a factor of multiple classes (e.g. nominal ...
0
votes
2answers
100 views

How to get classification probabilities when running glmnet

I am trying to figure out how to get class probabilitis when running a classification using glmnet. I have built the model and done predictions. But all I have is a huge matrix which I don't really ...
0
votes
1answer
142 views

Find variables selected for each subset using caret feature selection

I am doing feature selection using the command 'rfe' in the caret package (http://caret.r-forge.r-project.org/featureselection.html). This command uses a metric to find the optimal amount of variables ...
0
votes
1answer
76 views

Caret retraining of neural network after finding optimal parameters?

I am applying a neural network and logistic regression to a classification problem. In order to evaluate the performance of the two classifiers I'm using 5-fold cross-validation (roughly 800 samples ...
0
votes
1answer
330 views

Train / Validate / Test sets in Caret

I want to use caret to compare two different classification algorithms. For example SVM and Elastic net. I want to put aside some samples for test set and then use the rest of the samples for ...
1
vote
1answer
46 views

The differences between models via their resampling distributions.

The caret package offers the ability to make statistical statements about the performance of different models used for classification. According to the description, ...
2
votes
0answers
77 views

Interpreting varImp using a GLMNET model on a 3-level factor

(tried stackoverflow but told I may have better luck here). I am looking for some help interpreting varImp using GLMNET multinomial model on a 3-level factor variable. The plot and the data don't make ...
0
votes
0answers
44 views

Discriminant analyses with NIRS in R

I am working with a NIR matrix consistent of 134 rows (samples) and 1529 columns (wavelengths), from which I want to discriminate between two categories (species). I have successfully used the plsda ...