Skip to content

Model Control — Running Predictions

The Model Control page is where you train models, run predictions, and schedule automatic runs. This page covers the training data, run, and configuration sections. For replaying historical experiments through the models, see Simulations.

Before running any model you can specify which experiments to train on. If you skip this step, all data available from the WebSocket source is used.

Training data selection

On opening, available experiments and their metadata are fetched concurrently. Each experiment appears as a card showing the experiment ID, reactor entities, latest timestamp, and organism and media used.

Use the filter bar to narrow the list by organism or media — options populate automatically and filters apply instantly without any button click.

Tick the checkbox on any experiment card to include it in training. The Selected: N counter updates as you go.

  • Select All — selects all currently visible (filtered) experiments
  • Deselect All — clears all selections

Click Apply Selection to confirm. The status label updates to show which experiments are now active:

Currently selected for training: exp_001 (A1), exp_001 (A2), exp_002 (A1)

If nothing is selected, all available data is used and the label shows:

No experiments selected - all available data will be used for training

To run the predictive models, multiple functions can be used in the Run Models tab:

Three buttons run one model at a time:

ButtonModelConfig file
Run Linear RegressionLinear RegressionLinearRegression_config_NiceGUI.yaml
Run XGBoostXGBoostXGBoost_config_NiceGUI.yaml
Run LSTMLSTMLSTM_config_NiceGUI.yaml

Each model runs asynchronously — the UI stays responsive during training and prediction.

Click Run All to execute all three models in a single operation. Results are written to the local database and appear immediately in the Performance Metrics and Experimental Insight pages.

Each run button has a Use Uploaded Models toggle. When enabled, the model loads a previously saved artefact from the Model Files section instead of retraining from scratch. When disabled, the model always retrains on the selected training data.

Run models

Model artefacts are stored in ~/.graft/trained_models/ and organised in a three-level hierarchy:

trained_models/
└── {model_type}/
└── {date_folder}/
└── {entity}/
└── model_file.pkl (.keras / .h5 / .joblib also supported)

Use the three dropdowns — Model Type, Date Folder (newest first), and Entity — to navigate to the files you want. A table shows all matching files with filename, save date, and file size.

Model selection

Selecting a file for use — click on Use for Training next to a file. That model is then loaded and used when you run a model with Use Uploaded Models enabled.

Importing — click Upload Model and upload one or more .pkl, .keras, .h5, or .joblib files. They are saved immediately and appear in the file browser.

Exporting — click Export to download latest_model.pkl. An error notification is shown if no model has been saved yet.

To run all models automatically on a repeating schedule:

  1. Set the interval using the number input and unit selector
  2. Click Start button to run the models

The status label confirms the active schedule:

Status: Running every 3 minutes

Click Stop button at any time. Only one auto-run can be active — starting a second while one is running shows a warning notification.

Adjust model parameters directly in the dashboard without editing YAML files manually.

ControlConfig keyDescription
Forecast horizonforecast.horizon_minutesMinutes ahead to predict
Lag featureslags.numberNumber of lag steps in the feature matrix
Resample frequencypreprocessing.resample_freqTime resampling interval
Fill methodpreprocessing.fill_methodMissing value strategy
Test sizetraining.test_sizeFraction held out for evaluation
Model-specific fieldsmodel.*Units, depth, dropout, etc.

Model configuration

Click Save Config to write all values back to the relevant YAML file. Only the sections that have controls are modified — everything else is preserved. The new values take effect the next time a model is run.

Model configuration 2

  • Simulations — replay a historical experiment through the models in time chunks
  • Performance Metrics — view prediction results and evaluation metrics after running