knitr::opts_chunk$set(echo = TRUE)
library(googleAuthR) library(googleCloudVertexAIR) options(googleAuthR.scopes.selected = "https://www.googleapis.com/auth/cloud-platform") gar_auth_service(json_file = Sys.getenv("GAR_SERVICE_JSON"))
projectId <- Sys.getenv("GCVA_DEFAULT_PROJECT_ID") gcva_region_set(region = "us-central1") gcva_project_set(projectId = projectId)
# hard code model that we know has a state = completed for demonstration purposes. (model <- Sys.getenv("GCVA_TEST_MODEL_NAME"))
(bq_source_uri <- sprintf("bq://%s.california_housing.batch_02", projectId)) (bq_destination_prefix <- sprintf("bq://%s.california_housing", projectId))
batch_prediction_job <- gcva_batch_predict( jobDisplayName = "california-housing-batch-02", model = model, bigquerySource = bq_source_uri, instancesFormat = "bigquery", predictionsFormat = "bigquery", bigqueryDestinationPrefix = bq_destination_prefix ) batch_prediction_job
To view more details and current state.
gcva_batch_prediction_job( batchPredictionJob = Sys.getenv("GCVA_BATCH_PREDICTION") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.