Deploying and scoring a Keras model model in Batch

After a trained model has been identified for serving, you can deploy it by using the batch deployment. The batch deployment will read the input data file from source bucket and save the prediction result to files in a target bucket.

Prerequisites for deploying and serving a Keras in Batch

Before you deploy a Keras model and score it, the following prerequisites must be implemented at the time you save the trained model:

  • You need to train the model using the training service. Details on how to train a model can be found here
  • Keras's save() API should be used for saving the trained Keras model. You can use Experiments to train and save the model.
  • Cloud Object Storage instance details has to be provided during the batch deployment. This is used for storing the input data files for the prediction and for storing the prediction result.
  • Model should be persisted in WML Repository.

Batch Deployment of Keras model

To perform batch deployment on a Keras model, you must create the input data in Source Bucket(Cloud Object Storage) for that particular framework.

Add the input data files in the Source Bucket for Keras model

The input records for batch scoring must be specified as a JSON object in separate files. The JSON object in the file must contain the key-value pairs in the following table.

Key Values
values Input scoring data as required by the Keras model as a JSON object
  • These input data files needs to be placed in the root of bucket in Source Bucket(COS) and each input data file must have a single scoring record.
  • Multiple inputs records can provided by placing in separate input data files.
  • You must make sure only input data files are present in the source bucket of COS.
  1. Creating of input data file

    Refer to the following example for defining the input_data_file key for a model:

    Method 1:

       {
         "values":[[[[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.2705882489681244], [0.5960784554481506], [0.929411768913269], [0.9960784316062927], [0.9960784316062927], [1.0], [0.9960784316062927], [0.9882352948188782], [0.20392157137393951], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.34117648005485535], [0.6431372761726379], [0.929411768913269], [0.9921568632125854], [0.9960784316062927], [0.8549019694328308], [0.5411764979362488], [0.32549020648002625], [0.15294118225574493], [0.6039215922355652], [0.9960784316062927], [0.529411792755127], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.5411764979362488], [0.9647058844566345], [0.9921568632125854], [0.9960784316062927], [0.8470588326454163], [0.6549019813537598], [0.21176470816135406], [0.019607843831181526], [0.0], [0.0], [0.0], [0.3921568691730499], [0.7490196228027344], [0.0117647061124444], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.9137254953384399], [0.9960784316062927], [0.6627451181411743], [0.2078431397676468], [0.0235294122248888], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.13725490868091583], [0.0313725508749485], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.6823529601097107], [0.9960784316062927], [0.3686274588108063], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.14901961386203766], [0.9607843160629272], [0.8666666746139526], [0.05098039284348488], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.5568627715110779], [0.9960784316062927], [0.5843137502670288], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.5921568870544434], [0.9960784316062927], [0.43921568989753723], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.886274516582489], [0.9490196108818054], [0.125490203499794], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0470588244497776], [0.9411764740943909], [0.7960784435272217], [0.1725490242242813], [0.1725490242242813], [0.1725490242242813], [0.1725490242242813], [0.0313725508749485], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.27450981736183167], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.8039215803146362], [0.3333333432674408], [0.0313725508749485], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.14509804546833038], [0.7215686440467834], [0.6627451181411743], [0.5215686559677124], [0.5215686559677124], [0.6352941393852234], [0.8313725590705872], [0.9960784316062927], [0.9960784316062927], [0.6509804129600525], [0.0313725508749485], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.03529411926865578], [0.20000000298023224], [0.6941176652908325], [0.9960784316062927], [0.4901960790157318], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.10588235408067703], [0.8196078538894653], [0.9960784316062927], [0.40784314274787903], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.24705882370471954], [0.8196078538894653], [0.9960784316062927], [0.7607843279838562], [0.05098039284348488], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0235294122248888], [0.0], [0.03921568766236305], [0.5372549295425415], [0.95686274766922], [0.9960784316062927], [0.7764706015586853], [0.20392157137393951], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.05098039284348488], [0.34117648005485535], [0.47843137383461], [0.5764706134796143], [0.8745098114013672], [0.9960784316062927], [0.9686274528503418], [0.49803921580314636], [0.05098039284348488], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0117647061124444], [0.4627451002597809], [0.9803921580314636], [0.8235294222831726], [0.9725490212440491], [0.9960784316062927], [0.9882352948188782], [0.7803921699523926], [0.1921568661928177], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.5411764979362488], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.9803921580314636], [0.7882353067398071], [0.2823529541492462], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.30980393290519714], [0.6549019813537598], [0.772549033164978], [0.34117648005485535], [0.027450980618596077], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]]]
       }
    

    Refer Watson Machine Learning API documentation for complete details about scoring input format specification.

Create a Batch Deployment

  1. By assuming the connection is created in COS using the Experiments of your Project
  2. By assuming the keras model is saved in repository service, go to the Models section of the your Project Assets
  3. Search for the saved keras model name and click on it.
  4. Select the Deployments tab, click Add Deployment
  5. Select the Batch Prediction tab, provide Name, Description
  6. Click on Select source, provide the source bucket name where you have saved the input data files.
  7. Click on Select target, provide the target bucket name where you need the prediction result to be stored.
  8. Click Save.

The prediction result is saved to target bucket in IBM Cloud Cloud Object Storage specified.

