Create Predictions
Once the training phase for datasets is concluded, TimeDetect allows for the generation of predictions. This involves analyzing each registration individually, providing a detailed set of attributes for every entry.
After model training, the system is ready to analyze data and provide predictive insights. Here’s how to proceed:
Using the prediction endpoints
Real-time Predictions: For quick, real-time predictions, direct your requests to the real_time_prediction endpoint. This is ideal for individual or small batches of registrations where immediate results are beneficial. This endpoint does not require you to call the GET /results
endpoint afterwards. You will recieve the results as the response to this request directly.
For creating real-time predictions, execute the POST /real_time_prediction
endpoint with the registrations you want predictions for.
Batch Predictions: For processing larger datasets, use the create_prediction endpoint. This method is suitable for analyzing extensive collections of registrations, including those that require aggregation or identify missing entries.
For creating batch predictions, execute POST /create_prediction
with the registrations you want predictions for. To get the results, you have to call the GET /results
endpoint after the prediction job has finished.
Client operations
The prediction process must be initiated for each Dataset, as outlined below:
- 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. - Check Status:: Use
GET /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.