ohliumliu / flash_deals_c9

2 stars 0 forks source link

spark prototype 1 #1

Open ohliumliu opened 7 years ago

ohliumliu commented 7 years ago

Prototype 1.

get more records from Amazon. use spark to read these records, and perform k-mean. and write the result to a new table.

  1. create history table, and populate the table with random data.
  2. use spark stream to read history data, and perform classification, and write back to database.
  3. frontend javascript, use ajax to send cookie id and url back to RoR.
  4. create RoR to handle ajax call.
ohliumliu commented 7 years ago

6cfbd1f set up spark local mode following this

ohliumliu commented 7 years ago
ohliumliu commented 7 years ago

About using spark streaming to check mysql database https://forums.databricks.com/questions/8736/get-mysqlrdbms-data-using-spark-streaming.html

ohliumliu commented 7 years ago

a tutorial on spark recommendation system with a web app https://www.codementor.io/spark/tutorial/building-a-web-service-with-apache-spark-flask-example-app-part2

ohliumliu commented 7 years ago

Workflow?

ohliumliu commented 7 years ago

Use spark stream

ohliumliu commented 7 years ago

See the following examples for spark streaming + machine learning

ohliumliu commented 7 years ago

Several tables involved

_In this design, only those clicked by a user will be added to the products_cluster table. Is this what we want? Probably. productscluster also has the original entries used for training the model, and these are probably a large set.

ohliumliu commented 7 years ago

2d3576e For some reason, the ajax call only fires once for each link. This applies to both product link and the hard-coded click_history link on the top right corner. Need to restart server.

After some time, it started to work.

javascript has return false, but href is still followed ?