liveBook · Manning

Feature logging

As explained in AI-Powered Search

Feature logging is the recording or computation of feature values associated with search examples for later model training or analysis.

Feature logging records computed feature values for each labeled query-document pair so a learning-to-rank model can learn how ranking signals relate to relevance. A feature may describe the document, query, or their relationship, provided the search engine can compute it quickly. section 10.3

A practical feature-logging workflow connects judgments to search-engine computations:

  • Start with a judgment list containing queries, graded documents, and relevance labels. section 10.1.2
  • Define and load features such as title matching, overview matching, release year, commute distance, or knowledge-graph relationships. section 10.3
  • Request feature values for every graded document associated with each unique query, passing query-time information required by the features. section 10.3.2
  • Attach returned values to the judgments in feature-store order, producing training rows for model training and evaluation. section 10.3.2

Logging features for “social network”

For one relevant movie and three irrelevant movies, the search engine returns title_bm25, overview_bm25, and release_year. The relevant The Social Network row becomes [8.243603, 3.8143613, 2010.0], while each competing document receives its own vector. These vectors remain paired with their grades so an algorithm can learn relative ranking patterns. section 10.3 section 10.3.2

Listing 10.5 Logging feature values for social network results
ids = ["37799", "267752", "38408", "28303"]  #1
options = {"keywords": "social network"}
ltr.get_logged_features("movie_model", ids,  #2
                        options=options, )  #2
                        fields=["id", "title"])  #2
display(response)

Inspect an engine-specific request that retrieves logged features for selected document IDs, using a feature store and query-time keywords. section 10.3.2

How AI-Powered Search covers it

How deep it goes
Explains feature definitions, engine requests, returned vectors, and Python transformation, but defers model-training algorithms.
Examples
Uses movie judgments for “social network” and “star wars,” with title matching, overview matching, and release-year values.
What it assumes
Assumes a judgment list and loaded search features, while defining feature values and their alignment with labeled documents.
What you can do after
Build logged training rows by requesting engine features and attaching returned vectors to graded query-document judgments.
How it connects
Connects search features with judgment lists, feature engineering, ranking functions, search engines, and learning-to-rank models.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Search. The section links point to the parts of the book it draws on.