Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
68e2530f
Commit
68e2530f
authored
Apr 18, 2017
by
wxchan
Committed by
Guolin Ke
Apr 18, 2017
Browse files
free dataset (#427)
parent
6318b795
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+4
-0
python-package/lightgbm/sklearn.py
python-package/lightgbm/sklearn.py
+4
-0
No files found.
python-package/lightgbm/basic.py
View file @
68e2530f
...
@@ -1267,6 +1267,10 @@ class Booster(object):
...
@@ -1267,6 +1267,10 @@ class Booster(object):
state
[
'handle'
]
=
handle
state
[
'handle'
]
=
handle
self
.
__dict__
.
update
(
state
)
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
):
def
set_train_data_name
(
self
,
name
):
self
.
__train_data_name
=
name
self
.
__train_data_name
=
name
...
...
python-package/lightgbm/sklearn.py
View file @
68e2530f
...
@@ -418,6 +418,10 @@ class LGBMModel(LGBMModelBase):
...
@@ -418,6 +418,10 @@ class LGBMModel(LGBMModelBase):
if
early_stopping_rounds
is
not
None
:
if
early_stopping_rounds
is
not
None
:
self
.
best_iteration
=
self
.
_Booster
.
best_iteration
self
.
best_iteration
=
self
.
_Booster
.
best_iteration
self
.
best_score
=
self
.
_Booster
.
best_score
self
.
best_score
=
self
.
_Booster
.
best_score
# free dataset
self
.
booster_
.
free_dataset
()
del
train_set
,
valid_sets
return
self
return
self
def
predict
(
self
,
X
,
raw_score
=
False
,
num_iteration
=
0
):
def
predict
(
self
,
X
,
raw_score
=
False
,
num_iteration
=
0
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment