diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-02-28 16:24:40 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2018-02-28 16:24:40 +0000 |
| commit | d0838d5f643f930b3c5504582d8506747db74cc7 (patch) | |
| tree | e5a3a4c22401cfd675d2e13d63218d29ac6c8185 /gensvm | |
| parent | add autofunctions to git (diff) | |
| download | pygensvm-d0838d5f643f930b3c5504582d8506747db74cc7.tar.gz pygensvm-d0838d5f643f930b3c5504582d8506747db74cc7.zip | |
fix for average fit_time in grid search
Diffstat (limited to 'gensvm')
| -rw-r--r-- | gensvm/__init__.py | 2 | ||||
| -rw-r--r-- | gensvm/gridsearch.py | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gensvm/__init__.py b/gensvm/__init__.py index c1244ce..712da42 100644 --- a/gensvm/__init__.py +++ b/gensvm/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -__version__ = '0.1.6' +__version__ = '0.1.7' from .core import GenSVM from .gridsearch import GenSVMGridSearchCV diff --git a/gensvm/gridsearch.py b/gensvm/gridsearch.py index a241d8a..e49d3ce 100644 --- a/gensvm/gridsearch.py +++ b/gensvm/gridsearch.py @@ -155,7 +155,14 @@ def _format_results(results, cv_idx, true_y, scorers, iid, if return_n_test_samples: ret.append(len(y_test)) if return_times: - fit_time = duration + # Note, the C library returns the duration for a task (i.e. all + # splits). The _skkl_format_cv_results() computes the mean of + # the values, which should represent the average time per + # split. To compute this correctly, we here divide by the + # number of splits. Since we calculate the mean later, the mean + # is still correct, but this is not the exact fit_time for this + # fold. + fit_time = duration / n_splits ret.extend([fit_time, score_time]) if return_parameters: ret.append(param) |
