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

“Error in seeds[[num_rs + 1L]] : subscript out of bounds” when using caret for creatng LVQ model? [closed]

I'm using caret package to create a LVQ model and select features on a dataset of 579 independent variable and 55 samples: ...
0
votes
0answers
19 views

Using Cross-Validation and regsubset for logistic /multinomial.(Caret/Leaps)

I've been reading some interesting posts about caret, and the function from leaps regsubsets; and i was wondering if i could implement a regsubset on a CV-trainControl from caret. https://rpubs.com/...
0
votes
0answers
18 views

Why is Rsquared smaller in whole sample than k-fold cross-validated?

I want to get a cross-validation $R^2$ for a linear regression model with one predictor to get a measure of how well my model predicts rather than explains data (in R with package caret). I assumed ...
0
votes
1answer
28 views

What does the featurePlot() function from the caret package actually do?

Just a quick example from Max Kuhn's book. ...
0
votes
0answers
17 views

Can I use caret RFE result for subsequent random forest with CV?

I've been googling and reading alot about my issue but couldn't find a clear answer. In order to prevent data leakage, I use caret RFE for feature elimination: ...
1
vote
0answers
20 views

How to apply svm to a dataset with a numerical (not categorical) dependent variable?

Context: I have some band values from a sentinel - 2 derived .tiff I now want to make a prediction regarding areas where i have no actual field data i.e. make a carbon map of sorts Libraries are: <...
1
vote
0answers
46 views

is a final model different from cross validation?

It appears that I have completely misunderstood cross validation for several months so I want your help clarifying the idea using an example rather than only theory from some great SE questions. My ...
0
votes
0answers
15 views

Make cv.glmnet select something between lambda.min and lambda.1se [migrated]

I'm training an Elastic Net model and am finding that lambda.1se is much higher than lambda.min, often the maximum lambda tested ...
1
vote
2answers
29 views

How does repeated cross validation go about 'averaging' model coefficients?

No matter how much I google, I cannot find the answer to this simple question. Say you do 10-fold, repeated (5x) CV logistic regression with elastic net regularization. For alpha you try ...
1
vote
0answers
11 views

Weighted observations for linear model [closed]

