Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python-package] Use scikit-learn interpretation of negative n_jobs and change default to number of cores #5105

Merged
merged 33 commits into from
Jun 19, 2022
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8bd6e8d
use joblib formula for negative n_jobs
david-cortes Mar 30, 2022
60b28de
correction for n_jobs calculation
david-cortes Mar 30, 2022
78e83ef
use more robust cpu_count from joblib
david-cortes Mar 30, 2022
8c0fe80
change default n_jobs to number of cores
david-cortes Mar 30, 2022
bde1cd9
fix detection of num_threads under parameters
david-cortes Mar 30, 2022
deb2c4b
better handling of n_jobs at prediction time
david-cortes Mar 31, 2022
461b0f0
fix incorrect usage of list.pop
david-cortes Mar 31, 2022
2046bbd
correct pop/remove yet again
david-cortes Mar 31, 2022
8d22027
Update python-package/lightgbm/sklearn.py
david-cortes May 12, 2022
52ddaa9
Update tests/python_package_test/test_sklearn.py
david-cortes May 12, 2022
607c184
Update tests/python_package_test/test_sklearn.py
david-cortes May 12, 2022
f4f1bb6
add comments clarifying negative n_jobs
david-cortes May 12, 2022
6f8ff2f
fix CI (code taken from PR comment)
david-cortes May 12, 2022
32b73a2
change default to n_jobs=None in dask interface
david-cortes May 14, 2022
5c162e6
corrections for handling of n_jobs
david-cortes May 15, 2022
33c851d
linter
david-cortes May 15, 2022
5b6841e
corrections for predict-time n_jobs
david-cortes May 15, 2022
93bc3a6
linter
david-cortes May 15, 2022
a757666
add more comments about n_jobs values
david-cortes May 15, 2022
49f5da7
linter
david-cortes May 15, 2022
d142209
more corrections
david-cortes May 15, 2022
d2bf3c0
linter
david-cortes May 15, 2022
a31fced
linter
david-cortes May 15, 2022
fda1b5e
linter
david-cortes May 15, 2022
b4461c3
Update python-package/lightgbm/compat.py
david-cortes May 15, 2022
4aec1c6
Update python-package/lightgbm/sklearn.py
david-cortes May 15, 2022
dfe23b9
Update python-package/lightgbm/sklearn.py
david-cortes May 15, 2022
9749f7d
Update python-package/lightgbm/sklearn.py
david-cortes May 15, 2022
21cd3b2
Update python-package/lightgbm/sklearn.py
david-cortes May 15, 2022
65247fc
workaround for passing test about outputs with multiple threads
david-cortes May 30, 2022
c7259da
Merge branch 'pynjobs' of github.com:david-cortes/lightgbm into pynjobs
david-cortes May 30, 2022
467b74d
Update tests/python_package_test/test_sklearn.py
david-cortes Jun 5, 2022
d74ab7b
Update tests/python_package_test/test_sklearn.py
david-cortes Jun 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
workaround for passing test about outputs with multiple threads
  • Loading branch information
david-cortes committed May 30, 2022
commit 65247fc8c80096e3e122b5c4b0ce2cc1cfc24648
2 changes: 1 addition & 1 deletion tests/python_package_test/test_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_binary_linear():
X_test, _, X_test_fn = fd.load_dataset('.test')
weight_train = fd.load_field('.train.weight')
lgb_train = lgb.Dataset(X_train, y_train, params=fd.params, weight=weight_train)
gbm = lgb.LGBMClassifier(**fd.params)
gbm = lgb.LGBMClassifier(**fd.params, n_jobs=0)
gbm.fit(X_train, y_train, sample_weight=weight_train)
sk_pred = gbm.predict_proba(X_test)[:, 1]
fd.train_predict_check(lgb_train, X_test, X_test_fn, sk_pred)
Expand Down