Create custom model.

Creates a new custom model and returns the newly created metadata record for it.

All custom models must support at least one target type (binaryClassification, regression).
Custom inference models can only support a single target type. A regression model is
expected to produce predictions that are arbitrary floating-point or integer numbers.
A classification model is expected to return predictions with probability scores for each
class. For example, a binary classification model might return:

.. code:: Python

{
    positiveClassLabel: probability,
    negativeClassLabel: 1.0 - probability
}

For Custom Inference Models, the file parameter must be either a tarball or zip archive
containing, at minimum,
a script named start_server.sh. It may contain additional files, including scripts and
precompiled binaries as well as data files. start_server.sh may execute these scripts
and/or binaries. When this script is executed, it is run as part of an Environment
(specified via subsequent API calls), and all included scripts and binaries
can take advantage of any programming language interpreters, compilers, libraries,
or other tools included in the Environment. start_server.sh must be marked as executable
(chmod +x).

When start_server.sh is launched, it must launch and maintain
(in the foreground) a Web server that listens on two URLs:

  • GET $URL_PREFIX/
    This route must return a 200 response code with an empty body immediately
    if the server is ready to respond to prediction requests. Otherwise it should
    either not accept the request, not respond to the request, or return a
    503 response code.

  • POST $URL_PREFIX/predict_no_state/
    This route must accept as input a JSON object of the form:

    .. code-block:: Python

      {
          'X': {
              'col1': [...col1_data...],
              'col2': [...col2_data...],
              'col3': [...col3_data...],
              ...
          }
      }
    

    The data lists will all be the same length.

    It must return a JSON object of the form:

    .. code-block:: Python

      {
          'predictions': [...predictions data...]
      }
    

    The predictions data must correspond 1:1 to the rows in the input data lists.

    $URL_PREFIX is provided as an environment variable. The Web server process must
    re-read its value every time the process starts, as it may change.
    It is an opaque string that is guaranteed to be a valid URL component,
    but may contain path separators (/).

Language
Authentication
Bearer
Response
Click Try It! to start a request and see the response here!