The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
votes
1answer
22 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
11 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
9 views

Applying PLSDA coefficients to a new dataset to classify

I have a trained model to classify leaves through its spectra by using a PLSDA (with caret package). My question is, is it possible to apply the coefficients of my model over a new spectra dataset?
0
votes
0answers
26 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
35 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
114 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
25 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
16 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, ...
0
votes
1answer
27 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 ...
4
votes
1answer
55 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
33 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
28 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
68 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
117 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
39 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
123 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
67 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
8 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
24 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
39 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
39 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
24 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
127 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
52 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
35 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
30 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
34 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
23 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
48 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
134 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
29 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
30 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
28 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
43 views

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

I've a dataset looking like this: ...
0
votes
1answer
43 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
106 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
82 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 ...
0
votes
0answers
178 views

variable importance for multi-class classification using caret (penalized discriminant analysis")

I have data with three classes and have performed classification using caret (pda). My question is about interpreting predictors based on variable importance (varImp). In two class data, we get ...
0
votes
0answers
59 views

How does multicollinearity affect the feature selection process?

I have a classification problem with a modest number of records (approx. 10,000) and dimensions (30 dimensions, 25 are categoric and 5 are numeric). The response variable has two classes (T/F). I'm ...
1
vote
0answers
173 views

LDA Fit using Caret does not give Standard Deviation

I am following the steps outlined in this tutorial. I have followed along and running into an issue at step 5.3. The output of the LDA model gives me all the expected information, except the Accuracy ...
0
votes
0answers
87 views

How do I diagnose collinearity with rfe() from the caret package?

I have 12,000 records and I"d like to predict a two-class outcome. I'm deciding which predictors to keep and I'm having trouble with two problems. 1- I get an error message because I have categories ...
3
votes
2answers
254 views

Can the alpha, lambda values of a glmnet object output determine whether ridge or Lasso?

Given a glmnet object using train() where trControl method is "cv" and number of iterations is 5, I obtained that the bestTune alpha and lambda values are alpha=0.1 and lambda= 0.007688342. On ...
1
vote
0answers
474 views

Random forest vs Random Forest tuned with caret

Looking for some help please. I have used the randomForest package extensively and have been happy with its performance. I am currently writing a journal paper investigating match outcomes in sport, ...
1
vote
0answers
129 views

Linear discriminant scores using caret

I'm using the caret package in R to undertake an LDA. I'm having problems trying to extract the linear discriminant scores once I've used predict. The model is ... ...
0
votes
1answer
100 views

How to do backward subset selection on a random forest model for classification?

I'd like to identify the most predictive features for my classification model. I'm using this data. Here is a sample. This is my code. I'd like to use the predictors to predict loan status. ...
0
votes
0answers
102 views

Caret: Feature selection with Chi2 / f_classif

I try to classify texts which I have converted to term-document matrices before. I would like to perform feature selection to reduce the number of predictors. In Python, you can do this by means of ...
0
votes
1answer
130 views

SMOTE - What is the difference in sampling before or inside train() [closed]

I have an unbalanced dataset and would like to apply SMOTE to the training data. I can either do one of the following: Inside trainControl() add ...
0
votes
1answer
88 views

Differences in calibration plots for machine learning models

I'm using machine learning methods in R for descriptive regression modelling of a small dataset. I have fit random forest (randomForest), unbiased random forest (cforest) and boosted regression trees (...
1
vote
0answers
30 views

How to approach memory issues with up/down-sampling problem across millions of rows in database that can't be loaded locally? (class imbalance)

I'm faced with fairly typical class imbalance problem across a dataset with nearly 9MM rows (hard drive failures) that's not stored locally (it's in Postgres table; downloading a .csv of it is not ...