This application demonstrates:

  • Sending Online Prediction (or Inference) request to the REST API endpoint of a trained model hosted on GCP ML Engine; see model details below; Note; the income prediction is based on two scenarios only: income >50k; or income <= 50k.
  • Using Google API Javascript Client Libraries to make the request from the browser.
  • OAuth 2.0 authorization is needed to access the REST API, using Google Id. Click Signin for Authorization before making prediction.
  • Changing the "capital_loss" parameter can greatly effect the predicted income; therefore we make this parameter adjustable for demo purpose. All other parameters are predefined and locked down as shown below, to simplify the scope.

The trained Machine Learning model is for predicting Income based on the demographic input data, as used in the 1994 Census database. An example of the input data is shown below. The model was trained and deployed on the GCP ML Engine, as described in the Google Cloud - Getting Started tutorial . No effort has been spent in tuning the model; leaving it for future exercise.

Demographic
age25
workclassPrivate
education11th
education_num7
Marital_statusNever-married
occupationMachine-op-inspct
relationshipOwn-child
raceBlack
genderMale
capital_gain0
hours_per_week40
native_countryUnited-States
capital_loss (type: positive integer):