Plot the learning curve (X-axis=train_size (observations), Y-axis= error count) for a xgboost model using R [on hold]









up vote
-1
down vote

favorite












Currently, I develop a model using xgboost which accuracy is 92% and now I am trying to see the bias and variance of my model by plotting the learning curve.



Here is my code:



xgb_params <- list("objective" = "reg:linear",
"eval_metric"="rmse",
"eta"=0.05,
"max_depth"=2

)
watchlist <- list(train = train_matrix,test = test_matrix)

bst_model <- xgb.train(params = xgb_params,
data = train_matrix,
nrounds = 500,
watchlist=watchlist,
gamma=0
)
e <- data.frame(bst_model$evaluation_log)
plot(e$iter, e$train_rmse, col = 'blue')

**The train and test error output is**

[491] train-rmse:275.988190 test-rmse:285.262756
[492] train-rmse:275.954712 test-rmse:285.229706
[493] train-rmse:275.933258 test-rmse:285.215637
[494] train-rmse:275.917206 test-rmse:285.209808
[495] train-rmse:275.909515 test-rmse:285.203552
[496] train-rmse:275.861633 test-rmse:285.165009
[497] train-rmse:275.828766 test-rmse:285.123657
[498] train-rmse:275.801086 test-rmse:285.097107
[499] train-rmse:275.681793 test-rmse:285.020081
[500] train-rmse:275.655884 test-rmse:284.991364


And the curve is enter image description here



By looking at the curve, can anyone tell me if this curve is overfitted or not?



Now to plot the learning curve (where X-exis= observation size and Y-axis=error count) don't find any function or library exist in through which I can plot the learning curve easily.



So, can anybody help me on this topic?










share|improve this question















put on hold as off-topic by avid_useR, TylerH, TDG, mrpatg, GhostCat 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – avid_useR, TylerH, TDG, GhostCat
If this question can be reworded to fit the rules in the help center, please edit the question.












  • stackoverflow.com/questions/20370827/…
    – august
    2 days ago






  • 1




    Possible duplicate of Plot learning curves with caret package and R
    – august
    2 days ago














up vote
-1
down vote

favorite












Currently, I develop a model using xgboost which accuracy is 92% and now I am trying to see the bias and variance of my model by plotting the learning curve.



Here is my code:



xgb_params <- list("objective" = "reg:linear",
"eval_metric"="rmse",
"eta"=0.05,
"max_depth"=2

)
watchlist <- list(train = train_matrix,test = test_matrix)

bst_model <- xgb.train(params = xgb_params,
data = train_matrix,
nrounds = 500,
watchlist=watchlist,
gamma=0
)
e <- data.frame(bst_model$evaluation_log)
plot(e$iter, e$train_rmse, col = 'blue')

**The train and test error output is**

[491] train-rmse:275.988190 test-rmse:285.262756
[492] train-rmse:275.954712 test-rmse:285.229706
[493] train-rmse:275.933258 test-rmse:285.215637
[494] train-rmse:275.917206 test-rmse:285.209808
[495] train-rmse:275.909515 test-rmse:285.203552
[496] train-rmse:275.861633 test-rmse:285.165009
[497] train-rmse:275.828766 test-rmse:285.123657
[498] train-rmse:275.801086 test-rmse:285.097107
[499] train-rmse:275.681793 test-rmse:285.020081
[500] train-rmse:275.655884 test-rmse:284.991364


And the curve is enter image description here



By looking at the curve, can anyone tell me if this curve is overfitted or not?



Now to plot the learning curve (where X-exis= observation size and Y-axis=error count) don't find any function or library exist in through which I can plot the learning curve easily.



So, can anybody help me on this topic?










share|improve this question















put on hold as off-topic by avid_useR, TylerH, TDG, mrpatg, GhostCat 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – avid_useR, TylerH, TDG, GhostCat
If this question can be reworded to fit the rules in the help center, please edit the question.












  • stackoverflow.com/questions/20370827/…
    – august
    2 days ago






  • 1




    Possible duplicate of Plot learning curves with caret package and R
    – august
    2 days ago












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











Currently, I develop a model using xgboost which accuracy is 92% and now I am trying to see the bias and variance of my model by plotting the learning curve.



