Skip to content
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

error: unpack requires a buffer of 1 bytes #11

Open
jafarpenot opened this issue Apr 22, 2022 · 1 comment
Open

error: unpack requires a buffer of 1 bytes #11

jafarpenot opened this issue Apr 22, 2022 · 1 comment

Comments

@jafarpenot
Copy link

Hi guys,

I got this error while trying to convert a dmatrix to a numpy array : error: unpack requires a buffer of 1 bytes

Here is my code:

`import os
import xgboost as xgb
from sklearn.model_selection import train_test_split
from dmatrix2np import dmatrix_to_numpy

train, test = train_test_split(df, test_size=0.2)

dtrain = xgb.DMatrix(train.drop(columns={'default', 'types', 'iin', 'DATA_FLAG', 'type', 'requested_at', 'id'}), train['default'])
dtest = xgb.DMatrix(test.drop(columns={'default', 'types', 'iin', 'DATA_FLAG', 'type', 'requested_at', 'id'}), test['default'])

converted_np_array = dmatrix_to_numpy(dtrain)
`
Any idea on how to fix?

@HamdiBarkous
Copy link

Same issue. Did you find a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants