Using Train Matchbox Recommender for Data Without Ratings RRS feed

  • Question

  • I want to use Matchbox recommender to recommend products

    My Data consist of Customerid, productid, units (I dont have rating data)

    so I generate Rating Data using rnorm function in R to generates a vector of normally distributed random numbers. Is it Valid? this approach ?

    For reference here is the R script to generate ratings

    # Map 1-based optional input ports to variables
    dataset1 <- maml.mapInputPort(1) # class: data.frame

    if (nrow(dataset1)>1)
        cap <- function (v, low=0, high=10) {
            v[v<low] <- abs(v[v<low])
            v[v>high] <- high - (v[v>high]-high)
        ratings <- dataset1 %>% 
            group_by(CustomerId, ProductId) %>% 
            summarise(Units=sum(Units)) %>% 
            select(ProductId, CustomerId, Units) %>%
            as.data.frame() %>%
            arrange(ProductId, Units) 
        for(id in unique(ratings$ProductId)) {
            f <- ratings$ProductId==id
            ratings$Rating[f] <- cap(rnorm(sum(f),7))
    } else {
        ratings <- dataset1 %>% mutate(Rating=Units)

    data.set <- ratings %>% mutate(User=CustomerId, Item=ProductId) %>% select (User, Item, Rating)

    # Select data.frame to be sent to the output Dataset port

    Monday, September 9, 2019 9:21 AM

All replies

  • Hi,


    I wouldn't recommend using random ratings as this may introduce bias in the prediction results. If you currently don't have ratings data, it may be more appropriate to implement some type of logic that would generate rating scores based on users' buying patterns. Once you start gathering ratings data from users, the predictions may become more personalized. For more information on how to train  Matchbox Recommender, please read the following. Hope this helps. Please let me know if you have further questions. Thanks.



    Azure CXP Community.

    Tuesday, September 10, 2019 3:47 PM
  • Thanks for your reply.

    If I dont have rating data, Can I use instead the count of product, like how many times the customer bought this product?

    Sunday, September 29, 2019 10:51 AM
  • Hi,


    The Matchbox recommender expects a dataset containing user-item-rating triples. So, explicitly specifying count of products as ratings may not work in this case. However, you may use for example “likes”, “favorites”, “wish list”, "reviews", "product feedback" as basis for calculating user item ratings score until you develop a rating system. So, if a user liked a product or added an item to favorites/wish list, that may count as positive rating and vice versa. If you received reviews or feedback about a product, you may perform sentiment analysis as basis for determining user item ratings score. Please let me know if I can be of any more help. Thanks.





    If a post helps to resolve your issue, please click “Mark as Answer” and/or “Vote as helpful”. By marking a post as Answered and/or Helpful, you help others find the answer faster.  Thanks.

    Monday, September 30, 2019 4:59 PM