- Made `date_column` a required field in `TrainModelParams`, ensuring it must be present in the input data. - Updated related documentation in `input-sample.md`, `README.md`, and various test scenarios to reflect the change in requirement. - Adjusted the handling of `date_format` to default to `yyyy-MM-dd HH:mm:ss` if omitted, enhancing usability. - Refined test scenarios to include new examples and ensure compliance with the updated parameter structure. These changes improve the robustness of the model training workflow and clarify the expectations for input data.
77 lines
2.5 KiB
Markdown
77 lines
2.5 KiB
Markdown
##### Insert a new experiment run
|
|
|
|
```sql
|
|
-- Optional: remove a previous run with the same id
|
|
DELETE FROM public.experiment_run WHERE experiment_run_id = 1001;
|
|
```
|
|
|
|
```sql
|
|
INSERT INTO public.experiment_run
|
|
(experiment_name, run_name, username, status, error_message, created_at,
|
|
updated_at, bucket_name, file_name, request_data, orchestrator_response_data)
|
|
VALUES(
|
|
'test-experiment-name',
|
|
'test-run-name',
|
|
'test-username',
|
|
'ORCHESTRATOR_WAITING_PROC',
|
|
null,
|
|
now(),
|
|
now(),
|
|
'model-training',
|
|
'training_data.csv',
|
|
'{"experiment_run_id":1001,"variable_columns":["feature_a","feature_b"],"target_variable":"target","bucket_name":"model-training","file_name":"training_data.csv","line_separator":",","decimal_separator":".","train_size":80,"shuffle":true,"model_name":"Linear Regression","model_type":"linear_regression","data_model_kwargs":{"lag_train":{"feature_a":0,"feature_b":0},"lag_val":{"feature_a":0,"feature_b":0},"nan_treatment":"drop"},"model_kwargs":{"degree":1,"scaler_name":"Standard Scaler"},"opt_params":{}}',
|
|
null
|
|
);
|
|
```
|
|
|
|
##### Upload the input dataset to MinIO
|
|
|
|
```bash
|
|
mc cp input_dataset.csv suse/model-training/training-sample-dataset-1001.csv
|
|
```
|
|
|
|
##### Temporal input payload sample
|
|
|
|
Keys match `TrainModelParams.from_dict` in `model_manager/utils/models/train_model_params.py`: every field passed to `_check_none` must be present, including **`date_column`**; `model_metadata` must be non-empty for `validate_business_rules()`. You may omit **`date_format`** (defaults to `yyyy-MM-dd HH:mm:ss`). Omit optional keys (`random_state`, `val_file_name`, `model_id`) when defaults or `None` apply.
|
|
|
|
```json
|
|
{
|
|
"experiment_run_id": 1001,
|
|
"variable_columns": ["feature_a", "feature_b"],
|
|
"target_variable": "target",
|
|
"bucket_name": "model-training",
|
|
"file_name": "training-sample-dataset-1001.csv",
|
|
"line_separator": ",",
|
|
"decimal_separator": ".",
|
|
"date_column": "timestamp",
|
|
"train_size": 80,
|
|
"shuffle": true,
|
|
"random_state": 42,
|
|
"model_name": "test-runtime-linear-regression-model",
|
|
"model_type": "linear_regression",
|
|
"data_model_kwargs": {
|
|
"lag_train": {
|
|
"feature_a": 0,
|
|
"feature_b": 0
|
|
},
|
|
"lag_val": {
|
|
"feature_a": 0,
|
|
"feature_b": 0
|
|
},
|
|
"nan_treatment": "drop",
|
|
"rem_static_win": false,
|
|
"static_threshold": null,
|
|
"start_date": null,
|
|
"end_date": null,
|
|
"support_filters": {},
|
|
"removed_intervals": []
|
|
},
|
|
"model_kwargs": {
|
|
"degree": 1,
|
|
"interaction_only": false,
|
|
"scaler_name": "Standard Scaler"
|
|
},
|
|
"opt_params": {}
|
|
}
|
|
```
|