Skip to content

error: unpack requires a buffer of 1 bytes #11

@jafarpenot

Description

@jafarpenot

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions