The WSRecommender function requires an item table and a user table.
The item table must be symmetric with respect to item1_column and item2_column. That is, if a row has 'apple' in item1_column and 'bread' in item2_column, then another row must have 'bread' in item1_column and 'apple' in item2_column, and these two rows must have the same value in similarity_column.
Column Name | Data Type | Description |
---|---|---|
item1_column | VARCHAR | Contains the first item (item1). Column on which the table is partitioned. The database handles NULL values in partitioning columns. You need not exclude them with a WHERE clause.
|
item2_column | VARCHAR | Contains the second item (item2). |
similarity_column | INTEGER or DOUBLE PRECISION | Contains the similarity score for item1 and item2. You can compute this score with the function CFilter—the number of times item1_column co-occurs with item2_column is their similarity score. |
accumulate_item_column | Any | Column to be copied to the output table. |
The function gives the best results when the items in item1_column and item2_column satisfy triangular inequality; that is: if a row has 'apple' in item1_column and 'bread' in item2_column, then another row must have 'bread' in item1_column and 'apple' in item2_column, and these two rows must have the same value in similarity_column.
Column Name | Data Type | Description |
---|---|---|
item_column | VARCHAR | Name of item that the user viewed or bought. Column on which the table is partitioned. The database handles NULL values in partitioning columns. You need not exclude them with a WHERE clause.
|
user_column | VARCHAR | Unique user identifier. |
preference_column | INTEGER | User preference score for the item. |
accumulate_user_column | Any | Column to be copied to the output table. |