You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LightGBMBinaryClassificationModel is a autoclosable. this means that we should make use of it.
1- LightGBMBinaryClassificationModel::close() should be responsible to release all the resources related with the instance.
2- Use Try...With...Resources (similar to python With clause) to ensure that resources are released
Example:
try(final LightGBMBinaryClassificationModel model = fit(...)){
return getClassScores(dataset, model, maxInstancesToScore);
}
// You don't need to explisitly call the close() `Try...With...Resources` will do that for you.
We should do that for all Autoclosable resources.
The text was updated successfully, but these errors were encountered:
AlbertoEAF
changed the title
[refactor] Use try-with-resources to help manage autocloseable LightGBM classes that manage memory resources
[refactor] LightGBM: Use try-with-resources on autocloseable classes that manage memory
Jul 11, 2022
Originally posted by @gandola in #116 (comment):
LightGBMBinaryClassificationModel
is a autoclosable. this means that we should make use of it.1-
LightGBMBinaryClassificationModel::close()
should be responsible to release all the resources related with the instance.2- Use
Try...With...Resources
(similar to python With clause) to ensure that resources are releasedExample:
We should do that for all Autoclosable resources.
The text was updated successfully, but these errors were encountered: