Skip to content

Commit

Permalink
Merge pull request #53 from CaseyTa/master
Browse files Browse the repository at this point in the history
Set a default min_score of 0.5 for OpenPredict /predict endpoint
  • Loading branch information
micheldumontier authored Apr 30, 2024
2 parents 3453ac4 + 7742d8c commit 46b9b22
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/openpredict_model/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ def get_predictions(request: PredictInput) -> PredictOutput:
# TODO: improve when we will have more classifier
predictions_array = query_omim_drugbank_classifier(supported_subject, request.options.model_id)

min_score = 0.5
if request.options.min_score:
predictions_array = [
p for p in predictions_array if p['score'] >= request.options.min_score]
min_score = request.options.min_score
predictions_array = [
p for p in predictions_array if p['score'] >= min_score]
if request.options.max_score:
predictions_array = [
p for p in predictions_array if p['score'] <= request.options.max_score]
Expand Down

0 comments on commit 46b9b22

Please sign in to comment.