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:
- Online metrics
- 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.
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.
The click-through rate measures the ratio of clicks to impressions.
📝 Click through rate =
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.