Inputs

Each entry under inputs: properties: becomes one field on your model's page. Its name must match one of the model's inputs exactly.

Field types

In peekml.yamlShows as
type: numberA number box
type: integerA number box that steps by whole numbers
…plus x-widget: sliderA slider (needs minimum, maximum and multipleOf)
type: string with enumA dropdown, plus an empty choice
type: string without enumA text box
type: string for a picture input (contentMediaType: image/*, optional)A picture upload (see Image models)

Settings

KeyForMeaning
descriptionAllHelp text under the field, e.g. "Yearly income in dollars".
minimum, maximumNumbersThe allowed range.
multipleOfNumbersThe step size, e.g. 0.01.
enumTextDropdown options. They should be the values the model saw in training.
x-widget: sliderNumbersShow a slider instead of a number box. Needs minimum, maximum and multipleOf.

Naming your features

Most models take all their features in one input, often called X. PeekML shows one box per feature, named column_1, column_2, … To name them, list the names in order under x-columns:

inputs:
  properties:
    X:
      type: array
      x-columns: [sepal_length, sepal_width, petal_length, petal_width]

Each name can also have the settings of a number input:

      x-columns:
        sepal_length: { minimum: 4, maximum: 8, description: In centimeters }
        sepal_width:

Name the classes with x-classes (Outputs). The easiest way to do both: publish the model, then choose View on its page and edit the names there.

Examples

inputs:
  properties:
    income:
      type: number
      minimum: 0
      description: Yearly income in dollars

    bedrooms:
      type: integer
      minimum: 1
      maximum: 6

    neighborhood:
      type: string
      enum: [downtown, suburb, rural]

    threshold:
      type: number
      minimum: 0
      maximum: 1
      multipleOf: 0.01
      x-widget: slider

There are no starting values: the form opens empty. To give visitors values to start from, add examples, which fill in the whole form with one click.

Put options like "yes" and "no" in quotes. Otherwise YAML reads them as true/false.