Skip to content

Commit

Permalink
code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhao062 committed Aug 4, 2019
1 parent 6f7f38b commit 47e1c72
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions combo/models/sklearn_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ def _get_n_jobs(n_jobs):
-------
n_jobs : int
The actual number of jobs as positive integer.
Examples
--------
>>> from sklearn.utils import _get_n_jobs
>>> _get_n_jobs(4)
4
>>> jobs = _get_n_jobs(-2)
>>> assert jobs == max(cpu_count() - 1, 1)
>>> _get_n_jobs(0)
Traceback (most recent call last):
...
ValueError: Parameter n_jobs == 0 has no meaning.
"""
if n_jobs < 0:
return max(cpu_count() + 1 + n_jobs, 1)
Expand Down
2 changes: 1 addition & 1 deletion combo/utils/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def invert_order(scores, method='multiplication'):
>>> invert_order(scores1)
array([-0.1, -0.3, -0.5, -0.7, -0.2, -0.1])
>>> invert_order(scores1, method='subtraction')
array([ 0.6, 0.4, 0.2, 0. , 0.5, 0.6])
array([0.6, 0.4, 0.2, 0. , 0.5, 0.6])
"""

scores = column_or_1d(scores)
Expand Down

0 comments on commit 47e1c72

Please sign in to comment.