Model input and output data adaptation

When submitting your job you can include your data inline or reference your data in your request. This data will be mapped to a file named with data identifier and used by the model. The data identifier extension will define the format of the file used.

The following adaptations are supported:
  • Inline data to embed your data in your request. For example:
    "input_data": [{
         "id":"diet_food.csv",
         "fields" : ["name","unit_cost","qmin","qmax"],
         "values" : [
    	 	["Roasted Chicken", 0.84, 0, 10]
         ]
    }]
    
    This will generate the corresponding diet_food.csv file that is used as the model input file. Only csv adaptation is currently supported.
  • Db2 referenced data allowing you to reference data on an “IBM Db2 on Cloud service” instance. For example:
    "input_data_references": [{
    "id":"diet_food.csv",
    	"type": "db2",
    	"connection": {
    		"host": " XXXXXXXXX",
    		"db": " XXXXXXXXX",
    		"username": "XXXXXXXXX",
    		"password": "XXXXXXXXX"
    },
    	"location": {
    		"schemaname": " XXXXXXXXX",
    		"tablename": "diet_food"
    	}
    }]
    
    This will generate the corresponding diet_food.csv file that is used as the model input file. Only csv adaptation is currently supported. You can find connection information about accessing service credentials section of your “IBM Db2 on Cloud service” instance details page.
  • COS/S3 referenced data allowing you to reference files stored in an “IBM Cloud Object Service” instance. For example:
    "input_data_references": [{
    "type": "s3",
                "id": "diet_food.csv",
                "connection": {
                	"endpoint_url": " XXXXXXXXX",
                       "access_key_id": " XXXXXXXXX",
                       "secret_access_key": " XXXXXXXXX"
          	},
                "location": {
                	"bucket": "XXXXXXXXX",
                            "path": "diet_food.csv"
                }
    }]
    
    This will copy the corresponding diet_food.csv file that is used as the model input file. You can find connection information about accessing service credentials section of your “IBM Cloud Object Service” instance details page. Your service credential entry must be created with the inline configuration parameter: {"HMAC":true}. This configuration parameter will add the following section to instance credentials that are used in connection fields,
    "cos_hmac_keys": {
         "access_key_id": " XXXXXXXXX ",
         "secret_access_key": " XXXXXXXXX "
    }
    The endpoint URL is located on your bucket configuration page, corresponding to your bucket regional endpoint (for example: https://s3-api.us-geo.objectstorage.softlayer.net )
  • URL referenced data allowing you to reference files stored at a particular URL or REST data service. For example:
    "input_data_references": {
       "type": "url",
       "id": "diet_food.csv",
       "type": "url",
       "connection": {
          "verb": "GET",
          "url": "https://myserver.com/diet_food.csv",
          "headers": {
             "Content-Type": "application/x-www-form-urlencoded"
          }
       },
       "location": {}
    }] 
    This will copy the corresponding diet_food.csv file that is used as the model input file.

You can combine different adaptations in the same request.