Accept numpy array for DMatrix slice index. (#6368)

This commit is contained in:
Jiaming Yuan
2020-12-16 14:42:52 +08:00
committed by GitHub
parent ef4a0e0aac
commit 347f593169
3 changed files with 28 additions and 14 deletions

View File

@@ -299,6 +299,11 @@ MetaInfo MetaInfo::Slice(common::Span<int32_t const> ridxs) const {
out.feature_weigths.Resize(this->feature_weigths.Size());
out.feature_weigths.Copy(this->feature_weigths);
out.feature_names = this->feature_names;
out.feature_types.Copy(this->feature_types);
out.feature_type_names = this->feature_type_names;
return out;
}