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
0 answers
3 views

Caret: ordinal models with VGAM library

I started to look into the students performance dataset: https://archive.ics.uci.edu/ml/datasets/Higher+Education+Students+Performance+Evaluation+Dataset I would like to train two models with caret ...
user avatar
0 votes
0 answers
37 views

Bagging with SVM and Neural Networks in R with caret

I am fairly new to the bagging technique and Caret's bagControl() as well as bag() and am currently trying to build an ensemble ...
user avatar
  • 1
0 votes
0 answers
15 views

How does lmStepAIC work in caret when using cross-validation?

In caret package in R , one can train linear models with stepwise selection based on AIC, using this function : ...
user avatar
  • 253
0 votes
0 answers
20 views

mgcv GAM models in R package caret - how to interpret output

I am attempting to evaluate two GAM models I developed in mgcv via leave-one-out cross validation in the caret package. I am a newbie to both GAMs and cross-validation. For the purposes of this ...
user avatar
  • 11
0 votes
0 answers
11 views

How to interpret the output of compare_models in R?

I have been trying caret library, specially the part to compare two or more obtained models. Some of the articles that I read use the compare_models function. As I see on the documentation, it runs a ...
user avatar
0 votes
0 answers
25 views

Sample size problems during Random Search Hyperparameter Tuning

I would like to apply the XGBoost algorithm to my data using the xgbTree method in caret. My ...
user avatar
  • 1
1 vote
1 answer
40 views

Compare survival between two unbalanced groups

Briefly, 184 patients are included in my analysis. I have one variable that seperates 184 patients into two groups. 173 are in group 0 and 11 are in group 1. I need to compare the survival between ...
user avatar
  • 13
0 votes
0 answers
15 views

How should we divide the data into training and testing sets in a specific way instead of probabilities of 70-30%?

The dataset contains 5 stages of the disease. The respective blood concentrations are 12.5, 25, 50, 62, and 75 mg/ml. The intensity is measured at each concentration, which will be used as a response ...
user avatar
2 votes
1 answer
26 views

How to use R package caret to build a model and get the internal validation result?

I am a learner of R and machine learning. I don't really understand caret's train function. To make it simple, for example, I want to build a model and get the internal validation result. At the ...
user avatar
0 votes
0 answers
9 views

Problem predicting caret::train random forest ("rf") model [duplicate]

I´ve been working in a random forest model for credit scoring in R. I've trained a model using caret::train. My data "df_samples_rf" has the next ...
user avatar
1 vote
1 answer
27 views

Incorporate Weights/Offsets with Nonparametric Models

I am modeling pure premium in R. I have read that pure premiums are usually modeled using a Tweedie distribution (glm). There is generally an offset or weight added to the model, such as an exposure. ...
user avatar
  • 185
0 votes
0 answers
10 views

Predictors for Classification Models using caret in R

I have been reading several different resources on classification and I am finding conflicting information. Some literature says caret's train() function assumes all predictors are numeric and the ...
user avatar
  • 185
0 votes
0 answers
28 views

How do I determine what subset sizes to use for recursive feature elmination (rfe) in the R caret package?

I'm trying to use rfe in the caret package in R, but I'm not sure I understand how to choose the subset sizes. Is it just trial and error or am I overlooking something? For context: I have high ...
user avatar
1 vote
1 answer
128 views

How to interpret the output of caret::findCorrelation function?

The output I received after applying findCorrelation function from the caret package is: ...
user avatar
0 votes
1 answer
84 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 ...
user avatar
  • 11
0 votes
0 answers
78 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 ...
user avatar
1 vote
0 answers
44 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....
user avatar
  • 21
0 votes
0 answers
68 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/...
user avatar
0 votes
0 answers
102 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: ...
user avatar
0 votes
0 answers
55 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 ...
user avatar
0 votes
0 answers
128 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 ...
user avatar
  • 45
0 votes
0 answers
254 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 ...
user avatar
  • 1
1 vote
0 answers
82 views

K-nearest neighbor with kernel gives me the exact same accuracy with different initial conditions (R,caret)

...
user avatar
  • 43
0 votes
0 answers
9 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?
user avatar
2 votes
1 answer
137 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 ...
user avatar
  • 21
0 votes
0 answers
114 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 ...
user avatar
0 votes
1 answer
106 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 ...
user avatar
  • 55
0 votes
0 answers
61 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, ...
user avatar
  • 1
0 votes
0 answers
16 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 ...
user avatar
  • 21
0 votes
0 answers
15 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: ...
user avatar
0 votes
0 answers
351 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 ...
user avatar
  • 1
0 votes
0 answers
77 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 ...
user avatar
0 votes
0 answers
13 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, ...
user avatar
  • 187
0 votes
0 answers
23 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 ) : ...
user avatar
  • 113
1 vote
0 answers
121 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 ...
user avatar
0 votes
0 answers
166 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 ...
user avatar
2 votes
0 answers
87 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 ...
user avatar
  • 21
1 vote
1 answer
486 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 ...
user avatar
  • 13
0 votes
1 answer
73 views

In trainControl of Caret, how to keep a specific proportion of samples for cross validation?

Sample Data: ...
user avatar
2 votes
0 answers
50 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 ...
user avatar
2 votes
3 answers
108 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 ...
user avatar
  • 23
1 vote
1 answer
88 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)....
user avatar
  • 13
0 votes
1 answer
24 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 ...
user avatar
0 votes
1 answer
434 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. ...
user avatar
1 vote
0 answers
57 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 ...
user avatar
  • 123
2 votes
1 answer
809 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 ...
user avatar
  • 41
0 votes
0 answers
23 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 ...
user avatar
  • 11
0 votes
1 answer
466 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....
user avatar
  • 103
1 vote
1 answer
136 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: ...
user avatar
1 vote
1 answer
289 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 ...
user avatar

1
2 3 4 5
10