product recommender system SVD algorithm ,and API using flask
I used datasets from amzon product review, I've choosed Arts, Crafts and Sewing (meta & core5 ) becuase the size is small
the data sets after parsing and cleaning here!
- delete products with more than one product_id(asin)
with meta_titles(title,counts)
as
(
SELECT title,count(DISTINCT asin) counts from meta
GROUP by title
HAVING counts > 1
)
DELETE from meta where meta.title in (SELECT title from meta_titles)
- delete users with morethan one id
with core_names (reviewerName,counts)
as
(
SELECT reviewerName,count(DISTINCT reviewerID) counts from core5
GROUP by reviewerName
HAVING counts != 1
)
DELETE from core5 where reviewerName in (SELECT reviewerName from core_names)
- delete users with more than on name
with core_ids(reviewerID,counts)
as
(
SELECT reviewerID ,count(DISTINCT reviewerName) counts from core5
GROUP by reviewerID
HAVING counts != 1
)
DELETE from core5 WHERE reviewerID in (SELECT reviewerID from core_ids)
- create new table (final dataset) from joining two tables after cleaning
CREATE TABLE arts_crafts
as
SELECT meta.asin,meta.title,core5.overall as rating,meta.brand,meta.main_cat,meta.price,meta.image,core5.reviewerID,core5.reviewerName
from meta
join core5 on meta.asin = core5.asin
- arts_craftss
- result after building th model arts_crafts_result
this plot shows how the density of the dataset , as we see most products have only few rating this means sparse issue and so that I used SVD algo