Skip to content

Commit

Permalink
Migrate evaluation functionalities to pyss3.util
Browse files Browse the repository at this point in the history
All the code related to evaluating models have been migrated to the
``pyss3.util`` module. There, a new class has been created,
``Evaluation``, which provides all the desired functionalities through
its public methods (API).

Before this change was made, the only way by which the user was able to
use these functionalities was through the Command Line tool. That is,
there was no way for the user to make use and, more importantly, take
advantage of this functionalities through the source code.

Now the user can import the ``Evaluation`` class to perform model
evaluation and hyperparameter optimization. This class not only provide
methods to evaluate models but also keeps all the advantages previously
provided only through the Command Line tool, such as an evaluation cache
that automatically keeps track of the evaluation history and the
generation of the interactive 3D evaluation plot. For example, the
following code performs a grid search (``s`` will take 6 different
values between 0.2 and 0.8, ``l`` between 0.1 and 2, and ``p`` between
0.5 and 2), then open up the 3D plot in the web browser, and finally
update the hyperparameters of the model with the best ones:

```python

from pyss3.util import Evaluation, span
from pyss3 import SS3
...
clf = SS3()
clf.fit(x_train, y_train)
s, l, p, a = Evaluation.grid_search(
    clf, x_test, y_test,
    s=span(.2, .8, 6),
    l=span(.1, 2, 6),
    p=span(.5, 2, 6)
)
Evaluation.plot()

clf.set_hyperparameters(s, l, p, a)

```
  • Loading branch information
sergioburdisso committed Feb 19, 2020
1 parent fa91952 commit 8feeef5
Show file tree
Hide file tree
Showing 5 changed files with 1,174 additions and 1,044 deletions.
Loading

0 comments on commit 8feeef5

Please sign in to comment.