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
04e2356b
"tests/vscode:/vscode.git/clone" did not exist on "2e962c779f0d4f44da46c5be9851604b9acb5708"
Unverified
Commit
04e2356b
authored
Jul 20, 2018
by
Nikita Titov
Committed by
GitHub
Jul 20, 2018
Browse files
[python][docs] several little fixes (#1533)
parent
c6cdea75
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+1
-1
python-package/lightgbm/engine.py
python-package/lightgbm/engine.py
+3
-3
python-package/lightgbm/plotting.py
python-package/lightgbm/plotting.py
+2
-2
python-package/lightgbm/sklearn.py
python-package/lightgbm/sklearn.py
+1
-1
No files found.
python-package/lightgbm/basic.py
View file @
04e2356b
...
@@ -1097,7 +1097,7 @@ class Dataset(object):
...
@@ -1097,7 +1097,7 @@ class Dataset(object):
def
_set_predictor
(
self
,
predictor
):
def
_set_predictor
(
self
,
predictor
):
"""
"""
Set predictor for continued training, not recomm
an
d for user to call this function.
Set predictor for continued training, not recomm
ende
d for user to call this function.
Please set init_model in engine.train or engine.cv
Please set init_model in engine.train or engine.cv
"""
"""
if
predictor
is
self
.
_predictor
:
if
predictor
is
self
.
_predictor
:
...
...
python-package/lightgbm/engine.py
View file @
04e2356b
...
@@ -45,7 +45,7 @@ def train(params, train_set, num_boost_round=100,
...
@@ -45,7 +45,7 @@ def train(params, train_set, num_boost_round=100,
If you want to get i-th row preds in j-th class, the access way is preds[j * num_data + i].
If you want to get i-th row preds in j-th class, the access way is preds[j * num_data + i].
Note: should return (eval_name, eval_result, is_higher_better) or list of such tuples.
Note: should return (eval_name, eval_result, is_higher_better) or list of such tuples.
To ignore the default metric in params, set it to the string ``"None"``
To ignore the default metric in params, set it to the string ``"None"``
init_model : string or None, optional (default=None)
init_model : string
, Booster
or None, optional (default=None)
Filename of LightGBM model or Booster instance used for continue training.
Filename of LightGBM model or Booster instance used for continue training.
feature_name : list of strings or 'auto', optional (default="auto")
feature_name : list of strings or 'auto', optional (default="auto")
Feature names.
Feature names.
...
@@ -268,7 +268,7 @@ def _make_n_folds(full_data, folds, nfold, params, seed, fpreproc=None, stratifi
...
@@ -268,7 +268,7 @@ def _make_n_folds(full_data, folds, nfold, params, seed, fpreproc=None, stratifi
raise
LightGBMError
(
'Scikit-learn is required for lambdarank cv.'
)
raise
LightGBMError
(
'Scikit-learn is required for lambdarank cv.'
)
# lambdarank task, split according to groups
# lambdarank task, split according to groups
group_info
=
full_data
.
get_group
().
astype
(
int
)
group_info
=
full_data
.
get_group
().
astype
(
int
)
flatted_group
=
np
.
repeat
(
range
(
len
(
group_info
)),
repeats
=
group_info
)
flatted_group
=
np
.
repeat
(
range
_
(
len
(
group_info
)),
repeats
=
group_info
)
group_kfold
=
_LGBMGroupKFold
(
n_splits
=
nfold
)
group_kfold
=
_LGBMGroupKFold
(
n_splits
=
nfold
)
folds
=
group_kfold
.
split
(
X
=
np
.
zeros
(
num_data
),
groups
=
flatted_group
)
folds
=
group_kfold
.
split
(
X
=
np
.
zeros
(
num_data
),
groups
=
flatted_group
)
elif
stratified
:
elif
stratified
:
...
@@ -352,7 +352,7 @@ def cv(params, train_set, num_boost_round=100,
...
@@ -352,7 +352,7 @@ def cv(params, train_set, num_boost_round=100,
If you want to get i-th row preds in j-th class, the access way is preds[j * num_data + i].
If you want to get i-th row preds in j-th class, the access way is preds[j * num_data + i].
Note: should return (eval_name, eval_result, is_higher_better) or list of such tuples.
Note: should return (eval_name, eval_result, is_higher_better) or list of such tuples.
To ignore the default metric in params, set it to the string ``"None"``
To ignore the default metric in params, set it to the string ``"None"``
init_model : string or None, optional (default=None)
init_model : string
, Booster
or None, optional (default=None)
Filename of LightGBM model or Booster instance used for continue training.
Filename of LightGBM model or Booster instance used for continue training.
feature_name : list of strings or 'auto', optional (default="auto")
feature_name : list of strings or 'auto', optional (default="auto")
Feature names.
Feature names.
...
...
python-package/lightgbm/plotting.py
View file @
04e2356b
...
@@ -10,7 +10,7 @@ from io import BytesIO
...
@@ -10,7 +10,7 @@ from io import BytesIO
import
numpy
as
np
import
numpy
as
np
from
.basic
import
Booster
from
.basic
import
Booster
from
.compat
import
MATPLOTLIB_INSTALLED
,
GRAPHVIZ_INSTALLED
,
string_type
from
.compat
import
MATPLOTLIB_INSTALLED
,
GRAPHVIZ_INSTALLED
,
range_
,
string_type
from
.sklearn
import
LGBMModel
from
.sklearn
import
LGBMModel
...
@@ -216,7 +216,7 @@ def plot_metric(booster, metric=None, dataset_names=None,
...
@@ -216,7 +216,7 @@ def plot_metric(booster, metric=None, dataset_names=None,
raise
KeyError
(
'No given metric in eval results.'
)
raise
KeyError
(
'No given metric in eval results.'
)
results
=
metrics_for_one
[
metric
]
results
=
metrics_for_one
[
metric
]
num_iteration
,
max_result
,
min_result
=
len
(
results
),
max
(
results
),
min
(
results
)
num_iteration
,
max_result
,
min_result
=
len
(
results
),
max
(
results
),
min
(
results
)
x_
=
range
(
num_iteration
)
x_
=
range
_
(
num_iteration
)
ax
.
plot
(
x_
,
results
,
label
=
name
)
ax
.
plot
(
x_
,
results
,
label
=
name
)
for
name
in
dataset_names
:
for
name
in
dataset_names
:
...
...
python-package/lightgbm/sklearn.py
View file @
04e2356b
...
@@ -193,7 +193,7 @@ class LGBMModel(_LGBMModelBase):
...
@@ -193,7 +193,7 @@ class LGBMModel(_LGBMModelBase):
Number of parallel threads.
Number of parallel threads.
silent : bool, optional (default=True)
silent : bool, optional (default=True)
Whether to print messages while running boosting.
Whether to print messages while running boosting.
importance_type : str, optional (default='split')
importance_type : str
ing
, optional (default='split')
The type of feature importance to be filled into ``feature_importances_``.
The type of feature importance to be filled into ``feature_importances_``.
If "split", result contains numbers of times the feature is used in a model.
If "split", result contains numbers of times the feature is used in a model.
If "gain", result contains total gains of splits which use the feature.
If "gain", result contains total gains of splits which use the feature.
...
...
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