All Products
Search
Document Center

:popularity

Last Updated:Mar 02, 2023

Feature functions

You can use feature functions in sort expressions. Most feature functions can be used only in fine sort expressions. You can combine various syntax and statements to perform complex sorts. The fields that you reference in the parameters of feature functions must be configured as index fields or attribute fields based on the description of each function.

popularity: returns the popularity score of a commodity. The score indicates the popularity of the commodity.

1. Syntax

popularity(model_name)

2. Parameters

model_name: the name of the popularity model. You can create popularity models based on your business requirements. For more information, see Popularity models.

3. Return value
The return value is of the FLOAT type. Valid values: 0 to 1. A greater value indicates higher popularity.
4. Scenarios
Scenario 1: Create and train a popularity model, and then use this feature function together with another feature function in a fine sort expression to calculate the scores of commodities. text_relevance(title)*3+popularity(model_name)
5. Usage notes
This function must be used together with a popularity model. For more information about popularity models, see Popularity models.