Interesting timing.
Are you in R or python?
(Iām with R, zip file approach)ā¦
Iām actually playing around with LightGBM for the last few days, only to realize (now) that it doesnāt seem like I can save the model into a RData format.
From what I understand so far, I can load it back, but then if I try to use it for predictions, R crashes.
Iām tired. Will look further into this tomorrowā¦
The challenge is combining this with other modelsā¦ Juggling between RData and RDSā¦ Major overhauling of my code. Today has been 100% debuggingā¦ (yikes)
So yeah, anyone reading this using R, tread carefully around lightgbm if you decide on using it. Iāve had other several issues with it. As an example, for some reason, I need FIRST to run a small lightgbm tutorial first before attempting modeling or it will crash ā¦everyā¦ ā¦singleā¦ timeā¦ urrh.
Iām running into problems with lightgbm in R too (Iām using google colab notebook for my submissions).
As @michael_bordeleau said, lightgbm is difficult to handle. My problem, as said above, is in the saving /loading step.
I tested lgb.save/lgb.load and saveRDS.lgb.Booster/readRDS.lgb.Booster. With both alternatives my code runs ok in google colab but my submission fails.
Iām saving into save_model function each model into a different .rds file and loading them in the same way. In the review of my submission error I see a error message in the loading step: āError in lgb.load(file = ātrained_model_Freq.rdsā) :
lgb.load: file ātrained_model_Freq.rdsā passed to filename does not existā.
So, It is mandatory save all models in a model object and save it into trained_model.Rdata? How is possible do that with specific functions of lightgbm?
I think the fix in your case should be quite simple
So for R notebooks what you can do to use anything other than a .RData file is to just make sure you save the object inside the saved_objects/ directory.
So if your two models are: trained_model_Freq.rds and trained_model_Sev.rds then in your load_model and save_model you should have something like:
Thatās basically the gist of it. We then take everything inside saved_objects/ and push it to the server. This directory is created when you setup the notebook and run the AIcrowd cell at the beginning.
Hope that makes it work, if not then we can continue the discussion