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
d74b1be9
Unverified
Commit
d74b1be9
authored
Feb 15, 2021
by
Frank Fineis
Committed by
GitHub
Feb 15, 2021
Browse files
reuse len(parts) as n_parts (#3985)
parent
1a294c87
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
python-package/lightgbm/dask.py
python-package/lightgbm/dask.py
+3
-2
No files found.
python-package/lightgbm/dask.py
View file @
d74b1be9
...
...
@@ -284,15 +284,16 @@ def _train(
data_parts
=
_split_to_parts
(
data
=
data
,
is_matrix
=
True
)
label_parts
=
_split_to_parts
(
data
=
label
,
is_matrix
=
False
)
parts
=
[{
'data'
:
x
,
'label'
:
y
}
for
(
x
,
y
)
in
zip
(
data_parts
,
label_parts
)]
n_parts
=
len
(
parts
)
if
sample_weight
is
not
None
:
weight_parts
=
_split_to_parts
(
data
=
sample_weight
,
is_matrix
=
False
)
for
i
in
range
(
len
(
parts
)
)
:
for
i
in
range
(
n_
parts
):
parts
[
i
][
'weight'
]
=
weight_parts
[
i
]
if
group
is
not
None
:
group_parts
=
_split_to_parts
(
data
=
group
,
is_matrix
=
False
)
for
i
in
range
(
len
(
parts
)
)
:
for
i
in
range
(
n_
parts
):
parts
[
i
][
'group'
]
=
group_parts
[
i
]
# Start computation in the background
...
...
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