Elvenson / xgboost-go

XGBoost inference with Golang.
MIT License
25 stars 5 forks source link

Load XGBoost tree from json byte array in memory #9

Closed jcronq closed 1 year ago

jcronq commented 1 year ago

There's currently a dependency on hard disk to which the XGBoost JSON has been saved. I have a use case to run this library on a device that may or may not have a hard disk, and need to be able to load the model from memory instead.

Proposed fix: Create a new function that unmarshal's the object from a byte array. Pull out the common components of the two load functions into a new function.

jcronq commented 1 year ago

Created PR for fixing this issue: https://github.com/Elvenson/xgboost-go/pull/10

Elvenson commented 1 year ago

Thanks you for your suggestion! I have merged your MR so I will close this issue.