Evaluating the linear regression model
For the evaluation stage of our BigQuery ML model, we'll use the ML.EVALUATE
function and the table that we've expressly created to host the evaluation records. These are completely separate from the rows that are used during the training phase.
Let's execute the following query to evaluate our ML model on the evaluation table:
SELECT * FROM ML.EVALUATE(MODEL `04_nyc_bike_sharing.trip_duration_by_stations_and_day`, ( SELECT start_station_name, end_station_name, IF (EXTRACT(DAYOFWEEK FROM starttime)=1 OR EXTRACT(DAYOFWEEK FROM starttime)=7, ...