Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lasso periodically fails #22

Open
tobigithub opened this issue Dec 28, 2015 · 0 comments
Open

lasso periodically fails #22

tobigithub opened this issue Dec 28, 2015 · 0 comments

Comments

@tobigithub
Copy link
Owner

Method "lasso" in caret fails from time to time with

Error in { : 
  task 1 failed - "arguments imply differing number of rows: 3, 2"

example code

# load caret and DT the cars data set
require(caret); require(DT);  

# define x and y for regression of a synthetic dataset
# defined in lasso 
set.seed(123); training_data <- SLC14_1(10)
set.seed(123); testing_data  <- SLC14_1(100)

# all the training data (just named x and y)
y <- training_data$y
x <- training_data[, -ncol(training_data)]

train(x,y,"lasso")
train(x,y,"lasso")
train(x,y,"lasso")

results in

> train(x,y,"lasso")
The lasso 

10 samples
20 predictors

No pre-processing
Resampling: Bootstrapped (25 reps) 
Summary of sample sizes: 10, 10, 10, 10, 10, 10, ... 
Resampling results across tuning parameters:

  fraction  RMSE      Rsquared   RMSE SD    Rsquared SD
  0.1       11.37634  0.3940539   3.556101  0.2981656  
  0.5       17.29988  0.4252108  13.101637  0.3506784  
  0.9       24.54744  0.4397249  26.254093  0.3695557  

RMSE was used to select the optimal model using  the smallest value.
The final value used for the model was fraction = 0.1. 
> train(x,y,"lasso")
Error in { : 
  task 1 failed - "arguments imply differing number of rows: 3, 2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant