r-caret

Error in train.default(x, y, weights = w, …) : final tuning parameters could not be determined

孤者浪人 提交于 2019-11-30 15:49:36
I am very new at machine learning and am attempting the forest cover prediction competition on Kaggle , but I am getting hung up pretty early on. I get the following error when I run the code below. Error in train.default(x, y, weights = w, ...) : final tuning parameters could not be determined In addition: There were 50 or more warnings (use warnings() to see the first 50) # Load the libraries library(ggplot2); library(caret); library(AppliedPredictiveModeling) library(pROC) library(Amelia) set.seed(1234) # Load the forest cover dataset from the csv file rawdata <- read.csv("train.csv"

R caret nnet package in Multicore

久未见 提交于 2019-11-30 14:07:24
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 6 years ago . Can we train a neural network model in parallel using multicores by leveraging foreach package, nnet and caret packages ? I only see randomforest implementation in parallel. Is neural network possible. I am especially interested in the caret's train function which can do a grid search for optimal hidden layers and decay size. This take a long time to run on a single core. Any

R package caret confusionMatrix with missing categories

依然范特西╮ 提交于 2019-11-30 04:10:54
问题 I am using the function confusionMatrix in the R package caret to calculate some statistics for some data I have. I have been putting my predictions as well as my actual values into the table function to get the table to be used in the confusionMatrix function as so: table(predicted,actual) However, there are multiple possible outcomes (e.g. A, B, C, D), and my predictions do not always represent all the possibilities (e.g. only A, B, D). The resulting output of the table function does not

Caret package Custom metric

≡放荡痞女 提交于 2019-11-30 00:54:02
I'm using the caret function "train()" in one of my project and I'd like to add a "custom metric" F1-score. I looked at this url caret package But I cannot understand how I can build this score with the parameter available. There is an example of custom metric which is the following: ## Example with a custom metric madSummary <- function (data, lev = NULL, model = NULL) { out <- mad(data$obs - data$pred, na.rm = TRUE) names(out) <- "MAD" out } robustControl <- trainControl(summaryFunction = madSummary) marsGrid <- expand.grid(degree = 1, nprune = (1:10) * 2) earthFit <- train(medv ~ ., data =

Why is caret train taking up so much memory?

一笑奈何 提交于 2019-11-29 22:55:09
When I train just using glm , everything works, and I don't even come close to exhausting memory. But when I run train(..., method='glm') , I run out of memory. Is this because train is storing a lot of data for each iteration of the cross-validation (or whatever the trControl procedure is)? I'm looking at trainControl and I can't find how to prevent this...any hints? I only care about the performance summary and maybe the predicted responses. (I know it's not related to storing data from each iteration of the parameter-tuning grid search because there's no grid for glm's, I believe.) The

Error in train.default(x, y, weights = w, …) : final tuning parameters could not be determined

爱⌒轻易说出口 提交于 2019-11-29 22:45:58
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 4 years ago . I am very new at machine learning and am attempting the forest cover prediction competition on Kaggle, but I am getting hung up pretty early on. I get the following error when I run the code below. Error in train.default(x, y, weights = w, ...) : final tuning parameters could not be determined In addition: There were 50 or more warnings (use warnings() to see the first 50) #

How to specify a validation holdout set to caret

旧时模样 提交于 2019-11-29 22:09:32
问题 I really like using caret for at least the early stages of modeling, especially for it's really easy to use resampling methods. However, I'm working on a model where the training set has a fair number of cases added via semi-supervised self-training and my cross-validation results are really skewed because of it. My solution to this is using a validation set to measure model performance but I can't see a way use a validation set directly within caret - am I missing something or this just not

ROC curve from training data in caret

我是研究僧i 提交于 2019-11-29 19:54:43
Using the R package caret, how can I generate a ROC curve based on the cross-validation results of the train() function? Say, I do the following: data(Sonar) ctrl <- trainControl(method="cv", summaryFunction=twoClassSummary, classProbs=T) rfFit <- train(Class ~ ., data=Sonar, method="rf", preProc=c("center", "scale"), trControl=ctrl) The training function goes over a range of mtry parameter and calculates the ROC AUC. I would like to see the associated ROC curve -- how do I do that? Note: if the method used for sampling is LOOCV, then rfFit will contain a non-null data frame in the rfFit$pred

R caret package rfe never finishes error task 1 failed - “replacement has length zero”

ぃ、小莉子 提交于 2019-11-29 11:56:17
I recently started to look into caret package for a model I'm developing. I'm using the latest version. As the first step, I decided to use it for feature selection. The data I'm using has about 760 features and 10k observations. I created a simple function based on the training material on line. Unfortunately, I consistently get an error and so the process never finishes. Here is the code that produces error. In this example I am using a small subset of features. I started with the full set of features. I've also changed the subsets, number of folds and repeats to no avail. I know it will be

Using Caret Package but Getting Error in library(e1071)

こ雲淡風輕ζ 提交于 2019-11-29 10:30:09
问题 Here are my codes, pretty standard but I am getting the error msg: library(caret) set.seed(32343) modelFit = train(type~.,data=training, method='glm') error msg: Error in library(e1071) : there is no package called ‘e1071’ Any idea? Thanks! 回答1: You need to install the package e1071 , as the error message is telling you. install.packages('e1071', dependencies=TRUE) 回答2: If you will be using the caret package regularly try: install.packages('caret', dependencies = TRUE) This will automatically