https://github.com/aporia-ai/dmatrix2np
Convert XGBoost's DMatrix format to np.array
https://github.com/aporia-ai/dmatrix2np
machine-learning numpy xgboost
Last synced: 9 months ago
JSON representation
Convert XGBoost's DMatrix format to np.array
- Host: GitHub
- URL: https://github.com/aporia-ai/dmatrix2np
- Owner: aporia-ai
- License: gpl-3.0
- Created: 2020-05-06T15:02:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-11-03T09:45:46.000Z (about 4 years ago)
- Last Synced: 2023-03-06T17:03:12.952Z (almost 3 years ago)
- Topics: machine-learning, numpy, xgboost
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 14
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dmatrix2np
[](https://github.com/aporia-ai/dmatrix2np/actions?workflow=Test) [](https://pypi.org/project/dmatrix2np/) [](https://pepy.tech/project/dmatrix2np)
Convert XGBoost's DMatrix format to np.array.
Made with :heart: by Aporia
## Usage
To install the library, run:
pip install dmatrix2np
Then, you can call in your code:
from dmatrix2np import dmatrix_to_numpy
converted_np_array = dmatrix_to_numpy(dmatrix)
## Development
We use [poetry](https://python-poetry.org/) for development:
pip install poetry
To install all dependencies and run tests:
poetry run pytest
To run tests on the entire matrix (Python 3.6, 3.7, 3.8, 3.9 + XGBoost 0.80, 0.90, 1.0, 1.1, 1.2, 1.3, 1.4):
pip install tox
tox
### The Research Behind
In the flowing blog post we describe the research that has been done to understand the DMatrix format and creating this library:
[DMatrix to Numpy Research](https://www.aporia.com/how-to-convert-dmatrix-to-numpy-format-for-your-machine-learning-model-3/)