minor fix on bqml demo
This commit is contained in:
parent
ca31192570
commit
a9bb717554
|
@ -73,15 +73,24 @@
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
|
"# Set your variables\n",
|
||||||
|
"PREFIX = 'your-prefix'\n",
|
||||||
|
"PROJECT_ID = 'your-project-id'"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"DATASET = \"{}_data\".format(PREFIX.replace(\"-\",\"_\")) \n",
|
||||||
"EXPERIMENT_NAME = 'bqml-experiment'\n",
|
"EXPERIMENT_NAME = 'bqml-experiment'\n",
|
||||||
"ENDPOINT_DISPLAY_NAME = 'bqml-endpoint'\n",
|
"ENDPOINT_DISPLAY_NAME = 'bqml-endpoint'\n",
|
||||||
"DATASET = \"{}_data\".format(PREFIX.replace(\"-\",\"_\")) \n",
|
|
||||||
"LOCATION = 'US'\n",
|
"LOCATION = 'US'\n",
|
||||||
"MODEL_NAME = 'bqml-model'\n",
|
"MODEL_NAME = 'bqml-model'\n",
|
||||||
"PIPELINE_NAME = 'bqml-vertex-pipeline'\n",
|
"PIPELINE_NAME = 'bqml-vertex-pipeline'\n",
|
||||||
"PIPELINE_ROOT = f\"gs://{PREFIX}-data\"\n",
|
"PIPELINE_ROOT = f\"gs://{PREFIX}-data\"\n",
|
||||||
"PREFIX = 'your-prefix'\n",
|
|
||||||
"PROJECT_ID = 'your-project-id'\n",
|
|
||||||
"REGION = 'us-central1'\n",
|
"REGION = 'us-central1'\n",
|
||||||
"SERVICE_ACCOUNT = f\"vertex-sa@{PROJECT_ID}.iam.gserviceaccount.com\""
|
"SERVICE_ACCOUNT = f\"vertex-sa@{PROJECT_ID}.iam.gserviceaccount.com\""
|
||||||
]
|
]
|
||||||
|
@ -227,7 +236,6 @@
|
||||||
" project=project_id,\n",
|
" project=project_id,\n",
|
||||||
" location=location,\n",
|
" location=location,\n",
|
||||||
" query=features_query.format(dataset=dataset, project_id=project_id),\n",
|
" query=features_query.format(dataset=dataset, project_id=project_id),\n",
|
||||||
" #job_configuration_query = {\"writeDisposition\": \"WRITE_TRUNCATE\"} #, \"destinationTable\":{\"projectId\":project_id,\"datasetId\":dataset,\"tableId\":\"ecommerce_abt_table\"}} #{\"destinationTable\":{\"projectId\":\"project_id\",\"datasetId\":dataset,\"tableId\":\"ecommerce_abt_table\"}}, #\"writeDisposition\": \"WRITE_TRUNCATE\", \n",
|
|
||||||
"\n",
|
"\n",
|
||||||
" ).after(create_dataset)\n",
|
" ).after(create_dataset)\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
@ -408,9 +416,6 @@
|
||||||
"source": [
|
"source": [
|
||||||
"# batch prediction on BigQuery\n",
|
"# batch prediction on BigQuery\n",
|
||||||
"\n",
|
"\n",
|
||||||
"with open(\"sql/explain_predict.sql\") as file:\n",
|
|
||||||
" explain_predict_query = file.read()\n",
|
|
||||||
"\n",
|
|
||||||
"client = bigquery_client = bigquery.Client(location=LOCATION, project=PROJECT_ID)\n",
|
"client = bigquery_client = bigquery.Client(location=LOCATION, project=PROJECT_ID)\n",
|
||||||
"batch_predictions = bigquery_client.query(\n",
|
"batch_predictions = bigquery_client.query(\n",
|
||||||
" explain_predict_query.format(\n",
|
" explain_predict_query.format(\n",
|
||||||
|
|
Loading…
Reference in New Issue