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.yaml | Shows as |
|---|---|
type: number | A number box |
type: integer | A number box that steps by whole numbers |
…plus x-widget: slider | A slider (needs minimum, maximum and multipleOf) |
type: string with enum | A dropdown, plus an empty choice |
type: string without enum | A text box |
type: string for a picture input (contentMediaType: image/*, optional) | A picture upload (see Image models) |
Settings
| Key | For | Meaning |
|---|---|---|
description | All | Help text under the field, e.g. "Yearly income in dollars". |
minimum, maximum | Numbers | The allowed range. |
multipleOf | Numbers | The step size, e.g. 0.01. |
enum | Text | Dropdown options. They should be the values the model saw in training. |
x-widget: slider | Numbers | Show 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: sliderThere 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.