J.C Guzman
J.C Guzman

Reputation: 1334

How to import trained machine learning model from AI Patform into cloud functions in python

I have a trained machine learning model to predict one metric of my data in firestore.

I have inserted data into bigquery to train the model and ones it is trained I want to deploy it to make predictions and insert this predictions again in firestore.

I have been reading a lot how to do this and finally I have found a way to do it: https://angularfirebase.com/lessons/serverless-machine-learning-with-python-and-firebase-cloud-functions/

I have a few questions of this guide:

  1. In the 4th step of this guide he save the model in firebase_admin storage. Why in firebase_admin storage and not in a google cloud storage?

enter image description here

  1. He deploy the model in Google cloud ML engine. Why he do that? what advantadges I have to deploy the model there instead of save the model in Google cloud storage and after that call it in cloud functions? or it is necessary to do this step?

enter image description here

  1. Once he deploy this model in Google cloud ML engine I can call it in a cloud fuction in python to run the model whatever the trigger I choose?

enter image description here

Upvotes: 0

Views: 953

Answers (1)

Andrei Tigau
Andrei Tigau

Reputation: 2048

1) You can use Cloud Storage, as well. In the tutorial he suggests a way of achieving something, but it is not the single absolute way.

2) You can also do what you have said, but the way from that tutorial is better, I would say. You have the advantage of exposing your model as an API endpoint. This way you will have less work to do in the Cloud Functions code which is good.

3) I am not sure if I understood this question. You should use a HTTP trigger since you are trying to hit an API endpoint.

Upvotes: 1

Related Questions