I have dataset with sale price of products in years 2015-2020. I would like use it to predict future sale prices. I would like to use sale year as a weight of observation (eg. for 2020-100%, for 2019-...
1
vote
1answer
17 views

How can I implement 5 times repeated 10 fold cross validation using the randomForest package ( instead of caret)?

I would like to eventually use the PIMP-Algorithm (Permutation Variable Importance Measure) in order to get p values for the variables' importance. However, the formula ...
0
votes
1answer
15 views

Difference Between Built-In Cross Validation Functions and Using Caret

I was wondering if someone could provide some insight on the pros/cons of using built-in cross validation functions like cv.glmnet (https://www.rdocumentation.org/packages/glmnet/versions/3.0-2/topics/...
0
votes
0answers
19 views

How to group factor levels for stepwise regression using caret

Using the train() function from caret in R, I'm trying to run a stepwise ANCOVA, but each level of my 9-level factor is being ...
1
vote
0answers
29 views

How to calculate variable importance for different models? is varImp() the solution?

I'm using caret's train() function for a binary classification outcome with different models (nb, knn, lda, qda, glm, rpart, rf). I'm using varImp() and plots to determine the importance of every ...
1
vote
1answer
15 views

Importance value (with varImp from carret package) for one of the two numerical predictors has value 100, how do I interpret this?

I'm using two numerical predictors to find an outcome, when using varImp (from the carret package) one of the predictors has 100 importance and the other 0. How should I interpret this?
1
vote
1answer
55 views

Why can't my ROC reach a low PPV?

I am creating a couple of models (RF, SVM, LR) and I want to evaluate all of them on a certain PPV (0.7). This question and this question helped me write my code: ...
0
votes
0answers
32 views

Multi-classification: low precision due to imbalanced classes in test data - what to do?

I built a multi-classification model with 3 result classes (XGBoost using R's caret-package): A, B and C. I undersampled my training data - so every class is equally abundant for training. The ...
0
votes
0answers
13 views

Kappa for More than Two Classes in R?

I am building predictive models in R using the oil dataset which has 7 classes. I am wanting to use Kappa for optimization since the classes are extremely ...
0
votes
0answers
5 views

Caret for model performing and tuning paramter

I would like to ask, if I could use cross validation in caret for tuning parametr lambda and also for evaluating model performance. If I use savePredictions="final" and also I will tune parametr, it ...
1
vote
1answer
60 views

Help testing the predictive quality of a binomial GLM (currently attempting using the “caret” package)

Hello world (sorry for the novel; if you read this, I appreciate it!), I'm running into a question that is probably a mixture of how to approach a problem of modeling and the technical difficulties ...
1
vote
1answer
59 views

LOOCV in Caret package ( randomForest example) - not unique results

I pose you my doubts: For what I know there is only a single way to perform a LOOCV for a model (i.e. testing each one of the N elements vs the model trained with the other N-1 elements). Namely, ...
0
votes
1answer
20 views

Caret GBM predict only produces 106 outputs while newdata has 403 rows… What's up?

I am training ML classifiers using caret to predict mortality in a clinical data set. Training with caret's gbm works well, but when I try to use predict, I get very strange results. Here is my code: ...
1
vote
1answer
63 views

Using caret::sbf to apply feature selection where features are selected over different threshold scores

I'm aiming to use caret::sbf to filter a large number of predictors before using different machine learning models to predict a binary outcome. I would like to filter for variables that are identified ...
1
vote
1answer
22 views

Predict different models from K Best models in Caret

I was wondering if there was a way to run predictions on the K best Models and not just the best Model in Caret. ...
1
vote
1answer
28 views

Expanding the Hyper-Parameter Search Grid in Caret

I was wondering if there was a way to expand the hyper-parameter search within caret package or with slight modification. For example, evtree can currently only take alpha in caret but the evtree....
0
votes
2answers
77 views

In a neural network, why can't there be more weights than the number of observations?

After having this exact same issue with caret, I arrived at this thread. However, I do not intuitively understand why this answer is correct. Why can't there be ...
2
votes
1answer
41 views

Predicted probabilities seem too low with Gradient Boosting Machine on `iris` data

I'm doing a test run of the Gradient Boosting Machine algorithm on the iris data with the caret package. ...
1
vote
1answer
36 views

What method does varImp.gam use in caret package in R?

I see that the caret package has support for gam objects for the varImp function. I was wondering if there was documentation about which method the function uses when gam is the input?
0
votes
0answers
64 views

Result reproducibility using time series cross validation with Caret in R

I'm using Caret package in R to train a Lasso regression on a time series dataset. My problem is that even if I set a seed before the ...
0
votes
1answer
109 views

Using caret::sbf to apply feature selection and classification

I'm aiming to use caret::sbf to filter a large number of predictors before using different machine learning models to predict a binary outcome. I would also like to optimise tuning parameters and do ...
1
vote
2answers
349 views

Multi- Class probabilities of Random Forest inside caret Model

Im facing a problem with the results of a multi-class random forest model. I want to use a) the predictions of the model and b) the class probabilities of these predictions for further work. I did a ...
0
votes
0answers
18 views

Techniques to account for differences in misclassification “cost” on variables other than the outcome

Suppose you're in a classic classification context: you want to predict whether a patient has a certain virus. You are working in multiple regions (let's say 2 for simplicity: Region A and Region B) ...
2
votes
1answer
61 views

R: caret (elasticnet): ridge regression: understanding the returned parameters

I wanted to play around with the ridge regression in caret (which apparently uses elasticnet), so I did two experiments: use the original data use the modified data where the values of ...
1
vote
1answer
76 views

