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
0
votes
1answer
37 views

How do I report results of an internal validation in Caret?

I have the following question. In a machine learning project I have to solve a regression and a classification task. See also: Hold-Out VS Cross-Validation - R caret For this I have about ~650 cases ...
0
votes
0answers
16 views

How does caret measure Accuracy and Kappa?

I have trained a logistic elastic net regression using caret package and the method "glmnet", with trainControl set to repeated cross-validation. I don't know how to interpret the Accuracy ...
1
vote
0answers
11 views

how do I perform permutation testinging for a prediction model developed within caret package (R)?

I'm fairly new to data science/StackExchange, so please excuse any faux pas I'm trying to perform permutation testing for a chosen ML algorithm (an elastic-net logistic regression) to derive a p-value....
0
votes
0answers
31 views

Clarification on r caret package confusionmatrix

I just want to make sure I'm understanding the "confusionmatrix" function in the "caret" package correctly. Looking at the worked example found here: https://rpubs.com/dtime/...
0
votes
0answers
34 views

How to get probabilities from KNN with cross-fold validation using caret::train in R

I am confused about the output of train() with knn models in R. My code below uses the Caravan data set, which comes included in the ISLR2 library: ...
0
votes
0answers
13 views

How do I access the p-values of individual predictors using caret::train?

I can't figure out how to access the p-values for my predictor variables after using k-fold cross-validation with caret::train. Does anyone know? Below is an example using the Boston data set that ...
0
votes
0answers
41 views

Recursive Feature elimination for Xgboost and SVM in R

I would like (and need) to use RFE for a dataset with many predictors. Some of them are correlated but I would like the model to pick the best choice. It is a classification problem and I will ...
0
votes
0answers
68 views

R Caret - Random Forest with repeated CV

I am currently struggling to explain the combination of bagging and cross-validation. I am aware of what each does separately but I have difficulties to explain how they are combined (if at all). For ...
0
votes
0answers
8 views

Does Breiman's randomForest function in R use Gini score or entropy score or Classification Error rate to decide the splits? [duplicate]

I have read the R documentation on randomForest but I could not find anything about Gini or Entropy in it. Is there a way to direct the train function of caret to use Gini score?
2
votes
1answer
69 views

Highly Correlated Datasets - Why and What Next?

I've got three datasets (of different biological data) that are highly correlated - such that if I use the typical findCorrelation from the ...
0
votes
0answers
43 views

How does glmnet in caret choose the values of lambda and how does it compute coefficients of the model?

I have a question that I've been struggling with. My students are asking me, but I can't figure it out myself. When I train LASSO regression in R caret, I use the method "glmnet" and a grid ...
0
votes
1answer
77 views

Best model (set of predictors) for my data?

I'm exploring some ML strategies using caret package. My goal is to select best predictors and to obtain optimal model for further predictions. My dataset is: 75 ...
0
votes
0answers
29 views

RFE/SBF helper functions in Caret package?

I'm new to the Caret package in R. I am learning the "rfe" and "sbf" functions in the caret package. I was able to run "rfe" and "sbf" for linear regression, ...
0
votes
0answers
7 views

standard deviation of the model R2 in LOOCV in caret

I am performing a LOOCV linear model and I got the parameters R2 and RMSE, but I was wondering if there is a way to calculate the standard deviation of the model R2. I tried to do it in the same way I ...
0
votes
0answers
10 views

Performance of random forest - differing results for MLeval and what to use?

I am building a random forest model using R and caret, doing cross-validation to tune mtry. This is within a Shiny app and I supply some input parameters first: ...
0
votes
0answers
167 views

K-fold Cross Validation for ridge regression model evaluation with specific lambda value in R

I have identified the optimal lambda for a ridge regression model using k-fold cross validation. However now I want to use k-fold cross validation to evaluate the model performance on different ...
0
votes
0answers
74 views

Caret classifying above chance on randomly generated data

