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) %>%
            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 intoduce 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. You may decide to build a machine learning model to predict users' ratings. Then 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