Assume the data in one dimension is (-1.0, 2.0, 2.5, 3.0, 5.0). Does XGboost regard it as a nominal or a continuous variable?
$\begingroup$
$\endgroup$
8
-
$\begingroup$ How does the body of this question relate to the title? Are there actually two questions here? $\endgroup$– Matthew DruryCommented Apr 3, 2016 at 17:06
-
1$\begingroup$ @MatthewDrury I only give 5 numbers but do not say whether they are samples from a continuous distribution or just 5 elements of a nominal attribute. The question is how will XGboost treat them? $\endgroup$– Huayu ZhangCommented Apr 3, 2016 at 17:10
-
2$\begingroup$ Ohhhh. Hahah. I read "differentiate" as "take the derivative of". I understand now! I added the word "between" to your title to make the intent clear. $\endgroup$– Matthew DruryCommented Apr 3, 2016 at 17:11
-
$\begingroup$ @HuayuZhang do you use the R wrapper to it? $\endgroup$– airCommented Apr 3, 2016 at 20:54
-
$\begingroup$ @air No. I use python. $\endgroup$– Huayu ZhangCommented Apr 3, 2016 at 20:55
|
Show 3 more comments
1 Answer
$\begingroup$
$\endgroup$
2
It looks to be arbitrary, for example the the XBGClassifier fit() routine takes X to be an array like feature matrix.
-
$\begingroup$ How does XGBClassifier make a split when learning the tree? I think the criteria for the nominal and the numeric are different. $\endgroup$ Commented Apr 5, 2016 at 14:48
-
1$\begingroup$ @HuayuZhang: The current implementation of XGBoost supports only numeric data not factors. Here's the reference for the R package (I presume Python is similar): xgboost.readthedocs.org/en/latest/R-package/… In either case, the distinction hardly matters for splits. You can read the details about splits here: arxiv.org/pdf/1603.02754v1.pdf but the short answer is that splits are calculated using percentiles that group the data. For binary features, this will translate to how many features are 0 vs 1, hence the actual split location in (0,1) is irrelevant. $\endgroup$– Alex R.Commented Apr 5, 2016 at 18:07