I am attempting to compare a few methods for multi-class classification using caret: 'multinom' (logistic regression), 'nnet' (neural net), and 'svmPoly' and 'svmLinear' (two types of support vector ...
0
votes
0answers
12 views

Estimate the optimal complexity parameter in CART by using grid search

In rpart I estimated the complexity parameter to which it is convenient to prune the tree. I used the grid search and the functions of another package, ...
0
votes
0answers
15 views

How to plot ROC and Recall-precision curves for this obtained data

Good afternoon , Assume we have this obtained data : ( I had trained a SOM map from scratch then i used a number of epochs, Each epoch consist of a number of iterations ) : ...
1
vote
0answers
58 views

choosing most important predictors for logistic regression

I have a dataset of cars with price label as binary outcome including "affordable" and "costly". I aim to ...
0
votes
0answers
65 views

R2 function in caret is giving an NA output when I compare predictions with actual values in R

I have a linear regression model which regresses house sale_price on a bunch of properties of the house: lm1 <- lm(sale_price ~ ., data = train_new) I've ...
0
votes
0answers
145 views

XGB Early Stopping and Caret - R

I am using caret to train an xgb model. What I'm confused about is the difference between these two scenarios (identical parameters & cv unless otherwise stated): 1. Give caret::train() a tune ...
2
votes
0answers
49 views

How to determine the correct amount of oversampling (in regression)

For my regression problem I splitted my dataset into a stratified train- and testset (70:30) and I now want to train my models (random forest, gbm, logistic regression) using the trainset. The dataset ...
0
votes
0answers
69 views

tunegrid not working with neural networks in caret

I am wanting to build a neural network classifier using the caret package. I have specified a tunegrid with some hyper-parameters that I want to test to get the best accuracy. After I run the model, ...
1
vote
1answer
272 views

Caret "Metric RMSE not applicable for classification models" when data is continuous

I am running into an error trying to train a caret model with method='glmnet.' My data is continuous and I am trying to do a LASSO regression, but the existence of a 0 for one of the observations is ...
0
votes
0answers
21 views

Weights in Caret train

I would like to know more on the weights parameter in Caret train as I could not find any thing concrete from Caret documentation. Whether the weight indicates cost sensitive learning by engaging ...
0
votes
0answers
40 views

How variable importance for decision tree classifier in `caret` is estimated?

I trained a decision tree classifier by means the package caret, This is the code: ...
0
votes
0answers
6 views

How to choose important features in random forest when there is conflict between accuracy and node purity

In random forests, how to select the most important feature when the features bring different levels of node purity and accuracy. In the graph below, one feature may help to significantly improve the ...
2
votes
0answers
30 views

Using cross-validation for model selection and model comparison

Let us suppose that we have two classifiers: SVM and CART. For each one of them, a set of hyperparameters is considered (C=0.001,0.01,... for SVM cp=... for CART). The question is, can I use k-fold ...
2
votes
1answer
36 views

Why do the results of LASSO regression differ after removing uninformative variables in glmnet?

I am researching therapy response of melanoma patients based on a number of approximately 80 features with a very small sample size of 60 patients. To eliminate features that do not contribute to the ...
0
votes
0answers
24 views

Classification problem. I have issues with overfitting/leakage, i.e. sensitivity in training is 1.0. How do I fix this?

I have a consumer dataset (size: 10200x180), I am using this to develop a training model to predict consumers who would provide a referral. I have done the following to set the model. Cleaning: I have ...
1
vote
1answer
56 views

Unreasonable bias when using nnet (R package caret) for time series forecasting

I have been trying to forecast a time series in a regression-like setting using neural networks (nnet method in R package caret)....
0
votes
1answer
19 views

ML test accuracy higher than training? Small unbalanced samples were stratified by class

My background is in ecology, it is common to have smaller sample sizes and class imbalances and ML approaches are still increasingly adopted. My specific dataset: training set is 49 sample, my test ...
0
votes
1answer
270 views

Impute missing values of dummy variables, using R's {caret} package: predicted values in between {0;1}?

I'm using {caret} to impute missing data resulting from non-response to survey questions. All of these variables are defined as numeric, though most are dummies. ...
0
votes
0answers
54 views

How to perform Multiple Imputation (MI) for longitudinal survey data, using {caret} in R?

I have a large dataset comprising survey responses throughout a time period of three to four decades (or in other words, slightly above 20 waves). Keep in mind that these are longitudinal data and not ...
1
vote
0answers
55 views

Extreme collinearity for Random Forest?

My data have 450 observations and 2200 predictors that I want to use to train a RF model to classify 4 classes. However, about 2165 of the predictors are very highly correlated to each other. The way ...
2
votes
1answer
436 views

Variable Importance for Caret Random Forest Regression

I have trouble understanding the exact meaning of the feature importance scores in caret for RF regression. As you know there are many potential importance measures for RF. However, there is no clear ...
0
votes
0answers
70 views

Interpretation of AUC - ROC curves with a Binary Predictor

I have data like this: ...
0
votes
0answers
17 views

Machine learning methods for filtering noisy data

I have my data (hear beat) cleaned up with the appropriate filter, however, they are still noisy and need to extract a clean pattern. Which is the best algorithm for this purpose? I have also clean ...
0
votes
1answer
393 views

Model building with 10-fold validation

I have yet to find a sufficient and succinct answer regarding model building with 10-fold cross validation (in this case, using Caret). I've found responses here, for instance: https://stackoverflow....
1
vote
1answer
82 views

How to manually calculate predictions of kernlabs SVM

I am trying to manually replicate the predictions of kernlabs SVM (polynomial & radial kernel) using caret. Here is the code to fit the model: ...
1
vote
1answer
166 views

How many models does caret::trainControl() actually train?

I searched around CV and the caret documentation but couldn't find an answer to this. I'm using caret in R to tune some random forests for classification trained ...
2
votes
1answer
370 views
0
votes
1answer
418 views

Cross-validation using Caret in R: Why are coefficients from FinalModel identical to those from lm()?

I think I must be missing some fundamental part of the logic of cross-validation, or machine learning in general. Using the caret package in R, I ran a repeated k-...
2
votes
0answers
113 views

Which R-Squared formula is used in carets' k-fold-cross validation function

I am currently trying to implement a linear model and calculate some out-of-sample accuracy metrics while using k-fold-cross validation. I try to do this using R's caret package, so this question ...
1
vote
0answers
49 views

Drop unused parameters from model?

I have trained a model using caret's train function in R (LASSO logistic regression with glmnet, repeatedcv). The goal is both feature selection and getting the model. With the preferred lambda, LASSO ...
1
vote
0answers
35 views

KNN and Classification Factor

I'm studying the KNN algorithm and its application on R. If I correctly understood, KNN is a supervised algorithm able to classify an unlabeled item according to the predominant belonging class in the ...
2
votes
1answer
453 views

What really is 'glmnet' when used in caret in R for binary classification?

like lasso and ridge, elastic net can also be used for classification by using the deviance instead of the residual sum of squares. This essentially happens automatically in caret if the response ...

1
2 3 4 5
10