Training the matrix factorization model
In this section, we'll train the BigQuery ML matrix factorization model in order to build a recommendation system with the e-commerce data that we've already prepared.
Let's start training the purchase_recommender
ML model by executing the following SQL statement:
CREATE OR REPLACE MODEL `09_recommendation_engine.purchase_recommender` OPTIONS(model_type='matrix_factorization', user_col='fullVisitorID', item_col='purchased_product_id', rating_col='quantity', feedback_type='implicit' ) AS SELECT fullVisitorID, purchased_product_id, quantity FROM `09_recommendation_engine.product_purchases`;
The first few lines of the query are composed...