Closed LeoBreebaart closed 1 month ago
Thanks for this! There have indeed been issues with LightGBM versioning for a while. I am at IGARSS this week but hopefully I will have time to look into this more closely next week. It sounds like you've identified the problem, though. Would you like to make a PR with an updated requirements? If not I can do it but may ask for your feedback to make sure I've resolved it.
Thanks for the quick reply! I have submitted a pull request containing my fix for Flask, which is entirely syntactical.
However, I am not myself an actual user of either lightgbm or Iris (I merely manage the environment from which an Iris instance is provided to end users). I would say that simply removing that early_stopping_rounds
parameter from the fit()
call would be enough to avoid the runtime error -- but I can't judge how relevant the value of that parameter (which was set to 4
in segmentation/__init__.py
) is, and I was not able to quickly find out how lightgbm expected us to implement that functionality after that parameter mechanim was deprecated. I can find some talk about callback functions on Stack Overflow, but no real concrete "this is the upgrade/migration path for this deprecation".
Regards,
-- Leo
Great, thanks. I've merged the PR and I will implement the early_stopping callback - seems that's the recommended way now. Will update here and close when it's done
early_stopping = lgb.early_stopping(4, verbose=False)
gbm.fit(
inputs[train_indices, :], train_labels,
eval_set=[(inputs[val_indices, :], val_labels)],
callbacks=[early_stopping]
)
We are running IRIS in a NixOS environment that, after its most recent update, no longer contains versions of several dependency packages that IRIS requires, most notably Flask v2 and lightgbm v3.
Specifically:
IRIS does not build with Flask v3 because the location of the markupsafe package has changed, causing the
import markupsafe
statements (already deprecated since flask 2.3.0, and finally removed in 3.0.0) in various IRIS source files to fail.IRIS throws a runtime error (
TypeError: LGBMClassifier.fit() got an unexpected keyword argument 'early_stopping_rounds'
) when used with lightgbm v4 because that parameter was removed in lightgbm 4.0.0.Are there any plans to update the IRIS code base for these and other newer dependencies?
Regards,
-- Leo