Yes! You will only need to know SQL to use the BigQuery Console UI. Follow the instructions below:

## Create your first BigQuery ML model

### Step 0:
Open the [BigQuery Console](https://console.cloud.google.com/bigquery).

### Step 1:
First, create a dataset in BigQuery called `bqmlretail` in the `EU` region. If you create it in a different region, Step 2 will not work.
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3399668%2F23bd8fee4e4828a49bf36bab54f74141%2Finstructions_createbqdataset.png?generation=1594202939078531&amp;alt=media)



### Step 2:
Run the CREATE MODEL query below. It should take ~1 min to train.

```
CREATE OR REPLACE MODEL bqmlretail.logreg_sample
TRANSFORM(
  LOWER(country) country_lower,
  totalPageviews,
  addedToCart
)
OPTIONS(
  model_type='logistic_reg', 
  INPUT_LABEL_COLS=["addedToCart"]) AS
SELECT 
  *
FROM
  `kaggleworkshops.google_analytics_sample_eu.train`
WHERE date BETWEEN TIMESTAMP("2016-08-01")
  AND TIMESTAMP("2016-08-31")
```

## How to create your submission file
### Step 3. Run this code
Using your model (e.g., `your_project_id.addtocart_model_name`), run the following code to make predictions on all the test data. This returns the probability that addedToCart = 1. Make sure to use at least the same features you used to create your model.

```
SELECT
  sessionId, 
  prob as addedToCart
FROM
  ML.PREDICT(MODEL bqmlretail.YOUR_MODEL_NAME, ## replace model name
    (
    SELECT 
      CONCAT(fullVisitorId, CAST(visitStartTime as string)) as sessionId, 
      *
    FROM
    `kaggleworkshops.google_analytics_sample_eu.test`
  )),
UNNEST(predicted_addedToCart_probs)
WHERE label = 1
```

### Step 4. Save your results as a CSV
Once your ML.PREDICT has finished running, click on **Save Results**, then choose **CSV (Google Drive)**:
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3399668%2F6b98c796f91435ccab4687dd5df98c2f%2Fsave_results.png?generation=1581284671726951&alt=media)
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3399668%2Fe86add0ff58b73240d5f736a914d6bf1%2Fsave_results_popup.png?generation=1581284672753246&alt=media)

_If you missed the link, you can re-export, or in the "Jobs history" section in the BigQuery Console, navigate to your export job, find the filename, and search in your Google Drive for the file._

### Step 5. Open the file in Google Drive
Wait for the "Open in Drive" link to appear in the bottom-left corner of your screen and click on it.
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3399668%2F4ea482fcbdd6763aef45215eec2973f8%2Fopen_in_drive.png?generation=1581285106012139&alt=media)
(**Can't find it?** Easiest way is to re-do Step 2. Otherwise, you can find the output filename under _Job History_ on the left-hand menu on the BigQuery Console, then check under _Personal History_.)

### Step 6. Download the CSV
Download the results from your Google Drive (~8MB):
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3399668%2F107b5d000d77eba26d0a85d451c3c3a3%2Fdownload_drive.png?generation=1581285350804991&alt=media)

### Step 7. Make your submission!
On the Submit Predictions page, follow the following instructions. Pasting the SQL query in the description will allow you to keep track of what models you used, and help the competition admins audit your queries.
![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F3399668%2Faa300b2d2b341ee3e7d386e4e2885c77%2Finstructions_makesubmission.png?generation=1594202366445976&alt=media)
