Metrics

Let's explore some metrics that will help you define the “success” scenarios for a search session.

Choosing a metric for a machine learning model is of paramount importance. Machine learning models learn directly from the data, and no human intuition is encoded into the model. Hence, selecting the wrong metric results in the model becoming optimized for a completely wrong criterion.

There are two types of metrics to evaluate the success of a search query:

  1. Online metrics
  2. Offline metrics

We refer to metrics that are computed as part of user interaction in a live system as Online metrics. Meanwhile, offline metrics use offline data to measure the quality of your search engine and don’t rely on getting direct feedback from the users of the system.

Online metrics

In an online setting, you can base the success of a search session on user actions. On a per-query level, you can define success as the user action of clicking on a result.

A simple click-based metric is click-through rate.

Click-through rate

The click-through rate measures the ratio of clicks to impressions.

📝 Click through rate = NumberofclicksNumberofimpressions\frac{Numberofclicks}{Numberofimpressions}

In the above definition, an impression means a view. For example, when a search engine result page loads and the user has seen the result, you will consider that as an impression. A click on that result is your success.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.