Commit 1a8c23ed authored by Guolin Ke's avatar Guolin Ke
Browse files

some typo

parent 673e3ea2
...@@ -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:
return None raise 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
......
...@@ -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 stoppping. """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
......
...@@ -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("lenght of grad and hess should equal with num_class * num_data") raise ValueError("length 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 not 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
......
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