Prediction and analysis of customer purchase possibility of machine learning recommendation system

Time:2021-9-27

Last week, I wrote an article “prediction and analysis of customer purchase possibility in bank telemarketing based on machine learning”, which is the first attempt to verify the prediction and analysis of customer purchase possibility. Today is the second verification case of customer purchase possibility prediction analysis based on machine learning: recommendation system.

Recommendation system

Prediction and analysis of customer purchase possibility of machine learning recommendation system

Recommendation based on popularity: experts or product sales or main products in a certain period make a ranking list, and recommend according to the ranking list without user data

Recommendation based on user characteristics: through historical data, the algorithm (machine learning) makes recommendations according to user characteristics. When the user data can fill in some basic data

Knowledge-based recommendation: according to user requirements, products with higher income and lower risk are required. Products are screened in the database and then recommended

Content based recommendation: recommend items with similar content through products purchased by users. Here, similar content is provided by professionals

Collaborative filtering recommendation: directly calculate the item acquaintance through the algorithm. Note that the item similarity here is not determined by two item contents, but by the purchase situation. For example, most users who buy a (mobile phone) buy B (mobile phone case). The algorithm calculates that a and B are similar

Some machine learning recommendations: through some machine learning algorithms, such as FM (factorization machine), deep learning, deepfm, etc

For new users, one of three is usually selected

For old users, we usually use a variety of algorithms, and then weight to get the optimal recommendation list

Verification of three methods

There are three main methods to verify, collaborative filtering, FM (factorization machine) and deepfm.

Collaborative filtering algorithm

Calculate the similarity of all items (note that the content is not similar)

Prediction and analysis of customer purchase possibility of machine learning recommendation system

Recommended method:

Query the acquaintance of the items that the user has bought (or evaluated), and then weight the recommendation

Simple example

Prediction and analysis of customer purchase possibility of machine learning recommendation system

Final recommendation (left to right)

Prediction and analysis of customer purchase possibility of machine learning recommendation system

User = “1” is displayed based on collaborative filtering

Python   Print results   Only the top 5 movies seen here are printed, and only the top 10 movies after weighting are recommended

——WATCHED MOVIES——–

1193 “One Flew Over the Cuckoo’s Nest (1975)” ‘Drama’

2355 “Bug’s Life, A (1998)” “Animation|Children’s|Comedy”

1287 ‘Ben-Hur (1959)’ ‘Action|Adventure|Drama’

2804 ‘Christmas Story, A (1983)’ ‘Comedy|Drama’

595 ‘Beauty and the Beast (1991)’ “Animation|Children’s|Musical”

——RECOMMEND MOVIES——–

1196 ‘Star Wars: Episode V – The Empire Strikes Back (1980)’ ‘Action|Adventure|Drama|Sci-Fi|War’]]

1265 ‘Groundhog Day (1993)’ ‘Comedy|Romance’

364 ‘Lion King, The (1994)’ “Animation|Children’s|Musical”

260 ‘Star Wars: Episode IV – A New Hope (1977)’ ‘Action|Adventure|Fantasy|Sci-Fi’

2571 ‘Matrix, The (1999)’ ‘Action|Sci-Fi|Thriller’

2716 ‘Ghostbusters (1984)’ ‘Comedy|Horror’

1022 ‘Cinderella (1950)’ “Animation|Children’s|Musical”

318 ‘Shawshank Redemption, The (1994)’ ‘Drama’

1282 ‘Fantasia (1940)’ “Animation|Children’s|Musical”

1580 ‘Men in Black (1997)’ ‘Action|Adventure|Comedy|Sci-Fi’

Factorization machine algorithm

The scoring matrix is a matrix that reflects users’ preference for items, as shown in the following figure

Prediction and analysis of customer purchase possibility of machine learning recommendation system

The factorization machine is an algorithm to complete the scoring matrix (red is the algorithm completion), and then recommend according to the score (recommend item 3 > item 6 > item 1 > item 4 > item 5 to user 1)

Algorithm explanation: find P and Q through known scores. K is a hidden feature, and different values can be set

Prediction and analysis of customer purchase possibility of machine learning recommendation system

The effect of factorizer algorithm is as follows

——RECOMMEND MOVIES——–

318 ‘Shawshank Redemption, The (1994)’

858 ‘Godfather, The (1972)’

1198 ‘Raiders of the Lost Ark (1981)’

50 ‘Usual Suspects, The (1995)’

2858 ‘American Beauty (1999)’

912 ‘Casablanca (1942)’

593 ‘Silence of the Lambs, The (1991)’

750 ‘Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb (1963)’

908 ‘North by Northwest (1959)’

1221 ‘Godfather: Part II, The (1974)’

deepFMalgorithm

Deepfm is a combination of FM algorithm and deep learning algorithm. The structure is as follows

Prediction and analysis of customer purchase possibility of machine learning recommendation system

The effect of deepfm algorithm is as follows

——RECOMMEND MOVIES——–

593 ‘Silence of the Lambs, The (1991)’

1617 ‘L.A. Confidential (1997)’

1233 ‘Boat, The (Das Boot) (1981)’

318 ‘Shawshank Redemption, The (1994)’

1198 ‘Raiders of the Lost Ark (1981)’

858 ‘Godfather, The (1972)’

733 ‘Rock, The (1996)’

1276 ‘Cool Hand Luke (1967)’

2571 ‘Matrix, The (1999)’

953 “It’s a Wonderful Life (1946)”

Model evaluation index

  1. User satisfaction
  2. Prediction accuracy
  3. Coverage
  4. Diversity
  5. Novelty
  6. Surprise degree
  7. Degree of trust
  8. Real time
  9. Robustness
  10. Business objectives

Objective of offline experiment

Maximize prediction accuracy

Under the condition of meeting certain requirements

such as

  • Coverage > 60%
  • Diversity > 30%
  • Novelty > 10%

Prediction and analysis of customer purchase possibility of machine learning recommendation system

Recommended system algorithm summary

  1. Many algorithms are suitable for different scenarios.
  2. Mixed recommendation to improve the purchase rate. For example, when users buy mobile phones, they recommend other mobile phones according to similar contents; According to collaborative filtering, it is recommended that people who buy mobile phones such as mobile phone cases will probably buy the same size; According to the score estimation algorithm, according to the user’s recommendation, you may buy beer and clothes. In the limited recommendation position, mixed recommendation can improve the success rate.

Huidu big data analysis platform endows enterprise data with the ability of learning, reasoning, thinking, prediction and planning, so as to drive decision-making and create the highest business value.