BLOCKS Reference

Block Reference

Machine Learning

ML Board Predict

warning Trainings made prior to 2017/4/12 will become unusable after 2017/6/1. Please use trainings made after 2017/4/12 for making predictions.

This BLOCK uses input variable data along with the results of an ML Board’s training to make predictions.

It reads in input variable data from a variable and outputs prediction results as a variable.

オンライン予測概略図

We recommend using the ML Board Batch Predict BLOCK for predictions with a large amount of input data.

  • There is a 1,000 item limit when making predictions from the results of a BigQuery query.
  • Predictions from BLOCK may not work if there is too much input variable data.

This BLOCK is currently in beta. Be aware that the beta version of this BLOCK will become unavailable post official release.
*Please make use of the official BLOCK once released.

Due to its nature as a beta release, there is the possibility that some functions may not execute properly. We appreciate feedback from users, through the BLOCKS Forum or direct contact, regarding bugs or ways to improve BLOCKS.

You must apply a training on an ML Board to make predictions with this BLOCK.


Input variable data should be formatted as follows:

Input variable data
  • Designate data as key and value pairs.

  • You must include a key called "key" with a String-type value that identifies the set of prediction data.

  • Other than “key”, set the remaining keys as the item names used in your ML Board’s training data.

  • Just as with item names, set each value's type as configured the ML Board's training data.

    info Numbers that have been converted into strings can also be accepted for numerical values, month, and days. For example, numerical values that have been converted into strings, like “99” or “1.5”, are treated as 99 and 1.5. Similarly, string data like “0” and “6” signifying days of the week are treated as 0 and 6.

  • You can also designate multiple sets of data at once as an array.

The following is an example of specifying three sets of prediction data in the Construct Object BLOCK. If the results of that BLOCK were stored into a variable named _, we would set the Input Variable property of the ML Board Predict BLOCK as _.data

Data property of the Construct Object BLOCK (classification)


Results of the prediction are output as a variable. The following example shows the contents of this variable (JSON format) as shown using the Output to Log BLOCK. Each part of the prediction results is explained below:

JSON is a notation used for expressing data.

  • Data is organized into name and value pairs
    • A pair's name and value are separated by a :
    • The left side of the : is the name, and the right side of the : is the value (name:value)
    • A name and value pair is called amember
  • Values can be the following types:
    • String: Enclosed in double quotes, such as "abc","xyz", etc.
    • Numerical value: Directly entered numbers such as 1,1.23, etc.
    • Array: Sets of multiple values separated by commas (,) and enclosed by square brackets ([ and ]. For example, [1, 2, 3]. Each value within an array is called an element.
    • Object: Sets of multiple "name" and "value" pairs separated by commas (,) and enclosed within curly brackets ({ and }). For example, {"a": 1, "b": 2, "c": 3}.
  • Names are expressed as strings.

The following example shows results from a classification-type model:

{
  "predictions": [
    {
      "score": [
        8.715780131751671e-05,
        0.9995228052139282,
        0.00039013021159917116
      ],
      "key": "1",
      "label": 1
    },
    {
      "score": [
        9.230815578575857e-08,
        0.007054927293211222,
        0.9929450154304504
      ],
      "key": "2",
      "label": 2
    },
    {
      "score": [
        0.9998869895935059,
        0.00011299729521851987,
        1.5803254260760013e-09
      ],
      "key": "3",
      "label": 0
    }
  ]
}
  • The results are all output as a single JSON object.
  • "predictions": An array containing the results of the prediction. The results are contained within an object made up of the following members:
    • "score": The certainty level for predicting each class.
      • Shows the certainty level from left to right for class 0, class 1, class 2 and so on.
      • For example, results of [8.715780131751671e-05, 0.9995228052139282, 0.00039013021159917116] show a 0.00871578 % for class 0, a 99.952280521 % certainty for class 1, and a 0.039013021 % certainty for class 2.
      • The class with the highest certainty is the predicted class.
    • "key": The "key" value given during the prediction.
    • "label": The predicted class. The class with the highest certainty value from "score".

The following example is for results of a regression-type model:

{
  "predictions": [
    {
      "output": 10261.9072265625,
      "key": "20170101"
    },
    {
      "output": 12506.2861328125,
      "key": "20170102"
    },
    {
      "output": 10304.1962890625,
      "key": "20170103"
    },
    {
      "output": 10350.099609375,
      "key": "20170104"
    }
  ]
}
  • The results are all output as a single JSON object.
  • "predictions": An array containing the results of the prediction.The results are contained within an object made up of the following members:
    • "output": The predicted value.
    • "key": The "key" value given during the prediction.

Property Explanation
BLOCK name Configure the name displayed on this BLOCK.
GCP service account Select the GCP service account to use with this BLOCK.
ML Board name Designate the ML Board's name.
Input variable Designate the variable containing the input data to be used for making a prediction.
Output variable Designate a variable that will store the results data from the prediction.
BLOCK memos Make any comments about this BLOCK.