liveBook · Manning

Google Vertex AI

As explained in Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI

Vertex AI is Google Cloud's managed machine-learning platform for developing, training, deploying, and managing machine-learning models.

Google Vertex AI provides a managed Google Cloud environment for serving a trained machine-learning model through an endpoint. A Kuala Lumpur real-estate price model moves from local Flask deployment to a cloud URL that applications can invoke. section 10.0 section 10.4.3

A practical deployment workflow is:

  • Create a Google Cloud project and Cloud Storage bucket, then upload the trained model artifact. section 10.3 section 10.4
  • Import the artifact into the Vertex AI Model Registry, selecting the training framework and matching framework version. section 10.4.2
  • Deploy a model version to an endpoint and choose resources proportionate to the workload; a minimal machine type suits a test deployment. section 10.4.3
  • Test the endpoint with valid JSON, then connect a Flask application through the Vertex AI Python SDK. section 10.4.4 section 10.5 section 10.5.1

Testing a property prediction endpoint

A request for a three-room condominium in Sentul uses feature values as single-element arrays and double-quoted JSON. The endpoint returns the model output; applying the sigmoid function converts it into a 17.9 percent probability that the property exceeds the median price. section 10.4.4

Listing 10.9 show-prediction.html view function for endpoints
def show_prediction():
    scoring_dict = {}
    for col in config['scoring_columns_cat']:
        print("value for "+col+" is: "+str(request.args.get(col))) 
        scoring_dict[col] = str(request.args.get(col))
    for col in config['scoring_columns_cont']:
        scoring_dict[col] = float(request.args.get(col))
    scoring_dict['size_type_bin'] = str(request.args.get('size_type'))+' 1'
    scoring_dict.pop('size_type')                            #1
    input_dict = {name: [value] for name, \
value in scoring_dict.items()}                               #2
    print("input_dict: ",input_dict)
    predictions = predict_custom_trained_model_sample(
    project = config['endpoint']['project'],
    endpoint_id = config['endpoint']['endpoint_id'],
    location = config['endpoint']['location'],
    instances = input_dict)                                  #3
    prob = tf.nn.sigmoid(predictions[0])

The Flask view shows the integration boundary: remove unused features, wrap each value in a one-item list, and call the endpoint with project and endpoint identifiers. section 10.5.2

How Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI covers it

How deep it goes
Traces project setup, artifact import, endpoint deployment, console testing, and Flask integration without detailing platform internals.
Examples
Uses a Kuala Lumpur real-estate classifier, console JSON prediction, and a Flask application adapted from local model serving.
What it assumes
Assumes a trained model and basic Flask application, while introducing Google Cloud projects, buckets, registries, endpoints, and SDK access.
What you can do after
Operate/configure a Vertex AI endpoint and invoke it from a Flask application using the Python SDK.
How it connects
Connects Google Cloud Storage, Model Registry, endpoints, Flask, Python SDK, TensorFlow, and JSON request formatting.

Also explained in

Compare how 2 books explain Google Vertex AI →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI. The section links point to the parts of the book it draws on.