2
$\begingroup$

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?

$\endgroup$
8
  • $\begingroup$ How does the body of this question relate to the title? Are there actually two questions here? $\endgroup$ Commented 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$ Commented 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$ Commented Apr 3, 2016 at 17:11
  • $\begingroup$ @HuayuZhang do you use the R wrapper to it? $\endgroup$
    – air
    Commented Apr 3, 2016 at 20:54
  • $\begingroup$ @air No. I use python. $\endgroup$ Commented Apr 3, 2016 at 20:55

1 Answer 1

1
$\begingroup$

It looks to be arbitrary, for example the the XBGClassifier fit() routine takes X to be an array like feature matrix.

$\endgroup$
2
  • $\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

Not the answer you're looking for? Browse other questions tagged or ask your own question.