Created
May 20, 2020 06:35
-
-
Save zoltanctoth/b64155a29a62b03e7e8c167903952c4c to your computer and use it in GitHub Desktop.
How to save and load a Native LightGBM Model in Sparlk MLlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lightgbm as lgb | |
# Imagine pipelineModel stages are [x, x, x, trainLightGBMModel] | |
model.stages[-1].saveNativeModel("/tmp/lightgbm") | |
nativeLGBModel = lgb.Booster(model_file="/dbfs/tmp/lightgbm/part-00000-tid-5517958219000636906-02c16955-a283-4198-a41a-cdbd78f5aae5-455-1-c000.txt") | |
mlflow.lightgbm.log_model(nativeLGBModel, artifact_path="lightgbm-model") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment