Creating Strategies in the Data Science Workbench
Retailers with analytics teams and data scientists can define new algorithms and test them against the 200+ road-tested strategies that are included in the standard Recommend license.
There are size limits per strategy. A query/strategy should not exceed 1GB. Anything that does exceed this limit will be flagged, monitored, and may be revised due to performance considerations.
Creating Strategies Using the Strategy Publisher
To create a new strategy:
- On the Omnichannel Personalization dashboard, go to Optimization > Data Science Workbench.
- Click +New Strategy. The Strategy Publisher area is displayed.
- Type in the name of your new strategy.
Note: The name you choose must be unique from any other strategies existing on your given site.
- Next, select the Table to use for this Strategy from the dropdown. The table is where the data for your strategy will come from and will either come from the set of rr tables readily available, or by writing a SQL query.
- Select the Strategy Type from the dropdown.
Available strategy types:
- Brand: Uses Brand ID as seed that gets keyed off. Example: BrandTopSellers.
- Category: Uses Category ID as seed that gets keyed off. Example: CategoryTopProducts.
- Composable: Uses up to 4 separate keys. For example, if you are looking to create a strategy that filters by category, and segment, you would select Composable as the strategy type, and "category" and "segment" as keys.
- Notes:
- The table for this strategy should include all keys in one column, separated by a semicolon (;)
- When defining the key column in the query used to build the table, the semicolon must be escaped (for example, concat_ws('\;',user_id,category_id))
- The column containing the score should be named 'score'.
- The columns must be in the following order: Key, Product ID, score.
- DMA: Uses Designated Market Area as seed
-
MultiProduct: Uses Product ID as seed, stitching together multiple product IDs so more than one product can be used as a seed. Example: MultiItemPurchaseCP
-
Product: Uses Product ID as seed, can only use one product at a time. Example: ClickCP
-
Search: Uses internal search term as seed. Example: SolrSearchToView
-
Segment: Uses Segment ID as seed, filtering to only look at other users within the same segment. Example: ClickCPInSegment
-
SiteWide: Can be applied across site. Example: TopSellers
-
User: Uses User ID as seed. Example: RecentHistoricalItems
Example:
Key | Product ID | Score |
---|---|---|
user_id;category_id | product_id | Score |
1234;p-13387 | p4595013 | 0.34 |
Once you have a table and Strategy type selected, you will see the Select Key, Select Product ID, and Select Product Score fields move from gray to white, indicating they are now available to set. This is because each of these fields are populated by columns within the table and directly relate to the type of strategy you have selected.
-
Select key from the dropdown. Your choices will be limited based on your input in the lines above, with each choice representing a column from the table you selected. Select the column you want to act as the key or seed for the strategy.
-
Select Product ID from the dropdown. This identifies the column the strategy should use to identify the individual product.
-
Select Product Score from the dropdown. This identifies how the strategy should rank products to be recommended.
-
To have the strategy leverage events for a given user stored in their User Profile, select the Personalized Strategy checkbox. This means the strategy incorporates views, clicks, and purchases the user has made historically into the recommendations.
Note: DMA, SiteWide and User Strategy Types are not available with the Personalized Strategy selection.
-
If desired, schedule your data update. To do so, select the query you want to update. To refresh on what the query is exactly, you can click on the eye icon next to the query dropdown. To select days, you want to update to run, click on the given day so its background color changes. Use the three dropdowns below the list of days to set what time of day you want these updates to run. You can set it to update up to 3 times in one day.
-
Click Publish. Your strategy will appear in the Omnichannel Personalization runtime system in an hour.
Note: Use of tables with strategies: It is possible to use the same table for multiple strategies, but to do so, the strategies must be a different type. If they are not a different type, it is essentially a duplicate strategy.
Managing Custom Strategies
After the strategy is published, you can manage it from the same page:
The Strategies tab contains the following information for all strategies you have created via the Strategy Publisher for your site:
- Strategy Name
- The Table that the strategy is using
- The Strategy Type
- The columns that the strategy uses for Key, Product ID and Scoring the recommendations
- Whether or not the strategy is a Sponsored Product Strategy.
- Whether or not boosting rules will apply to the strategy - When selected, boosts will apply for the given strategy when it fits the boost rule context.
- Status - Displays the most recent status of the scheduled update for each strategy.
- Green check: The scheduled update was successful.
- Red exclamation point with the entire row highlighted in red: The scheduled update failed.
- Warning: Hovering over the status icon provides more details about the issue. For example. Defined indicates that the strategy has been defined but not yet scheduled.
You can also do the following:
- Delete strategies: To conserve storage space, delete strategies that are no longer used or underperforming. Select the checkbox to the left of the Strategy name and click
next to New Strategy. You can delete as many strategies at once as you see. Deleting the strategy will also delete the update schedule attached to it.
- View details: Hovering over a strategy name row shows the Details link below the Strategy name. Clicking on this will open an overlay that gives you a look at whether or not scheduled updates processed successfully, along with when the update was attempted.
- View/Edit Schedule: Similar to Details, hovering over a strategy name row shows the View/Edit Schedule link. If you click this link, an overlay appears that allows you to view and edit the update schedule, similar to how you set the schedule in creating your strategy.
- If a schedule has not been set up, the Schedule link appears that takes you to the same overlay to set up an update schedule.
Note: If your strategy is failing to build, verify there are no comments in the associated query, as this may be causing the query to hang, which causes the model to not build and the strategy to fail.
Using Custom Strategies
To use your custom strategy, enable it for placements from the Strategy Configuration page just like any other strategy.
Enable your strategy on each of the page types where you plan to use it. Don't forget to give it a strategy message.
DSW Strategies and Compound Strategies
DSW strategies are fully supported and usable as a component strategy of compound strategies without limitation. They should behave just as out of the box strategies do.