Creating a Custom Scenario
A custom scenario allows you to perform offline computing tasks and obtain the candidate set IDs using selected strategies and rules. The obtained candidate set IDs are used in online process flows to generate recommendation results.
Prerequisites
- A data source has been created and data exploration has been completed.
- Ensure that the account is not in arrears because resources are consumed when training jobs are running.
- Ensure that the OBS directory you use and RES are in the same region.
Basic Information
- Log in to the RES management console. Choose Recommendation Scenarios > Custom Scenarios from the left navigation bar. The custom scenario list is displayed by default.
- Click Create in the upper right corner to go to the page where you can customize a scenario.
- On the displayed page, set parameters in the Basic Info area. The basic information includes the scenario name, data source, and scenario specifications. For details, see Table 1.
- Click Next: Configure Retrieval Strategy. Figure 1 Basic information of a custom scenario
Table 1 Parameters of a custom scenario Parameter
Sub-Parameter
Description
Basic Info
Scenario Name
The name of a custom scenario. A custom scenario name can contain up to 64 characters. Only digits, uppercase and lowercase letters, underscores (_), and hyphens (-) are allowed. This parameter is mandatory.
The name cannot be changed after creation.
Scenario Type
The service type.
- User-based item recommendation: Users often have similar behaviors. The system recommends items to users based on their similar behaviors. For example, an e-commerce platform recommends items that are viewed or bought by a group of users to another group of users. Two groups of users can have similar behaviors, such as viewing, clicking, and buying.
- User-based user recommendation: RES makes recommendations based on similar behaviors or features. For example, on social media networks, you can recommend one group of users to another group of users with similar behaviors or features.
- Item-based item recommendation: If two items have similar features or certain associations, they are generally viewed or purchased together. You can make recommendations based on these features or associations. For example, a media asset platform calculates the similarity or associations between items. When a user views an item, the system recommends the most similar or related item to the user.
- Item-based item recommendation: If two items have similar features or certain associations, they are generally purchased together. You can make recommendations based on these features or associations. For example, a real estate platform calculates the similarity or associations between items. When a user views a property, the real estate agents who own the same type of properties are recommended to the user.
Service Type
Select a service type suited to your needs.
- Recommendation engine: The recommendation engine is used to filter and rank candidate sets generated by the RES retrieval strategies.
- Ranking engine: The ranking engine does not need to be configured with a retrieval strategy. Users can provide their own candidate sets and sort them using the RES ranking strategies.
Data Source
Select an existing data source in RES from the drop-down list. If no data source is available in RES, no result will be displayed in the drop-down list.
Data Range
Selecting Data
Select behavior data of the N days before the latest date to calculate user preferences. The value must be no less than 30 days.
Item Category
Whether to perform analysis based on only the specified item type For example, for news websites, the value of this parameter can be entertainment, sports, or current affairs.
Scenario Specifications
Offline Computing Specifications
The options are 4CU, 8CU, 16CU, and 32CU.
Real-time Computing Specifications
The options are 2CU, 4CU, 8CU, and 16CU.
Ranking Model Specifications
The options are GPU-P100 and 8CU.
Concurrent Online Services
Maximum number of online service invoking times. Unit: Times/s. The default value is 5.
Adding a Retrieval Strategy
You can select an appropriate retrieval strategy suited to your business requirements. The retrieval strategy configures the offline computing logic and starts an offline computing task to generate recommendation candidate sets.
The links below contain more details:
- Nearline Retrieval
- Recommendation Based on Comprehensive Behavior Popularity
- ItemCF Recommendation
- UserCF Recommendation
- ALS-based MF Recommendation
- Business Rule-Historical Behavior-based Recommendation
- Business Rule-Manual Import
- Feature Matching - based Retrieval Strategy
- UCB-based Retrieval Strategy
- Enter the Retrieval Strategy tab page, and click Add to select a retrieval strategy suited to your site requirements. This section uses ALS-based MF recommendation as an example. See Figure 2.
- Name: Set this parameter based on service requirements.
- Description: Enter a description of the strategy. In this example, enter This is a test strategy.
- Implicit Vector: The default value is 10.
- Iterations: The default value is 10.
- Optimization Lambda: The default value is 0.01.
- Max. Recommendation Results: The default value is 100.
- Click OK. The saved retrieval strategy is displayed in the list below.
- (Optional) Go to the right of the target retrieval strategy to edit or delete it.
Deleted retrieval strategies cannot be recovered. Exercise caution when performing this operation.
- Hover your cursor over the question mark next to the strategy name to view help information. When the strategy is configured, click Next: Filter Rule.
Adding a Filter Rule
Use filter rules to filter out inappropriate candidates from candidate sets.
- If you select Ranking engine, the Filter Rule tab page is displayed after you complete the basic information.
- If you select Recommendation engine, the Filter Rule tab page is displayed after you configure a retrieval strategy.
- Enter the Filter Rule tab page and click Add. See Figure 3. Filter Rule describes the parameter details.
- Name: Set this parameter based on service requirements.
- Description: Enter a description of the filter rule. In this example, enter This is a test strategy.
- Frequency: In this example, select View and Buy and set Min. Times to 3 within 7 days.
- Filter Logic: The options are AND and OR. AND: In this example, AND means an item has been liked for more than three times within seven days and consumed more than three times within seven days.
- Max. Recommendation Results: The default value is 100.
- Click OK. The saved filter rule is displayed in the list below.
- (Optional) Go to the right of the target filter rule to edit or delete it.
- Hover your cursor over the question mark next to the rule name to view help information. When the rule is configured, click Next: Ranking Strategy.
Ranking Strategy - Offline Feature Engineering
Before ranking data, you need to perform offline feature engineering to convert the data into the format required for ranking.
- Enter the Ranking Strategy tab page. See Figure 4. Ranking Strategy - Offline Feature Engineering describes the parameter details.
- Click OK. The saved strategy is displayed in the list below.
- Go to the right of the target ranking strategy to edit or delete it.
- Hover your cursor over the question mark next to the strategy name to view help information.
Ranking Strategy - Offline Ranking Strategy
You can use the offline ranking strategy to perform secondary ranking on candidate sets generated by the retrieval strategy. If a ranking model is used offline, the ranking strategy can only be used after it is created, as explained in Ranking Strategy - Offline Feature Engineering.
The following links contain more details:
- Enter the Ranking Strategy tab page. See Figure 5. Select an appropriate ranking strategy from the Add Ranking Strategy drop-down list based on service requirements.
- Click OK. The saved strategy is displayed in the list below.
- (Optional) Go to the right of the target strategy to edit or delete it.
- Hover your cursor over the question mark next to the strategy name to view help information.
Ranking Strategy - Nearline Feature Engineering
Nearline feature engineering is used to process features of nearline data to generate feature data for ranking. This configuration can be performed only after operations related to the offline ranking model are complete.
Create Nearline Feature Engineering is disabled by default. Turn on
. In the displayed dialog box, click Yes.
Ranking Strategy - Nearline Ranking Strategy
A nearline ranking strategy is used to sort online real-time data. If a ranking model is used online, the ranking strategy can only be used after it is created, as explained in Ranking Strategy - Nearline Feature Engineering.
- Enter the page for creating a ranking strategy and select Add Nearline Ranking Strategy.
- Configure online learning parameters.
- Name: Enter a name for the online ranking strategy.
- Offline Ranking Model Name: Select a job (created by following the instructions in Ranking Strategy - Offline Ranking Strategy) from the drop-down list.
- Update Interval: the interval for updating data online. The default value is 60 minutes.
- Optimizer: Logistic Regression (LR) lists the parameter details. Figure 6 Adding a nearline ranking strategy
- Click OK. The saved strategy is displayed in the list below.
- (Optional) Go to the right of the target strategy to edit or delete it.
- After setting the parameters, click Next: Online Service.
Online Service
- On the Online Service tab page, enter basic information. Enter a name and description or enable the alarm function based on site requirements. Turn on
to report alarms when there are exceptions and select an SMN topic from the drop-down list. If you do not have any available topics, go to the SMN console to create a topic. - Click Add to add an online process flow and name it. You can deploy a maximum of five online process flows. Configure the online process flow based on the selected service type, including key information such as the retrieval pool, filters, and ranking sequence. For more details, see Table 1. Figure 7 Creating an online process flow
- When the parameters are configured, click OK. When the scenario is created, click Publish in the Operation column of the target scenario in the custom scenario list. The job is executed when the scenario status is Running.
(Optional) Effect Evaluation
When the custom scenario is created, the system automatically switches to the custom scenario list page. Click the target scenario name to go to the details page and create an effect evaluation job.
- On the Effect Evaluation tab page. click
. On the displayed page, enter the job name and description. - Name: name of the effect evaluation to be created, which contains only letters, numbers, hyphens (-), and underscores (_). The name must contain no more than 64 characters. Figure 8 Creating an effect evaluation job
- Name: name of the effect evaluation to be created, which contains only letters, numbers, hyphens (-), and underscores (_). The name must contain no more than 64 characters.
- Configure the parameters for creating an effect evaluation job. Refer to Table 1.
- When the configuration is complete, click OK. The job is displayed in the list on the Effect Evaluation tab page. Hover your cursor over a job to edit, view, execute, or delete it.
- View effect evaluation jobs in the Completed status on the Effect Evaluation Jobs page and the evaluation result chart on the job details page.
Last Article: Introduction to Custom Scenario
Next Article: Algorithm and Parameter Description




Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.