google-cloud-platformgoogle-cloud-mlgoogle-cloud-automlgoogle-cloud-vertex-ai

Vertex AI forecasting AutoML datatype mismatch


I could train the vertex AI AutoML forecating model but when I do batch prediction I get following error

Batch prediction job batch_prediction encountered the following errors:

Column "sales" expects type: NUMBER, the actual type is: STRING.

Below is a sample of test set I am passing for batch prediction in big query.

According to the documentation for batch prediction we have to send some training/historical data and forecasting dates. I did just that.

enter image description here


Solution

  • Google recommend you to use the same input format for ingraining and prediction. Seams you have trained your model using a input format here the column sales were a numeric type, and now in the prediction you a using a BigQuery table with the sales column as string.

    Delete this table and import the data again defining the schema manually, and set sales as a numeric field, as following:

    date:DATE,
    store_product_id:STRING,
    sales:NUMERIC