RubixML / ML

A high-level machine learning and deep learning library for the PHP language.
https://rubixml.com
MIT License
2.03k stars 182 forks source link

Ecommerce recommender with multi events #10

Closed elfeffe closed 5 years ago

elfeffe commented 5 years ago

Great project! I would like to use it for e-commerce recommendations. I have events like View Peoduct, Buy Product, Add to Cart, View Newsletter, etc. How will you do something that consider all the information to recommend a product to a visitor based on his other actions? Can you create some sample project like the one that predicts a House Sale Price?

andrewdalpino commented 5 years ago

Thank you

There are multiple ways of implementing a recommendation engine - once you are certain that you want to use a machine learning approach, you will need to identify features (such as the last 10 product categories viewed, etc.) that allow the estimator to learn the mapping from input to a good recommendation. This will require some ingenuity and domain knowledge on your end.

Typically, learners require a fixed length feature vector as input. For this reason, if you would like to be able to consider all of the information you have regarding the user, you will need to come up with a fixed length representation of the data first (Ex. Category view counts, demographics, etc.). Again this will require some ingenuity on your part. I would start by becoming very familiar with the differences between categorical and continuous data representations.

Then you have to consider what you want your model output to be. Will it be the category of a product? A specific product? A score as to how much the estimator thinks the customer will like a specific product?

Once you narrow down the problem, let me know and if you had more questions we'll go from there

elfeffe commented 5 years ago

Thank you @andrewdalpino I have some information about people, like geographic zone, purchase quantity, etc. But what I have more is user to items actions. View item, add to cart item, bought item, spent time viewing item, etc. What I want is to recommend items based on that, ordered by the probability to buy the item. Buy is the target action, the rest is just secondary information that can help us to understand what the user wants. I think it will be great if we can assign some weight, because add to cart item is more than view item. View item 3 times is also more than view item. This recommender https://github.com/actionml/universal-recommender Is great, it just doesn’t assign weight to actions, but it uses all the actions (not with a fixed length) to recommend items based in the probability to reach the target action. Can we do something like that?

andrewdalpino commented 5 years ago

A Probabilistic classifier that outputs the probability of purchasing every product in the catalog will do the trick. However, there are some things to consider. Is the product catalog very large? Will it change frequently? If so, this model might not scale as well as you'd expect.

The prediction would look something like ...

{
    "guitar": 0.6,
    "soap": 0.1,
    "bananas": 0.3
}

... and you'd recommend the products with the highest probabilities

I cannot speak too much about the feature engineering as I'm not an expert in your domain, but it sounds like you can use those events as features just fine. Again, it will require some wrangling on your part. The training label of each sample will be the product or products they've purchased as a result of those events.

I am not familiar with that library either but maybe it would help to know that aside from machine learning you could also try a collaborative filtering approach

elfeffe commented 5 years ago

ok, thank you Andrea. i will check it

El vie., 28 dic. 2018 a las 0:19, Andrew DalPino (notifications@github.com) escribió:

A Probabilistic classifier that outputs the probability of purchasing every product in the catalog will do the trick. However, there are some things to consider. Is the product catalog very large? Will it change frequently? If so, this model might not scale as well as you'd expect.

I cannot speak about feature engineering as I'm not an expert in your domain, but it sounds like you can use those events as features just fine. Again, it will require some wrangling on your part.

I am not familiar with that library either but maybe it would help to know that aside from machine learning you could also try a collaborative filtering approach

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RubixML/RubixML/issues/10#issuecomment-450250953, or mute the thread https://github.com/notifications/unsubscribe-auth/AEf7w7O-WBpVgCcTxWAkbxit7z58GGcpks5u9VV9gaJpZM4Zf0UQ .