elastic / eland

Python Client and Toolkit for DataFrames, Big Data, Machine Learning and ETL in Elasticsearch
https://eland.readthedocs.io
Apache License 2.0
628 stars 98 forks source link

LTR improvements #651

Closed afoucret closed 6 months ago

afoucret commented 6 months ago

This PR contains two improvements for the LTR feature in Eland.

Example:

ed.ml.MLModel.import_ltr_model(
  es_client=es_client,
  model=ranker,
  model_id='ltr-model-xgb',
  ltr_model_config=ltr_model_config,
  es_if_exists = 'replace'
)

The previous version was more difficult to use (and could lead to inconsistencies):

ed.ml.MLModel.import_model(
  es_client=es_client,
  model=ranker,
  model_id='ltr-model-xgb',
  feature_names=ltr_model_config.feature_names,
  inference_config=ltr_model_config.to_dict(),
  es_if_exists = 'replace'
)
pquentin commented 6 months ago

buildkite test this please