-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept numpy array view. #4147
Accept numpy array view. #4147
Conversation
796831d
to
b56c4a0
Compare
b56c4a0
to
01a99eb
Compare
_check_call(_LIB.XGDMatrixSetGroup(self.handle, | ||
c_array(ctypes.c_uint, group), | ||
c_bst_ulong(len(group)))) | ||
self.set_uint_info('group', group) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is equivalent to XGDMatrixSetGroup()
? If so, can we add a test for groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. SetInfo
does a copy first, while SetGroup
builds the group_ptr
on the fly, which should be slightly faster. But other than this, the code is duplicated. It's a little bit tricky to add a test, since we can't get the group back without another function transforming group_ptr
into the original group
. We can postpone it to #4150. But I am happy to add such test if you think it's better.
This reverts commit a985a99.
close #3841 .