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
2
votes
0answers
551 views

Model ensemble with caretStack

I'm building a model ensemble with caretStack (package caretEnsemble). Here is a basic example : ...
2
votes
1answer
747 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 ...
2
votes
1answer
2k 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 ...
2
votes
0answers
47 views

Caret gives non-zero test R-squared with linear model without predictors: why? [duplicate]

NOT A DUPLICATE For the persons who marked this question as a duplicate of the post I mentioned in my original post: this is not a duplicate, as the correlation obtained with an intercept-only linear ...
2
votes
0answers
253 views

Verifying rebalancing of unbalanced binary class Caret R

Still very new to R and have only enough statistical knowledge to be dangerous. But I'm stuck as to whether the following is acheiving what I need it to do. Project is a flight risk prediction using ...
2
votes
0answers
1k views

Learning curve of random forest in caret

I have data with about 1250 rows and 97 features. Using random forest for classification in caret R package, I've trained a model and now, I want to plot the learning curve using the ...
2
votes
0answers
2k views

logic of resamples function in caret R package

The caret R package includes functions to compare models via their resampling distributions. Specifically, it prescribes fitting multiple models using the same resampling profiles (i.e. same versions ...
2
votes
0answers
88 views

How to I model corresponding features in caret

I am trying to build a binary-outcome prediction model wherein the features correspond to each outcome, for example my headers might be: ...
2
votes
0answers
94 views

Which resampling methods are suitable in the presence of dummy variables?

I want to build a machine learning model using the caret package in R. Some of the features in my dataset are dummies taking the value 0 or 1. I would like to know which resampling methods can be used ...
2
votes
0answers
774 views

Difference in execution times between caret and randomForest (even with method = “none”)

I have a dataset with 1205 observations and 285 predictors (all but one categorical). It is a binary classification task. When I run randomForest, it executes in less than 1 second. When I run caret ...
2
votes
0answers
996 views

Why does glmnet in caret give different predictions for different alphas even though lambda is zero?

In R, when using caret to train an elastic net regularization model, I find that different values of alpha give different predictions when the lambda parameter equals zero. This should not be the case,...
2
votes
0answers
554 views

Interpreting varImp using a GLMNET model on a 3-level factor

(tried stackoverflow but told I may have better luck here). I am looking for some help interpreting varImp using GLMNET multinomial model on a 3-level factor variable. The plot and the data don't make ...
2
votes
0answers
141 views

Training with very few positives

I have a binary classification problem where the fraction of positives is very low, e.g. 20 positives in 10,000 examples (0.2%) What is an appropriate cross validation scheme for training a ...
1
vote
2answers
7k views

Error: object 'descr' not found [closed]

I am trying to follow up the example code in the "Building Predictive Models in R Using the caret Package" paper from Max Kuhn[1]. Here is the part of the code: ...
1
vote
1answer
4k 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? ...
1
vote
1answer
2k views

Predict longitudinal data with machine learning in R

I am currently working on a prediction model from which the data is longitudinal data/panel data/cross sectional data. The data contains multiple companies for which I have a response variable and ...
1
vote
1answer
421 views

After using cross-validation with PCA regression, what weights are then used for the external test set?

Based on this answer, and following the Applied Predictive Modeling text, I am running the following 10-fold cross-validated PCR analysis: ...
1
vote
2answers
1k views

Why does randomForest returns an overall value for variable importance instead of one value per class? [closed]

In my training dataset I have two classes. I have run rf using the following code ...
1
vote
1answer
5k views

Area under ROC curve for random forest

Does the area under ROC curve depends on which class is defined as default positive class by the random forest model? I am using ...
1
vote
1answer
1k views

Search for interactions using carets rfe function

it is straight forward to search for purely additive models using the rfe function in caret. Is it possible to include all interactions as part of the search? In the train method, we can simply say ...
1
vote
2answers
2k views

Optimal parameters with resampling in random forest

I'm building a classification model in R using random forest and the package caret. I'm interested in which parameters are optimised during resampling. As an example, lets use the iris dataset and ...
1
vote
1answer
3k views

Carets preProcess function

I've been introduced to the Caret package for performing analysis and I'm a little confused about one of the operations performed by preProcess. Say I have a ...
1
vote
2answers
3k views

Should logistic regression models generated with and without cross validation in the caret.train function in R be the same?

I am working with the Titanic dataset and trying to use logistic regression in R to predict survival. The simple approach I tried was to just use the glm function with binomial family and logit link ...
1
vote
1answer
493 views

Why does caret print each fold twice? [closed]

I am just curious about the running output of R caret train function. I am doing a grid search for a random forest model. Here is the code: ...
1
vote
1answer
1k views

caret - get standard errors of glm model

When estimating a glm model with caret, using the summary function the standard errors are ...
1
vote
2answers
3k views

Ensemble models in R

I have a clinical dataset (1400 cases) and I applied 4 data mining techniques (ANN, Decision Tree, SVM, Logistic Regression) to predict the binary outcome (Yes, No). Now, I want to improve prediction ...
1
vote
1answer
1k views

Naive Bayes Classifier in R with class weights

I'm searching for a Naive Bayes classifier in R where I can add a paramter for class weights. I need this, because my data is highly unbalanced. Eg.: Class1: 1000 examples Class2: 800 examples ...
1
vote
2answers
2k views

What are RMSE SD and Rsquared SD metrics in resampling results using R package:caret?

I've been doing predictive modelling with R package caret. When resampling regression models, I get the traditional RMSE and Rsquared metrics, but also RMSE SD and ...
1
vote
1answer
4k views

R caret difference between ROC curve and accuracy for classification

In case of caret package test function metric option, one can use either accuracy or ROC as a metric that will be used to finalize values of tuning parameters. I felt that accuracy and ROC are the ...
1
vote
2answers
4k views

Is it possible to use the caret package in R with non-numerical data?

I was wondering if it is possible to use the caret package with non numerical data. I know, for example, if I want to use a simple linear regression lm I could have ...
1
vote
1answer
52 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: ...
1
vote
1answer
39 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
26 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, ...
1
vote
1answer
37 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
2answers
803 views

dummy vs one-hot encoding - ML for prediction

I understand there is a lack of consensus in the difference (if any) between one-hot (k variables) and dummy (k - 1 variables) encoding from a k-level factor. The caret package seems to auto-encode ...
1
vote
2answers
2k views

Getting sensitivity and specificity from a caret model [closed]

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: ...
1
vote
1answer
890 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
1answer
2k views

What are the predicted probabilities from an SVM?

I am using "train" in the Caret package for binary classification with SVM (for the algorithm svmLinear2). I have set 'type = "prob" '. I understand that the probability values farther from 0.5 mean ...
1
vote
2answers
70 views

Is there a way to find the specific number of predictors necessary for my caret random forests model?

I'm creating a random forest model (classification) in caret: model <- train(formula, data = training.data, method = "rf") I ...
1
vote
2answers
3k views

What is the usefulness of detection rate in a confusion matrix?

In the R caret documentation for confusionMatrix(): ...
1
vote
2answers
406 views

Is cross validation only for comparing tuning parameters?

If I'm creating a model (in R with caret), and don't have any tuning parameters I want to compare, is there any use for cross validation? In other words, I wouldn't use cross validation to validate my ...
1
vote
1answer
589 views

Calibrating Probabilities worse than Original Model even though better performance on calibration curve? (in R / Caret)

I'm currently working on the exercises of the book 'Applied Predictive Modeling' by Kuhn and Johnson (using R and caret) and am stuck at the issue of 'Calibrating Probabilities'. Exercise 12.3 shows ...
1
vote
1answer
2k views

recursive feature elimination: why select subset based on AUC vs sensitivity/specificity

I have a small dataset of 25 observations with a classification variable (factor 0,1) and 82 features scaled to have values between 0 and 1. I used the rfe() ...
1
vote
1answer
335 views

Feature extraction with k-fold elastic net - what is the test data?

I am trying to select features and develop a predictive model. Imagine I run a elastic net regression where lambda > 0. There are ten predictors, and the coefficients for five of those predictors is ...
1
vote
1answer
2k views

interpretation of parameter tuning of gam with caret

i am using the caret package to train my gam model. my code looks like this ...
1
vote
2answers
1k views

Recursive feature selection with cross-validation in the caret package (R)

The rfe functions in the caret package allow to perform recursive feature selection (backward) with cross-validation. It is expected that the best features selected in each fold may differ, as also ...
1
vote
1answer
2k views

How to Deal with Large Number of Dummy Variables in Machine Learning? [duplicate]

I have a cross-sectional real estate dataset with information on roughly 100000 properties, including rental price, square meter size, number of bedrooms etc. In addition, the dataset contains ...
1
vote
1answer
2k views

Accessing PCA components from caret object in R

I know how to build a model using PCA components in caret package, however I don't know which variables explain which PCA components. I need some help on it. When I perfom the preProcessing ...
1
vote
1answer
8k views

Optimizing probability thresholds in a glm model in caret

I've been building a logistic regression model (using the "glm" method in caret). The training dataset is extremely imbalanced (99% of the observations in the majority class), so I've been trying to ...
1
vote
2answers
2k views

In R package caret, how is linear regression model trained by using resampling?

Resampling is usually used to find the best tuning parameters for a model. However, for some models, such as linear regression model, there is no tuning parameters. In this case, what can we get from ...

1 2 3
4
5
9