Skip to content

Commit

Permalink
Merge branch 'hotfix/0.9.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-blanchard committed Aug 27, 2013
2 parents c297ab7 + 099e1cb commit f20b411
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ Requirements
Changelog
~~~~~~~~~

- v0.9.14

+ Hotfix to fix issue where `grid_search_jobs` setting was being overriden
by `grid_search_folds`.

- v0.9.13

+ Added `skll.data.write_feature_file` (also available as
Expand Down
14 changes: 10 additions & 4 deletions skll/learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def train(self, examples, param_grid=None, grid_search_folds=5,
grid search.
:type grid_objective: function
:param grid_jobs: The number of jobs to run in parallel when doing the
grid search. If unspecified or None, the number of
grid search. If unspecified or 0, the number of
grid search folds will be used.
:type grid_jobs: int
:param shuffle: Shuffle examples (e.g., for grid search CV.)
Expand Down Expand Up @@ -618,11 +618,17 @@ def train(self, examples, param_grid=None, grid_search_folds=5,

# set up grid search folds
if isinstance(grid_search_folds, int):
grid_jobs = grid_search_folds
if not grid_jobs:
grid_jobs = grid_search_folds
else:
grid_jobs = min(grid_search_folds, grid_jobs)
folds = grid_search_folds
else:
# use the number of unique fold IDs as the number of grid jobs
grid_jobs = len(np.unique(grid_search_folds))
if not grid_jobs:
grid_jobs = grid_search_folds
else:
grid_jobs = min(len(np.unique(grid_search_folds)), grid_jobs)
labels = [grid_search_folds[curr_id] for curr_id in examples.ids]
folds = LeaveOneLabelOut(labels)

Expand Down Expand Up @@ -875,7 +881,7 @@ def cross_validate(self, examples, stratified=True, cv_folds=10,
a dictionary mapping examples to folds).
:type grid_search_folds: int
:param grid_jobs: The number of jobs to run in parallel when doing the
grid search. If unspecified or None, the number of
grid search. If unspecified or 0, the number of
grid search folds will be used.
:type grid_jobs: int
:param grid_objective: The objective function to use when doing the
Expand Down
2 changes: 1 addition & 1 deletion skll/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
:organization: ETS
'''

__version__ = '0.9.13'
__version__ = '0.9.14'
VERSION = tuple(int(x) for x in __version__.split('.'))

0 comments on commit f20b411

Please sign in to comment.