Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

Questions tagged [caret]

Caret is an R package containing a set of functions that attempt to streamline the process of creating predictive models.

0
votes
0answers
15 views

How can I run a classification model with categorical response variables that have - and + signs in R-caret? [on hold]

I would like to run a classification analysis using caret in R. My categorical variables have -/+ signs e.g BB+, BB- and when I run CART,SVM etc i get an error message as shown below: CART fit....
0
votes
1answer
26 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
24 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 ...
0
votes
0answers
22 views

caret predict.gbm function error: factor has new levels [closed]

Similar to THIS question, I am getting an error in my prediction stating that one of my factors has new levels. I am using the gbm method from ...
0
votes
0answers
19 views

how to extract rules from final model made by caret

I have a made cross-validation (k=5) by caret package using C5.0 method. I have 21 features and 7000 instances. The C5.0 trials default is 40. The problem is C5.0 made > 1600 rules over 40 trials, ...
0
votes
0answers
11 views

k-fold optimization in C5.0 algorithm

How can I do k-fold cross validation for C5.0 algorithm, I know caret package has createFolds function but I think in k-fold process we must do kind of averaging from all models. Because I didn't ...
0
votes
0answers
17 views

Using Caret is there a way to explicityly state what the true class is in binary classification?

I'm using caret + XGBoost to make binary predictions on a dataset. The data are very imbalanced so I'm using prAUC metric. My results using 5 fold cross validation are a prAUC of 0.99+ which is not ...
0
votes
0answers
15 views

caret chooses non-optimal RMSE?

I run a linear regression via caret / glmnet method with "RMSE" as metric. In the final model, caret tells me which values of the tuning parameters alpha and lambda were selected to minimize RMSE. If ...
0
votes
0answers
25 views

what does scale hyperparameter mean in svm polynomial kernel using kernlab in r

I'm trying to train my svm model with polynomial kernel. I'm using caret package with method ...
0
votes
0answers
22 views

How does Caret's PCA function work?

I've been reading through this question: PCA and k-fold cross-validation in caret package in R . In one of the answers, it was suggested to do PCA within the train function rather than before. However,...
0
votes
1answer
76 views

How can I one-hot encode a variable that has only 2 levels? [closed]

I'm trying to do OHC in R to convert categorical into numerical data. However R's caret package requires one to use factors with greater than 2 levels. Any idea how to go around this? I've searched ...
1
vote
1answer
87 views

Parameter tuning with vs without nested cross-validation

Disclaimer: This question has been inspired by this one, which is a good question but has unfortunately not attracted an answer that actually answers OPs question. Statistical models often times have ...
0
votes
0answers
26 views

Repeated CV evaluation with confidence intervals in R caret?

it occurs to me that there is a part of model evaluation that I have not understood yet. The problem that I am working on now illustrates the point well I think. I need to fit a model of >400 ...
0
votes
0answers
29 views

Difference between AUPRC in caret and PRROC

I'm working in a very unbalanced classification problem, and I'm using AUPRC as metric in caret. I'm getting very differents results for the test set in AUPRC from caret and in AUPRC from package ...
1
vote
0answers
20 views

Feature selection method based on target variable in R [closed]

I have dataset from 30 different features and a result variable. All the features have values like -1,0,1 and my result variable contains -1 and 1 , which 1 means record is healthy and -1 means ...
1
vote
0answers
51 views

Using An ROC Curve to Evaluate a model

I have a number of questions on the ROC curves when being used to evaluate a model. My understanding of them is they can be used to determine the probability cutoff when classifying a row in a dataset ...
0
votes
0answers
104 views

Train function metric option

I have a question based on the train function from the caret package. I am relatively new to ML and am a little confused. I am using the random forest algorithm attempting to predict a continuous ...
0
votes
1answer
109 views

How to prevent overfitting with regression using ranger (randomforest)

I use caret to train the model (on Boston dataset from the mlbench package). Here is the code ...
0
votes
0answers
117 views

XGBoost prediction unstable for regression

I'm using XGBoost for tiny data set (89 observations and 100 features). I didn't expect much but I did get a decent prediction on the test set (compared to linear regression model). I'm tuning the ...
0
votes
1answer
81 views

Reverse CARET proProcess()

I did the following steps in my modeling using R: 1)applied preProcess(data, method = c("bagImpute")) function in CARET package and then encoded the data. 2)Used SMOTE to balance the data(because the ...
0
votes
2answers
136 views

Logistic Regression: multicollinearity and Kappa statistics

I may be wrong but from my understanding logistic regression requires there to be little or no multicollinearity among the independent variables, and yet Kappa statistics as part of postResample() ...
1
vote
1answer
171 views

Other distances than euclidean distance in knn [closed]

Suppose I want to fit a k-nearest-neighbour using caret package in R: ...
1
vote
0answers
105 views

Drawing ROC curves from RFE() training results in caret

I want to generate ROC curves using the training data and results from the rfe function in caret. I have managed to do this with the code below but there is some inconsistency between the ROC value ...
1
vote
0answers
83 views

How to use Elastic Net Model to Reduce Collinearity

I am using R to perform a linear regression with a dataset that has clearly correlated independent variables (collinearity). I am using the vif (variance inflation factor) function from the car ...
1
vote
2answers
261 views

Do I have to preprocess my new data for a prediction, if I have used preprocessing for building the model?

In this example preprocessing is used to construct a NN: ...
0
votes
0answers
149 views

Model ensemble with caretStack

I'm building a model ensemble with caretStack (package caretEnsemble). Here is a basic example : ...
0
votes
0answers
23 views

Sample size of each resample

I am calculating a performance metric based on the resamples obtained from cross-validation and bootstrap using the R-package caret: ...
1
vote
1answer
239 views

ridge and lasso models in caret with lambda=0

As far as I know, if I run a lasso model and a ridge model on the same data, and if i keep lambda=0, I'm getting the OLS. Then, how is it possible that I get different results? ...
0
votes
0answers
71 views

What is the interpretation of GBM model output via caret train function?

I am running GBM method for a Classification problem in Caret R. With Verbose=T and Resampling method as "repeatedcv" with 5-folds & 5-repeats, I get the following values printed in console: ...
0
votes
0answers
235 views

Calculate model accuracy confidence intervals from caret model object?

I am trying to generate 95% confidence intervals for the accuracy predictions on the trained data set using the caret package and interface. Some dummy code: ...
0
votes
2answers
480 views

Getting sensitivity and specificity from a caret model

I have trained a caret model using bootstrapping and the default metric (accuracy, since I'm doing logistic regression). Now I'd like to know other performance parameters for the trained model: ...
0
votes
0answers
249 views

Metrics in rpart decision trees

I am currently working with decision trees in R, I am using caret library. Source code of rpart can be found here: https://github.com/cran/rpart/blob/master/R/rpart.R I understand how decision trees ...
1
vote
0answers
54 views

R caret calibration function

I'm studying about calibration techniques and I'd like to use the CARET calibration function to examine the quality of my classifiers' probabilities. I read the relevant documentation, however I don'...
5
votes
1answer
812 views

mlr compared to caret

I’ve been using mlr a little to learn about machine learning, but recently found out about caret. The way I understand it is that both are wrappers to various ML packages, but have slightly different ...
0
votes
1answer
135 views

Why is my model so accurate when using knn(), where k=1?

I am currently using genomic expression levels, age, and smoking intensity levels to predict the number of days Lung Cancer Patients have to live. I have a small amount of data; 173 patients and 20,...
1
vote
1answer
179 views

Improve the precision of random forest for count data

I am trying to create a classification model that predicts whether a customer will enquire for a financial product based on some 250 independent variables. 98% of the variables are count variables and ...
0
votes
1answer
476 views

R caret ROC optimal cut-off in original values

I am new to using R-project, I started using the programming language due to the ease of cross-validation package caret. However, I'm stuck at translating the predicted probability values into the ...
0
votes
1answer
37 views

Predicting a Numeric value in Future Years

I have this data set, and I want to predict number of PTS beyond 2018: ...
1
vote
0answers
175 views

brnn r package (Bayesian Regularization for Feed-Forward Neural Networks)

I'm using the "brnn" package (Bayesian Regularized Neural Networks), in particular I run the train() function from caret package. My data are stored in a data.frame object and I run the caret function ...
0
votes
0answers
116 views

Accuracy of glm in caret is very different from sklearn logistic regression model

I'm newbie in caret. When I perform logistic regression (I believe I do so) in caret I get 51,5% of accuracy. ...
1
vote
0answers
31 views

Intuition behind low optimal # variables per split (mtry / max_features) during random forest tuning?

I was wondering if anyone might be able to provide some insight regarding how to interpret the results of some random forest hyperparameter tuning I am performing. The training set consists of: 1000 ...
0
votes
0answers
34 views

Does caret support count/proportion response matrices for a glmnet binomial model?

I am trying to train a glmnet binomial model using caret. My data is pre-aggregated into a counts of successes and failures, and caret doesn't seem to like this although glmnet itself supports it. I ...
0
votes
0answers
18 views

Specifiying additional Feature Selection methods in CARET

CARET currently offers various methods for feature selection (univariate filter, recursive feature elimination, genetic algorithm, simulated annealing). While this is definitely a good set of feature ...
0
votes
1answer
437 views

How to report confusion matrix for repeated K-fold cross-validation?

I am trying to construct confusion matrices in R with CARET package for repeated K-fold cross-validation, specifically, 10-fold cross-validation with 10 repeats. I realized there was already a ...
0
votes
0answers
35 views

classification in caret

I want an algorithm to clasify a two-factor category which maximize the sensitivity of "1". I tried caret algorithms (SVMradial, rf, knn...) but no one is better than a manual formula (quite ...
0
votes
1answer
329 views

computing AIC or BIC for nonlinear regression models

Is it possible to calculate AIC or BIC for nonlinear regression models like SVM, regression trees, artificial neural network, and others. AIC and BIC can be estimated from linear models, but I have ...
1
vote
0answers
71 views

Caret package - Logistic regression how to find Pseudo R square [duplicate]

Hi I am interested in utilizing caret for making inferences on a particular data set... Since this is caret-model, most common methods to find pseudo Rsquare fail. model <- train(lg.train.data[,...
0
votes
1answer
27 views

Which Optimization Technique does CARET use when Training a Model, say glmnet? [closed]

I am trying to understand the mechanics behind the training of models. Specifically, I need to know how R's CARET package trains models. Which technique or algorithm is applied? Usually for linear ...