Machine learning with univariate time series

I am trying to make predictions with daily data with time series in R. This time series is univariate and contains only data from sales from each 365 days in a four year period. My intention is to ...
0
votes
0answers
18 views

Can we compare class probabilities between different methods in caret?

I am using the caret package in R for binary classification and I want to compare different methods (e.g., random forest, SVM, ANN, PLS-DA...). I consider the class probabilities as a "certainty score"...
0
votes
0answers
12 views

Infer estimation accuracy from the percentage of number of trees voting for the majority class?

I am performing a classification with caret in R. With the predict()-function I can also get a percentage-output of the number of trees voting for majority class. In my case I have 4 possible classes ...
0
votes
0answers
174 views

R: interpreting output of caret::train( ) with method glmStepAIC

I am having trouble understanding the output of caret::train( ) with method = "glmStepAIC". Here is the sample code on the ...
1
vote
1answer
257 views

Knn using caret: how to specify k?

I'm using caret package to train a knn model with the following R code: ...
1
vote
1answer
39 views

How can I separate the overall variable importance values when using Random forest?

I implemented a random forest model in R using the package 'ranger' combined in 'caret' package with 10fold CV. My outcome is binary (0,1) and I have a couple numeric predictor variables. I used the ...
0
votes
0answers
29 views

R: Random Forest with count-data: hand it over as a quantitative integer or an ordered factor?

I am using the "rf" method as implemented in the caret package for R. In R you can differentiate between qualitative and quantitative variables. I am unsure how to view count-data. E.g. the number of ...
0
votes
0answers
22 views

Questionnaire to predict physical activity - scale?

We defined a questionnaire which gives great ICC, correlation, BA-plots etc. compared to the nowadays used questionnaires. We want to improve it a little more, but I can't find literature/method for ...
1
vote
0answers
35 views

Plot Actual vs Predicted SVM Regression

I am building an SVM regression model using caret package, however, I am not sure what is the best approach to plot predicted vs actual values. I have the code below. You can reproduce the output by ...
2
votes
1answer
50 views

PCA in R: different results for caret and prcomp

Can some tell my why the preProcess function from the caret packages gives a different result than the ...
2
votes
1answer
23 views

How do I set reasonable initial gridsearch parameters?

I'm training a number of models with the aim of identifying those which will perform well on my data. As such, I'm using a lot of models that I am unfamiliar with, and they all have their own tuning ...
0
votes
1answer
43 views

Minimum number of obs. for machine learning and training/test sets?

Are there a minimum number of observations for ML techniques (classification, regression) in psychology/cognitive neuroscience? In particular for training and test datasets? I found this article for ...
0
votes
1answer
40 views

R-Caret : Not-meaningful class probabilities and AUC value

I am very new to ML therefore my question might be primitive. I am working on a binary-class problem. The response (target) variable is occurrence : a factor ...
0
votes
0answers
37 views

How to use caret package in r to tune the detailed structure of neural network

I am new to ANN, and I am struggling on how to tune my ANN. My question is how can I determine the ANN structure (like how many hidden layers and nodes in each layer) is the best, or at least good ...
0
votes
0answers
211 views

SVR feature selection

I'm trying to go through feature selection with SVR (trough caret package in R). Working on a dataset with 400+ points and 20+ features and 2 target variable. Can I use correlation coefficient for ...
2
votes
1answer
583 views

glmStepAIC model is doing better that other models

I am training a model on an imbalanced dataset (about 5-20% of positive class) and trying out different algorithms in R using caret package. I have 57 predictors and around 2000-3000 observations in ...
1
vote
1answer
745 views

R - xgbTree, xgbDart and gbm in Caret predict Small Range

I am currently facing an issue in my regression model. I have tried the models in the title (xgbTree, xgbDART, and gbm in caret), and they tend to predict a very small range for the output variable. ...

1
2 3 4 5
9