Commit 68e2530f authored by wxchan's avatar wxchan Committed by Guolin Ke
Browse files

free dataset (#427)

parent 6318b795
......@@ -1267,6 +1267,10 @@ class Booster(object):
state['handle'] = handle
self.__dict__.update(state)
def free_dataset(self):
self.__dict__.pop('train_set', None)
self.__dict__.pop('valid_sets', None)
def set_train_data_name(self, name):
self.__train_data_name = name
......
......@@ -418,6 +418,10 @@ class LGBMModel(LGBMModelBase):
if early_stopping_rounds is not None:
self.best_iteration = self._Booster.best_iteration
self.best_score = self._Booster.best_score
# free dataset
self.booster_.free_dataset()
del train_set, valid_sets
return self
def predict(self, X, raw_score=False, num_iteration=0):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment