I have successfully deployed on model on Cloud ML Engine and verified it is working with gcloud ml-engine models predict
by following the instructions, now I want to send predictions to it from my web app / javascript code. How do I do that?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
The online prediction API is a REST API, so you can use any library for sending HTTPS requests, although you will need to use Google's OAuth library to get your credentials. We will use the
googleapis
library for simplicity.The format of the prediction request is JSON, as described in the docs.
To exemplify, consider the Census example. A client for that might look like: