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
2answers
48 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 ...
1
vote
1answer
26 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
17 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
26 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
0answers
20 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 ...
0
votes
0answers
13 views

Why does createDataPartition() split my dataset unevenly? [migrated]

This is what I did in R using Galton's data from the HistData package: The code is: ...
14
votes
1answer
15k views

Caret glmnet vs cv.glmnet

There seems to be a lot of confusion in the comparison of using glmnet within caret to search for an optimal lambda and using <...
1
vote
2answers
37 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
15 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) ...
1
vote
1answer
481 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. ...
0
votes
0answers
18 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 ...
2
votes
1answer
615 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 ...
1
vote
1answer
37 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
1answer
178 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
0answers
14 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 ...
1
vote
1answer
368 views

What metric to use as the cross validation error in the training set for a binary classification problem?

When I am running cross validation on the training set for a binary classification problem, what metric should I use if I am only interested in obtaining the largest AUC (area under receiver operating ...
2
votes
2answers
563 views

AUC of a cross validation model

Let's say i build a 10X cross-validation model, say with Caret. If i want the AUC of this, is it: The average AUC of the 10 validation samples? Something else? Cheers!
5
votes
1answer
2k views

Using Rolling Forecast Origin Resampling in R for Neural Network Time Series

I am new to time series prediction and forecasting with neural networks and am having trouble with cross validation. I am fitting a multivariate time series. I have 236 monthly observations. I am ...
0
votes
1answer
134 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 (...
0
votes
0answers
58 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
98 views

Knn using caret: how to specify k?

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

Predicting a Numeric value in Future Years

I have this data set, and I want to predict number of PTS beyond 2018: ...
0
votes
1answer
2k views

How to use rfe object with function pickSizeTolerance in R package caret

I run caret's recursive feature selection with randomForest. While running rfe function with method repeatedcv, I had parameter ...
19
votes
1answer
18k views

Caret and coefficients (glmnet)

I am interested in utilizing caret for making inferences on a particular data set. Is it possible to do the following: produce coefficients of a glmnet model I trained in caret. I would like to use ...
0
votes
1answer
27 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
vote
1answer
33 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
21 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 ...
1
vote
1answer
2k views

Pass custom weight function to 'kknn' model in Caret package [closed]

I am working on school project, where I'm trying to implement improvement for weighted kNN in CARET package. I basically need to replace standard 'weight' function used in KKNN model to something more ...
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
20 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
43 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 ...
3
votes
0answers
126 views

Why Does My Model Accuracy Go Down With More Data?

I am using R and the caret package. My code is very straight forward. ...
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 ...
-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
2answers
572 views

Machine Learning with Skewed Classes in R [duplicate]

I am looking for some suggestions on what methods are appropriate for training a dataset with a high skew in the outcome classes. The ratio of Class 0: Class 1 is about 20:1 and I am looking to ...
6
votes
3answers
13k views

R caret Naive Bayes (untuned) results differ from klaR

I'm running a naive bayes classification model and I noticed that the caret package returns a different result than does klaR (which caret references) or e1071. My question is: is there something ...
5
votes
2answers
4k views

How caret calculates R Squared

From the training output below, it looks like R squared is not calculated by the traditional formula 1 - SSE/SST, since lower error rate has lower R squared. So how is it calculated? ...
0
votes
0answers
23 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
2answers
3k views

Index argument with createFolds in traincontrol - caret package [closed]

I would like to do 10 times repeated 5-fold CV and compare results from more models. Here is one thing I don't understand: Example of 5-fold CV: myFolds <- createFolds(loan_data$loan_status, k =...
0
votes
0answers
105 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
310 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 ...
0
votes
1answer
892 views

How to determine Accuracy/Classification rate with 5-fold cv in training and test set

I'm trying to use 5-fold cv for training set and test set but I can't determine the confusion matrix using table() to calculate the classification rate (true positives and true negatives divided by ...
1
vote
0answers
70 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
20 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
222 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
240 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
0answers
2k views

Caret with rxDForest as custom model

I'm trying to use the train function from the caret package to tune the parameters of the rxDForest from RevoScaleR package (I ...
0
votes
1answer
40 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
216 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
2 3 4 5
9