Need help with xgboost

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Need help with xgboost

R help mailing list-2
Hi all,
I'm trying to learn how to use xgboost. I'm working with the 2016 GSS dataset (attached) and trying to determine what variables influence number of children. I've successfully used this to teach myself GLMs, decision trees, and random forests.
My problem is, I can't get the xgboost program (attached) to predict number of children in the testing set. Predictions range from 0.504 to 0.518, and number of children is supposed to be anywhere from 0 to 8, integers only. If anyone can show me what I'm doing wrong, I will be very grateful.
Thanks,Josh
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

xgb trial.R (12K) Download Attachment