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 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.