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
1a8c23ed
Commit
1a8c23ed
authored
Dec 01, 2016
by
Guolin Ke
Browse files
some typo
parent
673e3ea2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+2
-2
python-package/lightgbm/callback.py
python-package/lightgbm/callback.py
+1
-1
python-package/lightgbm/sklearn.py
python-package/lightgbm/sklearn.py
+2
-2
No files found.
python-package/lightgbm/basic.py
View file @
1a8c23ed
...
@@ -19,7 +19,7 @@ def _load_lib():
...
@@ -19,7 +19,7 @@ def _load_lib():
"""Load LightGBM Library."""
"""Load LightGBM Library."""
lib_path
=
find_lib_path
()
lib_path
=
find_lib_path
()
if
len
(
lib_path
)
==
0
:
if
len
(
lib_path
)
==
0
:
r
eturn
None
r
aise
Exception
(
"cannot find LightGBM library"
)
lib
=
ctypes
.
cdll
.
LoadLibrary
(
lib_path
[
0
])
lib
=
ctypes
.
cdll
.
LoadLibrary
(
lib_path
[
0
])
lib
.
LGBM_GetLastError
.
restype
=
ctypes
.
c_char_p
lib
.
LGBM_GetLastError
.
restype
=
ctypes
.
c_char_p
return
lib
return
lib
...
@@ -1034,7 +1034,7 @@ class Booster(object):
...
@@ -1034,7 +1034,7 @@ class Booster(object):
if
data
is
self
.
valid_sets
[
i
]:
if
data
is
self
.
valid_sets
[
i
]:
data_idx
=
i
+
1
data_idx
=
i
+
1
break
break
"""need push new valid data"""
"""need
to
push new valid data"""
if
data_idx
==
-
1
:
if
data_idx
==
-
1
:
self
.
add_valid
(
data
,
name
)
self
.
add_valid
(
data
,
name
)
data_idx
=
self
.
__num_dataset
-
1
data_idx
=
self
.
__num_dataset
-
1
...
...
python-package/lightgbm/callback.py
View file @
1a8c23ed
...
@@ -130,7 +130,7 @@ def reset_learning_rate(learning_rates):
...
@@ -130,7 +130,7 @@ def reset_learning_rate(learning_rates):
def
early_stop
(
stopping_rounds
,
verbose
=
True
):
def
early_stop
(
stopping_rounds
,
verbose
=
True
):
"""Create a callback that activates early stopp
p
ing.
"""Create a callback that activates early stopping.
Activates early stopping.
Activates early stopping.
Requires at least one validation data and one metric
Requires at least one validation data and one metric
If there's more than one, will check all of them
If there's more than one, will check all of them
...
...
python-package/lightgbm/sklearn.py
View file @
1a8c23ed
...
@@ -64,7 +64,7 @@ def _point_wise_objective(func):
...
@@ -64,7 +64,7 @@ def _point_wise_objective(func):
num_data
=
len
(
weight
)
num_data
=
len
(
weight
)
num_class
=
len
(
grad
)
//
num_data
num_class
=
len
(
grad
)
//
num_data
if
num_class
*
num_data
!=
len
(
grad
):
if
num_class
*
num_data
!=
len
(
grad
):
raise
ValueError
(
"leng
h
t of grad and hess should equal with num_class * num_data"
)
raise
ValueError
(
"lengt
h
of grad and hess should equal with num_class * num_data"
)
for
k
in
range
(
num_class
):
for
k
in
range
(
num_class
):
for
i
in
range
(
num_data
):
for
i
in
range
(
num_data
):
idx
=
k
*
num_data
+
i
idx
=
k
*
num_data
+
i
...
@@ -81,7 +81,7 @@ class LGBMModel(LGBMModelBase):
...
@@ -81,7 +81,7 @@ class LGBMModel(LGBMModelBase):
num_leaves : int
num_leaves : int
Maximum tree leaves for base learners.
Maximum tree leaves for base learners.
max_depth : int
max_depth : int
Maximum tree depth for base learners, -1 means no
t
limit.
Maximum tree depth for base learners, -1 means no limit.
learning_rate : float
learning_rate : float
Boosting learning rate
Boosting learning rate
n_estimators : int
n_estimators : int
...
...
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