Skip to content

Regression Workflow

Submit structured values and render one numeric score.

import { predictionTransport } from "./prediction-transport";
mountForm(container, {
transport: predictionTransport,
schema: {
fields: [
{ id: "area", kind: "number", label: "Area", mappedTo: "area", min: 0, unit: "m2" },
{ id: "rooms", kind: "number", label: "Rooms", mappedTo: "rooms", min: 1, step: 1 },
],
reports: [
{ id: "price", kind: "regressor", label: "Estimated price", mappedTo: "price", unit: "EUR", precision: 0 },
],
},
});

Response:

{
"reports": [
{
"backend": "default",
"mappedTo": "price",
"status": "ready",
"payload": { "value": 275000 }
}
]
}

Expected UI behavior: numeric inputs normalize empty values to null, validation runs before submit, and the regressor report renders with the configured unit and precision.

Mistakes to avoid:

Mistake Fix
Treating empty number inputs as zero Handle null in the backend.
Returning a string for numeric output Return a numeric payload when possible.

Next: Conditional Form.