Input data file preview: (filename: img1.json)

{
  "values":[[[[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.2705882489681244], [0.5960784554481506], [0.929411768913269], [0.9960784316062927], [0.9960784316062927], [1.0], [0.9960784316062927], [0.9882352948188782], [0.20392157137393951], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.34117648005485535], [0.6431372761726379], [0.929411768913269], [0.9921568632125854], [0.9960784316062927], [0.8549019694328308], [0.5411764979362488], [0.32549020648002625], [0.15294118225574493], [0.6039215922355652], [0.9960784316062927], [0.529411792755127], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.5411764979362488], [0.9647058844566345], [0.9921568632125854], [0.9960784316062927], [0.8470588326454163], [0.6549019813537598], [0.21176470816135406], [0.019607843831181526], [0.0], [0.0], [0.0], [0.3921568691730499], [0.7490196228027344], [0.0117647061124444], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.9137254953384399], [0.9960784316062927], [0.6627451181411743], [0.2078431397676468], [0.0235294122248888], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.13725490868091583], [0.0313725508749485], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.6823529601097107], [0.9960784316062927], [0.3686274588108063], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.14901961386203766], [0.9607843160629272], [0.8666666746139526], [0.05098039284348488], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.5568627715110779], [0.9960784316062927], [0.5843137502670288], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.5921568870544434], [0.9960784316062927], [0.43921568989753723], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.886274516582489], [0.9490196108818054], [0.125490203499794], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0470588244497776], [0.9411764740943909], [0.7960784435272217], [0.1725490242242813], [0.1725490242242813], [0.1725490242242813], [0.1725490242242813], [0.0313725508749485], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.27450981736183167], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.8039215803146362], [0.3333333432674408], [0.0313725508749485], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.14509804546833038], [0.7215686440467834], [0.6627451181411743], [0.5215686559677124], [0.5215686559677124], [0.6352941393852234], [0.8313725590705872], [0.9960784316062927], [0.9960784316062927], [0.6509804129600525], [0.0313725508749485], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.03529411926865578], [0.20000000298023224], [0.6941176652908325], [0.9960784316062927], [0.4901960790157318], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.10588235408067703], [0.8196078538894653], [0.9960784316062927], [0.40784314274787903], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.24705882370471954], [0.8196078538894653], [0.9960784316062927], [0.7607843279838562], [0.05098039284348488], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0235294122248888], [0.0], [0.03921568766236305], [0.5372549295425415], [0.95686274766922], [0.9960784316062927], [0.7764706015586853], [0.20392157137393951], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.05098039284348488], [0.34117648005485535], [0.47843137383461], [0.5764706134796143], [0.8745098114013672], [0.9960784316062927], [0.9686274528503418], [0.49803921580314636], [0.05098039284348488], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0117647061124444], [0.4627451002597809], [0.9803921580314636], [0.8235294222831726], [0.9725490212440491], [0.9960784316062927], [0.9882352948188782], [0.7803921699523926], [0.1921568661928177], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.5411764979362488], [0.9960784316062927], [0.9960784316062927], [0.9960784316062927], [0.9803921580314636], [0.7882353067398071], [0.2823529541492462], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.30980393290519714], [0.6549019813537598], [0.772549033164978], [0.34117648005485535], [0.027450980618596077], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]], [[0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0], [0.0]]]]
}

Output file preview:

{
    "img1.json": {
        "fields": ["prediction", "prediction_classes", "probability"],
        "values": [
            [0.119932159781456, 0.09185332804918289, 0.10031602531671524, 0.11291926354169846, 0.10230886191129684, 0.08999011665582657, 0.11523492634296417, 0.0850936770439148, 0.09283886104822159, 0.08951272070407867], 0, [0.119932159781456, 0.09185332804918289, 0.10031602531671524, 0.11291926354169846, 0.10230886191129684, 0.08999011665582657, 0.11523492634296417, 0.0850936770439148, 0.09283886104822159, 0.08951272070407867]
        ]
    }
}

Interpreting the scoring output

The scoring output returns a JSON object where key-value pairs refers to the following.

Key Values
fields Gives the following outputs:
1. prediction: refers to the output obtained from the model.predict() function.
2. prediction_classes: refers to output from the function model.predict_classes() of Sequential model
3. probability: refers to output from the function model.predict_proba() of Sequential model
values Prediction output corresponding to the fields mentioned above

Note: First key in object array of each prediction result is filename of input data file. This is required to map input data file with its corresponding prediction result.

The scoring output will be formatted as in the following example:

{
    "img1.json": {
        "fields": ["prediction", "prediction_classes", "probability"],
        "values": [
            [0.119932159781456, 0.09185332804918289, 0.10031602531671524, 0.11291926354169846, 0.10230886191129684, 0.08999011665582657, 0.11523492634296417, 0.0850936770439148, 0.09283886104822159, 0.08951272070407867], 0, [0.119932159781456, 0.09185332804918289, 0.10031602531671524, 0.11291926354169846, 0.10230886191129684, 0.08999011665582657, 0.11523492634296417, 0.0850936770439148, 0.09283886104822159, 0.08951272070407867]
        ]
    }
}

Learn more

Get started using these sample training runs or create your own new training runs.