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

Hyperparameter optimization for NN ensemble #569

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
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
Add very basic unit test for nn_ensemble hyperopt
  • Loading branch information
osma committed Feb 11, 2022
commit 7447ede152c63b9757d110eb7ff4273c56c3bccd
11 changes: 11 additions & 0 deletions tests/test_backend_nn_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ def test_nn_ensemble_is_trained(app_project):
assert nn_ensemble.is_trained


def test_nn_ensemble_hyperopt(app_project, fulltext_corpus):
nn_ensemble_type = annif.backend.get_backend('nn_ensemble')
nn_ensemble = nn_ensemble_type(
backend_id='nn_ensemble',
config_params={'sources': 'dummy-en'},
project=app_project)

optimizer = nn_ensemble.get_hp_optimizer(fulltext_corpus, metric='NDCG')
optimizer.optimize(n_trials=2, n_jobs=1, results_file=None)


def test_nn_ensemble_modification_time(app_project):
nn_ensemble_type = annif.backend.get_backend("nn_ensemble")
nn_ensemble = nn_ensemble_type(
Expand Down