Skip to content

Commit

Permalink
Merge pull request #482 from NatLibFi/fix-mllm-hyperopt-hidden-labels
Browse files Browse the repository at this point in the history
MLLM fix: don't include use_hidden_labels in hyperopt, it won't have any effect
  • Loading branch information
osma authored Apr 19, 2021
2 parents ea11a02 + 72b8b1a commit cf3088a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions annif/backend/mllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ def _objective(self, trial):
'min_samples_leaf': trial.suggest_int('min_samples_leaf', 5, 30),
'max_leaf_nodes': trial.suggest_int('max_leaf_nodes', 100, 2000),
'max_samples': trial.suggest_float('max_samples', 0.5, 1.0),
'use_hidden_labels':
trial.suggest_categorical('use_hidden_labels', [True, False]),
'limit': 100
}
model = self._backend._model._create_classifier(params)
Expand All @@ -59,8 +57,7 @@ def _postprocess(self, study):
lines = [
f"min_samples_leaf={bp['min_samples_leaf']}",
f"max_leaf_nodes={bp['max_leaf_nodes']}",
f"max_samples={bp['max_samples']:.4f}",
f"use_hidden_labels={bp['use_hidden_labels']}"
f"max_samples={bp['max_samples']:.4f}"
]
return hyperopt.HPRecommendation(lines=lines, score=study.best_value)

Expand Down

0 comments on commit cf3088a

Please sign in to comment.