3. Using KPI Prediction on New Geometries¶
This tutorial demonstrates how to use a trained model from the KPI training pipeline to predict KPI values for new geometries in the WindsorML Dataset.
If you haven’t yet completed the training tutorial, do so first to output a model ready for predictions.
If you haven’t yet completed the training tutorial, do so first to output a model ready for predictions.
3.1. Creating the Manifest¶
The run-create-manifest-prediction
script generates the required manifest for the WindsorML dataset. To create the manifest, run the script pointing to your dataset location:
./run-create-manifest-prediction /path/to/windsor/dataset
This will generate a manifest
prediction.manifest
: Lists of geometry files for predicting the KPIs
You can customize the manifest to use different geometries by editing run-create-manifest-prediction.sh
script:
#!/bin/bash
...
# Get a list of run folders for prediction (5 random runs)
predict_run_folders=($(ls -d "$dataset_prefix/run_"* | shuf -n 5))
# Create predict.manifest with geometries only (no ground truth KPI data)
mlsimkit-manifest create -m "prediction.manifest" -f "name=geometry_files,file_glob=*.stl" "${predict_run_folders[@]}"
A manifest is a JSON Lines (.manifest
) file that lists the paths to the geometry files. Each line in the manifest represents a single data file entry, containing the following keys:
"geometry_files"
: A list of relative or absolute paths to the geometry files (e.g.,.stl
)
Here’s an example manifest entry:
{
"geometry_files": ["file:///data/windsor/dataset/run_90/windsor_90.stl"]
}
This entry lists the path to a single geometry file (windsor_90.stl
). Note that "kpi"
does not exist in this manifest, as we intend to demonstrate the case where we do not have ground truth.
3.2. Understanding the configuration File¶
The KPI prediction pipeline is configured using prediction.yaml.
This file configures the prediction step, using the trained models from the training pipeline. Key settings include:
output-dir
: Directory for storing prediction outputs (e.g., predicted values)kpi.manifest_uri
: Path to the manifest of unseen geometrieskpi.preprocess
: Hyperparameters related to data preprocessing of unseen geometrieskpi.predict
: Hyperparameters related to KPI model inference
To get an introduction to the available configuration options, use the mlsimkit-learn kpi --help
command and the --help
option for each sub-command. This will provide an overview of the options and their purposes, which can be helpful when configuring the prediction pipeline.
3.3. Running the Pipeline¶
With the manifest created and the configuration file in place, you can run the KPI prediction pipeline using the provided script:
Run prediction:
./run-prediction
This script executes the necessary commands using the prediction.yaml
configuration file.
3.4. Reviewing Results¶
3.4.1. During Prediction¶
The prediction step generates KPI values predicted by the trained model for unseen geometries. The prediction output is located in the outputs/prediction/predictions
directory. Since the prediction manifest contains only geometry files (no ground truth KPI data), the prediction outputs do not include error metrics or actual KPIs for comparison. Here is the prediction output.
prediction_results.csv
: Predicted KPI values for unseen geometries
3.5. Next Steps¶
Dive into the KPI user guide for detailed information on more configuration options and how they impact model training and performance.