Support categorical split in tree model dump. (#7036)

This commit is contained in:
Jiaming Yuan
2021-06-18 16:46:20 +08:00
committed by GitHub
parent 7968c0d051
commit 29f8fd6fee
8 changed files with 263 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
/*!
* Copyright 2014 by Contributors
* Copyright 2014-2021 by Contributors
* \file feature_map.h
* \brief Feature map data structure to help visualization and model dump.
* \author Tianqi Chen
@@ -26,7 +26,8 @@ class FeatureMap {
kIndicator = 0,
kQuantitive = 1,
kInteger = 2,
kFloat = 3
kFloat = 3,
kCategorical = 4
};
/*!
* \brief load feature map from input stream
@@ -82,6 +83,7 @@ class FeatureMap {
if (!strcmp("q", tname)) return kQuantitive;
if (!strcmp("int", tname)) return kInteger;
if (!strcmp("float", tname)) return kFloat;
if (!strcmp("categorical", tname)) return kCategorical;
LOG(FATAL) << "unknown feature type, use i for indicator and q for quantity";
return kIndicator;
}