LTRRanker¶
Learning-to-rank over decision-occasion groups, with LightGBM (LambdaMART / XE-NDCG) and CatBoost (YetiRank) backends and group-aware NDCG@k tuning. See the learning-to-rank guide.
In short
LTRRanker(cfg).fit(df)returns a deployableFittedLTRPipelinedirectly; itsresultholds the ranking report,best_valid_ndcgand feature importances.- Configure it with
parleml_ml4.ltr.LTRConfig, or start from theltr_fast/ltr_balanced/ltr_thoroughfactories inparleml_ml4.ltr.config. ranker_objectivepicks the training loss and library;ranking_objectivepicks how the holdout is reported.- Pass
outputs_dir=to persist the pipeline under<outputs_dir>/deploy/ltr/.
LTRRanker ¶
Fit a learning-to-rank model end-to-end and persist a pipeline.
fit ¶
Fit the ranker over df and return a deployable pipeline.
feature_cols defaults to every non-reserved column (entity / product /
label / timestamp / bundle / holdings / group columns are reserved); on the
event grain, columns that describe the purchased item are excluded too
(:func:~parleml_ml4.ltr.frame.item_attribute_columns). An explicit list is used as
given; on the event grain the run warns when it names such a column.
resolved_split_strategy ¶
The concrete strategy split_strategy='auto' resolves to (LR4-04 / X4-1).
temporal when a timestamp is available to order occasions by, else entity.
Never plain random: a group is (entity, occasion) whenever bundle_col or
timestamp_col is set, so a random split over occasions puts a customer's other
baskets in training while their held-out basket is graded, with no time ordering to
make that realistic. (When groups are entities — neither knob set — the entity
split and the random split are the same partition, so auto costs nothing there.)
Next: Learning-to-rank guide · Recommender