Here is my code:



xgb_params <- list("objective" = "reg:linear",
"eval_metric"="rmse",
"eta"=0.05,
"max_depth"=2

)
watchlist <- list(train = train_matrix,test = test_matrix)

bst_model <- xgb.train(params = xgb_params,
data = train_matrix,
nrounds = 500,
watchlist=watchlist,
gamma=0
)
e <- data.frame(bst_model$evaluation_log)
plot(e$iter, e$train_rmse, col = 'blue')

**The train and test error output is**

[491] train-rmse:275.988190 test-rmse:285.262756
[492] train-rmse:275.954712 test-rmse:285.229706
[493] train-rmse:275.933258 test-rmse:285.215637
[494] train-rmse:275.917206 test-rmse:285.209808
[495] train-rmse:275.909515 test-rmse:285.203552
[496] train-rmse:275.861633 test-rmse:285.165009
[497] train-rmse:275.828766 test-rmse:285.123657
[498] train-rmse:275.801086 test-rmse:285.097107
[499] train-rmse:275.681793 test-rmse:285.020081
[500] train-rmse:275.655884 test-rmse:284.991364


And the curve is enter image description here



By looking at the curve, can anyone tell me if this curve is overfitted or not?



Now to plot the learning curve (where X-exis= observation size and Y-axis=error count) don't find any function or library exist in through which I can plot the learning curve easily.



So, can anybody help me on this topic?










share|improve this question















Currently, I develop a model using xgboost which accuracy is 92% and now I am trying to see the bias and variance of my model by plotting the learning curve.



Here is my code:



xgb_params <- list("objective" = "reg:linear",
"eval_metric"="rmse",
"eta"=0.05,
"max_depth"=2

)
watchlist <- list(train = train_matrix,test = test_matrix)

bst_model <- xgb.train(params = xgb_params,
data = train_matrix,
nrounds = 500,
watchlist=watchlist,
gamma=0
)
e <- data.frame(bst_model$evaluation_log)
plot(e$iter, e$train_rmse, col = 'blue')

**The train and test error output is**

[491] train-rmse:275.988190 test-rmse:285.262756
[492] train-rmse:275.954712 test-rmse:285.229706
[493] train-rmse:275.933258 test-rmse:285.215637
[494] train-rmse:275.917206 test-rmse:285.209808
[495] train-rmse:275.909515 test-rmse:285.203552
[496] train-rmse:275.861633 test-rmse:285.165009
[497] train-rmse:275.828766 test-rmse:285.123657
[498] train-rmse:275.801086 test-rmse:285.097107
[499] train-rmse:275.681793 test-rmse:285.020081
[500] train-rmse:275.655884 test-rmse:284.991364


And the curve is enter image description here



By looking at the curve, can anyone tell me if this curve is overfitted or not?



Now to plot the learning curve (where X-exis= observation size and Y-axis=error count) don't find any function or library exist in through which I can plot the learning curve easily.



So, can anybody help me on this topic?







r bigdata data-science xgboost machine-learning-model






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 19 hours ago

























asked 2 days ago









Alam Mahabub

44




44




put on hold as off-topic by avid_useR, TylerH, TDG, mrpatg, GhostCat 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – avid_useR, TylerH, TDG, GhostCat
If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by avid_useR, TylerH, TDG, mrpatg, GhostCat 2 days ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – avid_useR, TylerH, TDG, GhostCat
If this question can be reworded to fit the rules in the help center, please edit the question.











  • stackoverflow.com/questions/20370827/…
    – august
    2 days ago






  • 1




    Possible duplicate of Plot learning curves with caret package and R
    – august
    2 days ago
















  • stackoverflow.com/questions/20370827/…
    – august
    2 days ago






  • 1




    Possible duplicate of Plot learning curves with caret package and R
    – august
    2 days ago















stackoverflow.com/questions/20370827/…
– august
2 days ago




stackoverflow.com/questions/20370827/…
– august
2 days ago




1




1




Possible duplicate of Plot learning curves with caret package and R
– august
2 days ago




Possible duplicate of Plot learning curves with caret package and R
– august
2 days ago

















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Kleinkühnau

Makov (Slowakei)

Deutsches Schauspielhaus