Questions tagged [caret]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
581 views

Use decision tree to learn precise classification rules: need accuracy of 1

I'm trying to use a decision tree algorithm to learn how general ledger transactions (10 digit code) are classified into revenue, expense, G&A et cetera without actually scripting every ...
0
votes
0answers
664 views

How to build regression models and then compare their fits with data held out from the model training-testing?

I have been building a couple different regression models using the caret package in R in order to make predictions about how fluorescent certain genetic sequences will become under certain ...
1
vote
1answer
4k views

R caret package and dummy variables

I've been trying to run boosted regression tree modelling on spatial data using the caret package in R. My predictor variables were all extracted from raster files on the environment, fx. soil type ...
1
vote
1answer
3k views

Multiclass Summary Metrics in R's Caret when predicting Probabilities

It's not clear to me, how the different summary metrics for caret's train function are defined, when I predict probabilities of a multiclass problem. Without a ...
1
vote
1answer
841 views

Calibrating Probabilities worse than Original Model even though better performance on calibration curve? (in R / Caret)

I'm currently working on the exercises of the book 'Applied Predictive Modeling' by Kuhn and Johnson (using R and caret) and am stuck at the issue of 'Calibrating Probabilities'. Exercise 12.3 shows ...
1
vote
0answers
1k views

Interpreting a PLS-DA model with Caret

I'm train a Partial Least Squares Discrimination Analysis with caret package. My dataset dimensions are 80K rows, 50 continuous explanatory variables, and one ...
16
votes
1answer
22k views

Caret glmnet vs cv.glmnet

There seems to be a lot of confusion in the comparison of using glmnet within caret to search for an optimal lambda and using <...
2
votes
2answers
1k views

Uncertainty in Binary Classification of New Data (via Random Forest)

We trained a binary classification RF and validated it with a test set of about N=300 entries. Here are the performance statistics: We now would like to classify a production set of a couple of ...
1
vote
2answers
308 views

comparing caret models with mean or median?

I am using caret to evaluate the classification performance of several models on a small dataset (190 obs) with two classes and just a handful of features. When I ...
0
votes
0answers
407 views

should i use cross validation for getting my final model in caret?

Hi I already use cv with grid search to find my best tune hyperparameter in caret. My question is, should I also use cv to get my final model, which I would use it to apply to the future data? To put ...
1
vote
0answers
369 views

How does caret split into CV folds? Can I avoid splitting randomly?

As I understand when setting trainControl(method="cv") in the caret package, my training set is is split into K folds for cross validation. How is this splitting ...
3
votes
0answers
1k views

Recursive feature elimination (rfe) performs poorly with binary outcome

Backward elimination with random forests does not work as expected in a simple test case with binary outcome and three continuous predictors. Below, I generate a binary outcome based on a single ...
2
votes
1answer
2k views

Is very high specificity and very low sensitivity attributable to mismatched class sizes?

I've generated a gradient boosting model using r-caret on data which I expect to have little to no predictive value. Class distribution is heavily skewed with ~15000 negative and ~1000 positive. Caret'...
2
votes
1answer
988 views

Decision tree does not overfit, why?

The following code trains multiple decision trees on synthetic data with varying complexity: ...
2
votes
0answers
60 views

Caret gives non-zero test R-squared with linear model without predictors: why? [duplicate]

NOT A DUPLICATE For the persons who marked this question as a duplicate of the post I mentioned in my original post: this is not a duplicate, as the correlation obtained with an intercept-only linear ...
3
votes
0answers
187 views

Why Does My Model Accuracy Go Down With More Data?

I am using R and the caret package. My code is very straight forward. ...
1
vote
1answer
3k views

R - SVM (radial) regression using tune() (e1071) - How to uncover influential features?

I have some questions regarding SVM and regression. 1) How to interpret SVM (regression) results. 2) How to make a proper plot (containing decent information) ...
5
votes
1answer
983 views

Reported Coefficients for Glmnet using Caret

I understand GLMnet standardizes the predictor variables by default before fitting the model. After fitting, the computed regression coefficients are then destandardized to allow reporting in their ...
2
votes
1answer
3k views

recursive feature elimination: why select subset based on AUC vs sensitivity/specificity

I have a small dataset of 25 observations with a classification variable (factor 0,1) and 82 features scaled to have values between 0 and 1. I used the rfe() ...
2
votes
0answers
307 views

Verifying rebalancing of unbalanced binary class Caret R

Still very new to R and have only enough statistical knowledge to be dangerous. But I'm stuck as to whether the following is acheiving what I need it to do. Project is a flight risk prediction using ...
0
votes
1answer
1k views

Elastic net beta coefficients using Glmnet with Caret

In glmnet using caret my the model is trained and tuned by cross validation on my training set. I have a 10 fold cross validation, over a grid of 10 alphas and 10 lambdas. The best model chosen by ...
-1
votes
1answer
1k views

randomize before creating folds using caret::createFolds?

Do I need to shuffle my dataset first if it does not appear randomly ordered before creating folds with createFolds in the caret ...
1
vote
0answers
100 views

Convert a classification model to a Field Programmable Gate Array (FPGA)

my search for a possibility to convert a generated model into VHDL to program an FPGA has no solution so far. The problem: caret -> Training -> Modell -> Modell.rds -> Modell.xml (PMML) --?--> VHDL-...
1
vote
0answers
1k views

r - odds ratio and glmnet [duplicate]

I have this r code using caret and glmnet, and it's intended to export a table with values. I've been asked to include odds ...
1
vote
1answer
3k views

Predict longitudinal data with machine learning in R

I am currently working on a prediction model from which the data is longitudinal data/panel data/cross sectional data. The data contains multiple companies for which I have a response variable and ...
3
votes
2answers
4k views

Should logistic regression models generated with and without cross validation in the caret.train function in R be the same?

I am working with the Titanic dataset and trying to use logistic regression in R to predict survival. The simple approach I tried was to just use the glm function with binomial family and logit link ...
4
votes
1answer
3k views

KNN Imputation: Do you use the training preProcess on both training and test sets?

I understand that you want to impute missing values separately for training, testing, and ...
2
votes
1answer
461 views

Feature extraction with k-fold elastic net - what is the test data?

I am trying to select features and develop a predictive model. Imagine I run a elastic net regression where lambda > 0. There are ten predictors, and the coefficients for five of those predictors is ...
2
votes
0answers
1k views

Learning curve of random forest in caret

I have data with about 1250 rows and 97 features. Using random forest for classification in caret R package, I've trained a model and now, I want to plot the learning curve using the ...
4
votes
1answer
5k views

SMOTE sampling in caret package in R

when using caret packge in the trainControl you can use "smote" sampling. what is the default parameters the train in caret are using for smote?? parameters such as: perc.over = 300, k = 8, perc....
1
vote
1answer
780 views

why Caret glm prediction RMSE is different

I am using caret glmnet to do a stock prediction project. Since I need to calculate RMSE, I use getTrainPerf(mod)$TrainRMSE to get the RMSE . However, when I use predict to get the prediction value, ...
1
vote
1answer
316 views

Why Sens and Spec for my testing set are worse than in my fit model?

I am using R caret::train for creating my model with imbalance data: ...
2
votes
0answers
3k views

logic of resamples function in caret R package

The caret R package includes functions to compare models via their resampling distributions. Specifically, it prescribes fitting multiple models using the same resampling profiles (i.e. same versions ...
4
votes
1answer
2k views

Approximation of a quadratic function with neural networks

I've set a simple function (y = x^2) to generate data to be used to train a neural network. The goal is to do predictions with new data. I've been trying to play around with the parameters of the ...
1
vote
1answer
798 views

Cross-Validated Resampling Statistics in Caret

I'm confused about the resampling statistics obtained via the train() and trainControl() functions in R's Caret package. My goal is to perform cross-validation on a machine learning model for a time ...
1
vote
0answers
2k views

What is the formula of varImp in R?

I'm using varImp function(caret package) in R to get importance of variables and to select variables. I know how can i get result. This is my code and result. ...
0
votes
1answer
349 views

Is it possible to run multiple sampling methods in caret package in the same training model (R)? [closed]

I'm training a random forest model to predict a categorical outcome. Is there any way I can make the model apply four methods of sampling without having to write four separate codes (one for each ...
4
votes
0answers
964 views

Elastic net: Calculate 1 standard error of lambda (lambda.1se) via caret or by hand [closed]

I try to tune alpha and lambda.1se (the largest value of lambda such that the error is within 1 standard error of the minimum) for an elastic net. In the ...
5
votes
1answer
12k views

Tune alpha and lambda parameters of elastic nets in an optimal way

I am trying to tune alpha and lambda parameters for an elastic net based on the glmnet package. I found some sources, which propose different options for that ...
0
votes
0answers
308 views

Neural network selecting features,layers and neurons

So I'm experimenting with a feed forward network, I'm trying to learn how to use neural networks, and I'm some what confused when it comes to selecting features, hidden layers and neurons. I have 2 ...
2
votes
0answers
93 views

How to I model corresponding features in caret

I am trying to build a binary-outcome prediction model wherein the features correspond to each outcome, for example my headers might be: ...
1
vote
1answer
482 views

After using cross-validation with PCA regression, what weights are then used for the external test set?

Based on this answer, and following the Applied Predictive Modeling text, I am running the following 10-fold cross-validated PCR analysis: ...
0
votes
1answer
22k views

Decision tree : train() method parameters caret package [closed]

I am working on a UCI repository's data set. I tried implementing a decision tree in the R programming language using the caret package. ...
1
vote
1answer
1k views

Why does randomForest returns an overall value for variable importance instead of one value per class? [closed]

In my training dataset I have two classes. I have run rf using the following code ...
2
votes
1answer
1k views

filterVarImp - Caret Package [closed]

I was trying the filterVarImp function in caret package. While the outcome was categorical we get ROC as the importance measure. ...
1
vote
0answers
10k views

Warning in caret glm model - prediction from a rank-deficient fit may be misleading

I’m trying to use caret for glm model: ...
1
vote
0answers
880 views

rfe function in the caret R package and external resampling validation implementation

Based on an excellent and very useful discussion on a previous question i posted (How can I use synthetic data to validate my classification model?), i would like to ask a very specific question about ...
1
vote
0answers
6k views

Variable selection with elastic net with R (glmnet, carret) [closed]

I have a matrix of 40 observations and 747 variables, which are frequencies with a certain number of zeros. My observations are divided into two groups, resume in the vector "rep_pdrp". I want to ...
3
votes
2answers
1k views

gbm with caret when tuning grid has n.trees [closed]

While using caret package to tune a gbm model, suppose the tuning grid has n.trees=c(100,200)...
1
vote
0answers
430 views

How to report average error rate/performance/error metrics from train function in R package caret regarding the hold-out samples from cross-validation

Through R and based on a microarray gene expression dataset (60 samples in total-30 cancer and 30 control samples) and R package caret, i have performed a feature selection regarding a binary ...

1
3 4
5
6 7
10