Oh NLP with Python

Building a Product Recommendation System for E-Commerce: Part II — Model Building

How I build a product recommendation system using python

Photo by Campaign Creators on Unsplash

Exploratory Data Analysis

Visualization Created Using SQL on ScoreFast Platform (by Author)
Visualization Created Using SQL on ScoreFast Platform (by Author)
Visualization Created Using SQL on ScoreFast Platform (by Author)
Visualization Created Using SQL on ScoreFast Platform (by Author)
Visualization Created Using SQL on ScoreFast Platform (by Author)
Visualization Created Using SQL on ScoreFast Platform (by Author)

Text Vectorization

Visualization of Word Embedding Vectors using Gensim and PCA (by Author)

Build a KNN model

indices = pd.Series(combined_df.product)#Build a KNN model
model = NearestNeighbors(n_neighbors=100,n_jobs=-1)
knn = model.fit(combined_df_drop_product)
def predict(name):dress_index = (combined_df[combined_df['product']==name]).index.tolist()
dress_index = dress_index[0]
distances, indices = knn.kneighbors(combined_df_drop_product.iloc[[dress_index],:])index = indices[0]
distance = distances[0]
nearest_list = []

for k in range(0,len(index)):
dress_name = combined_df.iloc[index[k],0]
if dress_name not in nearest_list:
nearest_list.append(dress_name)
return nearest_list[1:]
Patagonia Alpine Valley Dress’s Recommended Products from the site V.S the Model Prediction (by Author)

Product Reviews Sentiment Analysis

positive sentiment : (compound score >= 0.05)
neutral sentiment : (compound score > -0.05) and (compound score < 0.05)
negative sentiment : (compound score <= -0.05)

Visualization Created automatically on ScoreFast Platform (by Author)

☁️WordCloud Rating Group for all product

WordCloud Generated by Author

☁️WordCloud Rating Group for all product

WordCloud Generated by Author

Summary

Review Rating Prediction

Built regression models on ScoreFast™ (by Author)
Correlation between review rating and its compound score (by Author)

Final Thought

Acknowledgment

Reference

(っ◔◡◔)っ ♥ Data Scientist | 100K+ views | I write about Data Science, Interview Prep, Career and Productivity Tips ♥

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store