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
30 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
12 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
6 views

How to extract cross validation error in caret like in cv.glm? [migrated]

I have some randomly generated data that I am trying to build a regression model around. Here is the data: ...
0
votes
0answers
28 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 ...
0
votes
1answer
68 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
30 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
20 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
19 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
14 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
40 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
22 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
24 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 ...
-1
votes
1answer
31 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
21 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
88 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
237 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
422 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
vote
0answers
51 views

Data splitting with caret: Can we remove the ID Coloumn after folds are created?

so we have a dependent sample (two observations for each participant). To prevent data from one participant being in the training set and in the unseen fold in cross-validation we used the groupKFold ...
0
votes
0answers
19 views

How does caret package choose the optimal parameters when there are several such values?

First Example I fitted the following penalized logistic regression model using caret package as follows, ...
1
vote
1answer
164 views

R caret classification - why doesn't model accuracy equal accuracy given by predict()?

I have a dataset with 1000 samples, and each sample is 1 of 3 classes. I'm training classifiers on the dataset and predicting classes (5-fold cross-validated) and I'd like to know how well each ...
5
votes
1answer
208 views

How to interpret coefficients of a multinomial elastic net (glmnet) regression

I'm trying to model a membership in one of three well-being clusters (flourisher, normative, languisher) based on a set of predictors, using elastic net for both variable selection & modelling. I ...
0
votes
1answer
39 views

How do I predict future scenarios after training and validating my model?

Problem I'm new to machine learning and need a little activation energy to get me past this sticking point. I've trained/validated/tuned, and tested a random forest model. Therefore, I've used my ...
0
votes
0answers
64 views

How to find the Prediction Intervals of a Gaussian Process Regression via caret kernlab packages?

I am trying to use a Gaussian Process Regression (GPR) model to predict hourly streamflow discharges in a river. I've got good results applying the caret::kernlab train () function. Since the ...
0
votes
0answers
221 views

How to improve specificity with unbalanced data? (R caret package)

I am working on a classification problem where my outcome variable is either "Approved" or "Denied". The % of approvals in my dataset is roughly 60% and the denials make up roughly 30%. I have tried ...
0
votes
0answers
200 views

caret() and glmnet() give different coefficients

I have understood from this post (https://stackoverflow.com/questions/48653465/r-coefficients-from-glmnet-and-caret-are-different-for-the-same-lambda) that caret() and glmnet() may not use the same ...
1
vote
1answer
51 views

Predictions based on k-fold Cross Validation, which model is used (Caret)

I am sorry if there is an obvious or intuitive answer to this, which I missed. We have tuned the hyperparameters of a RF using Grouped 10 - Fold CV (repeated 5 times), to obtain the values for mtry ...
0
votes
1answer
322 views

Grouped 7-fold Cross Validation in R

I am searching for a grouped 7-fold cross validation function. I couldn't find it in the caret package. I got 70 subjects performing 7 trials (Outcome variable: categorical with 7 values) = 490 ...
0
votes
0answers
82 views

R-Caret, Regression, different number of PCA components for finalModel and resampling with PCA?

In my project I train models with the "Timeslice" method from the caret package but this question also fits in with other methods, such as cross-validation. Imagine you have 2584 records and split ...
0
votes
0answers
9 views

Any project on iterative evaluation of dimensionality reduction and model selection strategies?

Caret and Scikit-learn offer great many alternatives for various steps in machine learning. Is there any project that aims at trying all(or most) available alternatives in these packages (or other ...
1
vote
1answer
50 views

Testing set accuracy by using cross validation using xgboost with caret

I am working on an xgboost model using caret. I'm using cross validation, but don't know if I'm understanding it correctly. As I understand, it creates multiple training and test sets. Does this mean ...
0
votes
0answers
63 views

Is the use of Nested Cross Validation and train- test CV necessary or an overkill?

I have been relatively obsessed lately in the proper way of selecting a model (including tuning hyper parameters) and then assessing model performance. I have read various posts and the approach I ...
1
vote
1answer
87 views

How does caret resolve ties in the KNN classification? [closed]

I have a multi-class classification problem, in which I'm using caret package k nearest neighbour classifier, (4 classes), which means that an odd number for k won't prevent classification ties. So ...
1
vote
0answers
26 views

How is this standard error obtained?

I am working through the exercises in Kuhn and Johnson's "Applied Predictive Modelling" and cannot reproduce one of their results in the exercises. Looking at 4.3 we have ... find the number of ...
0
votes
0answers
201 views

Can we calculate Variable Importance in Projection (VIP) scores for PLS-DA in R-caret? Is it comparable with coefficients?

Can we calculate Variable Importance in Projection (VIP) scores for PLS-DA in caret (R)? Are VIP scores comparable with PLS-DA coefficients?
1
vote
0answers
26 views

How to select the most important features, categorical & numerical data

I need to find out which factors are relevant when predicting low birth weight. My model looks like this: ...
0
votes
0answers
82 views

Identifying important variables in a PLSDA model using caret in R: are coefficients standardized?

I am doing a PLSDA using the caret package in R. My objective is to predict a status of a cow (0 vs 1) using spectral data. I want to compare the coefficients to know which spectral points contribute ...
1
vote
0answers
56 views

Caret rfe varImp: scaled variable imprtance for rfe results [closed]

I want to plot the scaled variable importance of a rfe object (recursive feature elimination). With the following code I compute the rfe model and the variable importance: ...
0
votes
0answers
31 views

When to use which classification model?

This is something that continues to give me trouble. Assuming I am working to extract a classification from a dataset and assuming I have the computing resources to do the necessary calculations (in ...
0
votes
0answers
71 views

How train function in caret choose lamda for elastic net

I'm a beginner in elastic net. I'm using following code for elastic net in R ...
0
votes
1answer
42 views

Correct calculation of repeated cross-validation classification metrics

We can obtain a resampled estimate of training set classification accuracy from caret::confusionMatrix.train(model) e.g., ...
1
vote
1answer
63 views

How do I avoid time leakage in my KNN model?

I am building a KNN model to predict housing prices. I'll go through my data and my model and then my problem. Data - ...
1
vote
0answers
268 views

What is the basis for the default sigma value used by svmRadial in caret? [closed]

I am looking at the source code (I think) for the "svmRadial" function in the caret package. It looks like the default sigma values are calculated by first using the kernlab package's "sigest" ...
0
votes
0answers
31 views

textclassification caret(svm): very low accuracy for testset because few words matching with trainingset

I am doing text analysis of tweets with caret ("classif.svm). I have manually classified 1500 documents (consisting of 1-5 tweets). When I tune the parameters it shows me an accuracy of about 80% and ...
0
votes
0answers
61 views

NA and missing values preprocessing within caret with cross-validation

I wanted to use caret package to train a model on some messy data (many NAs and missing values) but I cannot find a solution that would fit to my problem. While NAs are part of numerical features I ...
1
vote
1answer
31 views

Conflict between predicated outcomes in logistic regression

I was using caret in R to use logistic regression to make prediction. I only have one predictor named OEI and the outcome variable is pass/fail. However, although I was able to perform that task and ...
1
vote
1answer
106 views

Construction of confusion matrix when cross-validating with k-NN in R

I've a dataset looking like this: ...
0
votes
1answer
82 views

How do I run cross validation on a decision tree in an uplift model?

I have this model from the uplift package, ...
3
votes
1answer
158 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 ...
1
vote
1answer
179 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 ...

1 2 3 4 5 9