Support more input types for categorical data. (#7220)
* Support more input types for categorical data. * Shorten the type name from "categorical" to "c". * Tests for np/cp array and scipy csr/csc/coo. * Specify the type for feature info.
This commit is contained in:
@@ -200,10 +200,10 @@ void LoadFeatureType(std::vector<std::string>const& type_names, std::vector<Feat
|
||||
types->emplace_back(FeatureType::kNumerical);
|
||||
} else if (elem == "q") {
|
||||
types->emplace_back(FeatureType::kNumerical);
|
||||
} else if (elem == "categorical") {
|
||||
} else if (elem == "c") {
|
||||
types->emplace_back(FeatureType::kCategorical);
|
||||
} else {
|
||||
LOG(FATAL) << "All feature_types must be one of {int, float, i, q, categorical}.";
|
||||
LOG(FATAL) << "All feature_types must be one of {int, float, i, q, c}.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user