ML Study Jam — Forecasting model in BQML

Predict Taxi Fare with a BigQuery ML Forecasting Model

What is ML Study Jam?

What is BigQuery?

The flow of BigQuery ML Forecasting

Image for post
Image for post

Predict Taxi Fare with a BigQuery ML Forecasting Model

New York City Yellow Taxi Trips Record

Select features and create your training dataset

Tolls Amount
Fare Amount
Days of the week
Hour of Day
Pick up address
Drop off address
Number of passengers
Image for post
Image for post
The SQL query — Picture from ML Study Jam
Image for post
Image for post
The fields we want to select — Picture from ML Study Jam

Select a BQML model type and specify options

Image for post
Image for post
Three BQML model types — Picture from ML Study Jam
Image for post
Image for post
Use linear_reg as BQML model type to train the model — Picture from ML Study Jam
Image for post
Image for post
The final model — Picture from ML Study Jam

Evaluate classification model performance

Image for post
Image for post
Evaluate the performance of your model with the RMSE value — Picture from ML Study Jam
Image for post
Image for post
We get RMSE 9.477 here, that means the tolerance of prediction would be ±$9.47 different from the real value — Picture from ML Studt Jam

Predict taxi fare amount

Image for post
Image for post
Make predictions — Picture from ML Study Jam
Image for post
Image for post
The prediction result — Picture from ML Study Jam

Improving the model with Feature Engineering

Image for post
Image for post
Picture from ML Study Jam
Image for post
Image for post
We find some strange values here — Picture from ML Study Jam
Image for post
Image for post
Limit the fare_amount and the location — Picture from ML Study Jam
Image for post
Image for post
`stddev` shrinks from 650 to 9.1 — Picture from ML Study Jam

Use the new dataset to train the model.

Image for post
Image for post
Retrain a new model — Picture from ML Study Jam

and get a better RMSE after then.

Image for post
Image for post
Evaluate the dataset with the new model — Picture from ML Study Jam
Image for post
Image for post
Better RMSE — Picture from ML Study Jam

An Android/Flutter engineer at Line Corporation.