Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [caret]

Caret is an R package containing a set of functions that attempt to streamline the process of creating predictive models.

2
votes
0answers
21 views

Caret: gradient vs gam boosting

What is the difference between a boosted additive model (e.g. caret model: gamboost) and a general stochastic gradient boosting model (caret model: gbm)? A gradient boosting model is additive by ...
0
votes
0answers
11 views

What's the purpose of `tunegrid` in the caret package?

I am deciding the parameters for a random forest classification model. I am using the caret package and read, here, about the tuning grid. My understanding is that it helps determine the best values ...
0
votes
0answers
9 views

variable importance for multi-class classification using caret (penalized discriminant analysis")

I have data with three classes and have performed classification using caret (pda). My question is about interpreting predictors based on variable importance (varImp). In two class data, we get ...
0
votes
0answers
12 views

How does multicollinearity affect the feature selection process?

I have a classification problem with a modest number of records (approx. 10,000) and dimensions (30 dimensions, 25 are categoric and 5 are numeric). The response variable has two classes (T/F). I'm ...
1
vote
0answers
18 views

LDA Fit using Caret does not give Standard Deviation

I am following the steps outlined in this tutorial. I have followed along and running into an issue at step 5.3. The output of the LDA model gives me all the expected information, except the Accuracy ...
0
votes
0answers
14 views

How do I diagnose collinearity with rfe() from the caret package?

I have 12,000 records and I"d like to predict a two-class outcome. I'm deciding which predictors to keep and I'm having trouble with two problems. 1- I get an error message because I have categories ...
2
votes
2answers
84 views

Can the alpha, lambda values of a glmnet object output determine whether ridge or Lasso?

Given a glmnet object using train() where trControl method is "cv" and number of iterations is 5, I obtained that the bestTune alpha and lambda values are alpha=0.1 and lambda= 0.007688342. On ...
1
vote
0answers
30 views

Random forest vs Random Forest tuned with caret

Looking for some help please. I have used the randomForest package extensively and have been happy with its performance. I am currently writing a journal paper investigating match outcomes in sport, ...
0
votes
0answers
17 views

Linear discriminant scores using caret

I'm using the caret package in R to undertake an LDA. I'm having problems trying to extract the linear discriminant scores once I've used predict. The model is ... ...
0
votes
0answers
44 views

SMOTE and ROSE methods in CARET (R) do not work for balancing a multi-class dataset

SMOTE and ROSE methods in CARET (R) do not work for balancing a multi-class data set. Specifically, ROSE throws an error telling that it needs two levels. It means that it does not work for multi-...
0
votes
1answer
21 views

How to do backward subset selection on a random forest model for classification?

I'd like to identify the most predictive features for my classification model. I'm using this data. Here is a sample. This is my code. I'd like to use the predictors to predict loan status. ...
0
votes
0answers
11 views

Caret: Feature selection with Chi2 / f_classif

I try to classify texts which I have converted to term-document matrices before. I would like to perform feature selection to reduce the number of predictors. In Python, you can do this by means of ...
0
votes
1answer
42 views

SMOTE - What is the difference in sampling before or inside train() [closed]

I have an unbalanced dataset and would like to apply SMOTE to the training data. I can either do one of the following: Inside trainControl() add ...
0
votes
1answer
39 views

Differences in calibration plots for machine learning models

I'm using machine learning methods in R for descriptive regression modelling of a small dataset. I have fit random forest (randomForest), unbiased random forest (cforest) and boosted regression trees (...
1
vote
0answers
26 views

How to approach memory issues with up/down-sampling problem across millions of rows in database that can't be loaded locally? (class imbalance)

I'm faced with fairly typical class imbalance problem across a dataset with nearly 9MM rows (hard drive failures) that's not stored locally (it's in Postgres table; downloading a .csv of it is not ...
0
votes
0answers
51 views

how to extract rules from final model made by caret

I have a made cross-validation (k=5) by caret package using C5.0 method. I have 21 features and 7000 instances. The C5.0 trials default is 40. The problem is C5.0 made > 1600 rules over 40 trials, ...
0
votes
0answers
15 views

k-fold optimization in C5.0 algorithm

How can I do k-fold cross validation for C5.0 algorithm, I know caret package has createFolds function but I think in k-fold process we must do kind of averaging from all models. Because I didn't ...
0
votes
0answers
37 views

Using Caret is there a way to explicityly state what the true class is in binary classification?

I'm using caret + XGBoost to make binary predictions on a dataset. The data are very imbalanced so I'm using prAUC metric. My results using 5 fold cross validation are a prAUC of 0.99+ which is not ...
0
votes
0answers
33 views

caret chooses non-optimal RMSE?

I run a linear regression via caret / glmnet method with "RMSE" as metric. In the final model, caret tells me which values of the tuning parameters alpha and lambda were selected to minimize RMSE. If ...
0
votes
0answers
45 views

what does scale hyperparameter mean in svm polynomial kernel using kernlab in r

I'm trying to train my svm model with polynomial kernel. I'm using caret package with method ...
0
votes
0answers
37 views

How does Caret's PCA function work?

I've been reading through this question: PCA and k-fold cross-validation in caret package in R . In one of the answers, it was suggested to do PCA within the train function rather than before. However,...
0
votes
1answer
372 views

How can I one-hot encode a variable that has only 2 levels? [closed]

I'm trying to do OHC in R to convert categorical into numerical data. However R's caret package requires one to use factors with greater than 2 levels. Any idea how to go around this? I've searched ...
2
votes
1answer
152 views

Parameter tuning with vs without nested cross-validation

Disclaimer: This question has been inspired by this one, which is a good question but has unfortunately not attracted an answer that actually answers OPs question. Statistical models often times have ...
0
votes
1answer
261 views

dummy vs one-hot encoding - ML for prediction

I understand there is a lack of consensus in the difference (if any) between one-hot (k variables) and dummy (k - 1 variables) encoding from a k-level factor. The caret package seems to auto-encode ...
0
votes
0answers
57 views

Repeated CV evaluation with confidence intervals in R caret?

it occurs to me that there is a part of model evaluation that I have not understood yet. The problem that I am working on now illustrates the point well I think. I need to fit a model of >400 ...
0
votes
0answers
65 views

Difference between AUPRC in caret and PRROC

I'm working in a very unbalanced classification problem, and I'm using AUPRC as metric in caret. I'm getting very differents results for the test set in AUPRC from caret and in AUPRC from package ...
1
vote
0answers
30 views

Feature selection method based on target variable in R [closed]

I have dataset from 30 different features and a result variable. All the features have values like -1,0,1 and my result variable contains -1 and 1 , which 1 means record is healthy and -1 means ...
1
vote
0answers
96 views

Using An ROC Curve to Evaluate a model

I have a number of questions on the ROC curves when being used to evaluate a model. My understanding of them is they can be used to determine the probability cutoff when classifying a row in a dataset ...
0
votes
0answers
231 views

Train function metric option

I have a question based on the train function from the caret package. I am relatively new to ML and am a little confused. I am using the random forest algorithm attempting to predict a continuous ...
0
votes
1answer
301 views

How to prevent overfitting with regression using ranger (randomforest)

I use caret to train the model (on Boston dataset from the mlbench package). Here is the code ...
0
votes
1answer
173 views

Reverse CARET proProcess()

I did the following steps in my modeling using R: 1)applied preProcess(data, method = c("bagImpute")) function in CARET package and then encoded the data. 2)Used SMOTE to balance the data(because the ...
0
votes
2answers
194 views

Logistic Regression: multicollinearity and Kappa statistics

I may be wrong but from my understanding logistic regression requires there to be little or no multicollinearity among the independent variables, and yet Kappa statistics as part of postResample() ...
2
votes
1answer
289 views

Other distances than euclidean distance in knn [closed]

Suppose I want to fit a k-nearest-neighbour using caret package in R: ...
1
vote
0answers
167 views

Drawing ROC curves from RFE() training results in caret

I want to generate ROC curves using the training data and results from the rfe function in caret. I have managed to do this with the code below but there is some inconsistency between the ROC value ...
1
vote
0answers
143 views

How to use Elastic Net Model to Reduce Collinearity

I am using R to perform a linear regression with a dataset that has clearly correlated independent variables (collinearity). I am using the vif (variance inflation factor) function from the car ...
1
vote
2answers
456 views

Do I have to preprocess my new data for a prediction, if I have used preprocessing for building the model?

In this example preprocessing is used to construct a NN: ...
0
votes
0answers
202 views

Model ensemble with caretStack

I'm building a model ensemble with caretStack (package caretEnsemble). Here is a basic example : ...
0
votes
0answers
25 views

Sample size of each resample

I am calculating a performance metric based on the resamples obtained from cross-validation and bootstrap using the R-package caret: ...
1
vote
1answer
454 views

ridge and lasso models in caret with lambda=0

As far as I know, if I run a lasso model and a ridge model on the same data, and if i keep lambda=0, I'm getting the OLS. Then, how is it possible that I get different results? ...
0
votes
0answers
337 views

Calculate model accuracy confidence intervals from caret model object?

I am trying to generate 95% confidence intervals for the accuracy predictions on the trained data set using the caret package and interface. Some dummy code: ...
0
votes
2answers
711 views

Getting sensitivity and specificity from a caret model

I have trained a caret model using bootstrapping and the default metric (accuracy, since I'm doing logistic regression). Now I'd like to know other performance parameters for the trained model: ...
0
votes
0answers
307 views

Metrics in rpart decision trees

I am currently working with decision trees in R, I am using caret library. Source code of rpart can be found here: https://github.com/cran/rpart/blob/master/R/rpart.R I understand how decision trees ...
1
vote
0answers
88 views

R caret calibration function

I'm studying about calibration techniques and I'd like to use the CARET calibration function to examine the quality of my classifiers' probabilities. I read the relevant documentation, however I don'...
5
votes
1answer
961 views

mlr compared to caret

I’ve been using mlr a little to learn about machine learning, but recently found out about caret. The way I understand it is that both are wrappers to various ML packages, but have slightly different ...
0
votes
1answer
154 views

Why is my model so accurate when using knn(), where k=1?

I am currently using genomic expression levels, age, and smoking intensity levels to predict the number of days Lung Cancer Patients have to live. I have a small amount of data; 173 patients and 20,...
1
vote
1answer
258 views

Improve the precision of random forest for count data

I am trying to create a classification model that predicts whether a customer will enquire for a financial product based on some 250 independent variables. 98% of the variables are count variables and ...
0
votes
1answer
651 views

R caret ROC optimal cut-off in original values

I am new to using R-project, I started using the programming language due to the ease of cross-validation package caret. However, I'm stuck at translating the predicted probability values into the ...
0
votes
1answer
42 views

Predicting a Numeric value in Future Years

I have this data set, and I want to predict number of PTS beyond 2018: ...
1
vote
0answers
194 views

brnn r package (Bayesian Regularization for Feed-Forward Neural Networks)

I'm using the "brnn" package (Bayesian Regularized Neural Networks), in particular I run the train() function from caret package. My data are stored in a data.frame object and I run the caret function ...