Skip to content

Commit

Permalink
Add very basic unit test for nn_ensemble hyperopt
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Feb 11, 2022
1 parent e785835 commit 7447ede
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit 7447ede

Please sign in to comment.