Create Predictions
Once models are trained for each dataset, TimeDetect can generate predictions (find anomalies) for new time registrations. This involves analyzing each new registration individually and providing details on whether the registration is deviating from the normal working pattern or not.
-
Create Prediction:: Execute
POST /create_prediction
orPOST /real_time_prediction
for real-time predictions, with a list of Dataset IDs. A Job ID will be returned.- Regular (batch) Predictions: For processing larger datasets and or getting aggregate results (considering several registrations, e.g., the total of the day is anomalous) or missing registrations (i.e., notification that some registration(s) seem to be missing compared to the regular working pattern).
- Real-time Predictions: For individual or small batches of registrations where immediate results are needed. Results are returned in the response directly.
-
Check Status: (applies to
/create_prediction
only): UseGET /status
with the Job ID until a 200 status with "success" is returned, or use the webhook functionality.
Create prediction schema
required | Array of objects (Create Prediction Request Dataset Parameters) Prediction parameters for each dataset. |
object Details for the webhook endpoint to call when a job finishes. |
{- "parameters": [
- {
- "datasetId": "cc3fa933-80fe-4b18-a9c8-66fe0fbf85a2",
- "customerId": "87082b90-097b-4115-aec2-7330918fe6aa",
- "registrations": [
- {
- "registrationId": "1e24162a-3bad-4a58-865c-a1994c75942d",
- "date": "2024-08-26",
- "employeeId": "cf5ee029-0747-45c1-94e3-ea7a2ae3129c",
- "projectId": "high_rise_project",
- "departmentId": "construction",
- "workCategory": "roofing",
- "startTime": 6.5,
- "endTime": 16,
- "workDuration": 9,
- "breakDuration": 0.5,
- "publicHoliday": false,
- "numericals": [
- {
- "name": "overtime",
- "value": 1
}
]
}
], - "aggregateForEmployeeIds": [
- "6bbc1322-af64-44c9-bfbc-abc8183d7618",
- "8c2c136f-07c1-496f-b2e5-1d5dfe4ca443",
- "9c421927-069e-4d31-a6da-368011132501",
- "f14ee0f7-af97-4095-91c6-55ba4641ad8b"
], - "missingRegistrationDates": [
- "2021-01-01",
- "2021-01-02",
- "2021-01-03"
]
}
],
}
The aggregateForEmployeeIds is a list which should contain the employee-ids you'd like aggregated results for. Read more about aggregated results in the results section.