add 9.0.1 for LTR rescoring (#790)

This commit is contained in:
Mark J. Hoy 2025-04-25 08:19:23 -04:00 committed by GitHub
parent 00dc55b3bd
commit ec45c395fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,10 +237,17 @@ class TestMLModel:
Normalized scores for the model. Normalized scores for the model.
""" """
if (ES_VERSION[0] == 8 and ES_VERSION >= (8, 19)) or ( should_rescore = (
ES_VERSION >= (9, 1) or ES_IS_SERVERLESS (ES_VERSION[0] == 8 and ES_VERSION >= (8, 19))
): or (
# In 8.19 and 9.1, the scores are normalized if there are negative scores ES_VERSION[0] == 9
and (ES_VERSION[1] >= 1 or (ES_VERSION[1] == 0 and ES_VERSION[2] >= 1))
)
or ES_IS_SERVERLESS
)
if should_rescore:
# In 8.19+, 9.0.1 and 9.1, the scores are normalized if there are negative scores
min_model_score, _ = ( min_model_score, _ = (
get_model_transformer( get_model_transformer(
ranker, feature_names=ltr_model_config.feature_names ranker, feature_names=ltr_model_config.feature_names