Interface MLCorrectionInterface
- All Known Implementing Classes:
HybridModelAdapter
public interface MLCorrectionInterface
Interface for integrating machine learning corrections with physics-based models.
This interface enables hybrid AI approaches where ML models augment first-principles physics predictions. It is designed for integration with AI-based production optimization platforms.
Typical use cases:
- Bias correction of thermodynamic model predictions
- Data-driven enhancement of equipment models
- Real-time model adaptation based on production data
- Version:
- 1.0
- Author:
- ESOL
-
Method Summary
Modifier and TypeMethodDescriptiondoublecorrect(double physicsPrediction, double[] features) Applies ML correction to a physics-based prediction.default double[]correctBatch(double[] physicsPredictions, double[][] featureMatrix) Applies ML correction to multiple predictions (batch mode).default doublegetConfidence(double[] features) Gets the confidence level for a prediction.intGets the number of features expected by this model.String[]Gets the expected feature names for this ML model.Gets the model version or identifier.default doublegetUncertainty(double physicsPrediction, double[] features) Gets the uncertainty (standard deviation) for a prediction.booleanisReady()Checks if the model is ready for inference.voidonModelUpdate(byte[] modelPayload) Updates the ML model with new weights/parameters.
-
Method Details
-
correct
double correct(double physicsPrediction, double[] features) Applies ML correction to a physics-based prediction.- Parameters:
physicsPrediction- the prediction from the physics modelfeatures- input features for the ML model- Returns:
- corrected prediction
-
correctBatch
default double[] correctBatch(double[] physicsPredictions, double[][] featureMatrix) Applies ML correction to multiple predictions (batch mode).- Parameters:
physicsPredictions- array of physics predictionsfeatureMatrix- matrix of features (one row per prediction)- Returns:
- array of corrected predictions
-
getFeatureNames
String[] getFeatureNames()Gets the expected feature names for this ML model.- Returns:
- array of feature names in expected order
-
getFeatureCount
int getFeatureCount()Gets the number of features expected by this model.- Returns:
- number of features
-
isReady
boolean isReady()Checks if the model is ready for inference.- Returns:
- true if the model can make predictions
-
onModelUpdate
void onModelUpdate(byte[] modelPayload) Updates the ML model with new weights/parameters.This method is called when an external AI platform pushes updated model parameters after retraining.
- Parameters:
modelPayload- serialized model parameters
-
getModelVersion
-
getConfidence
default double getConfidence(double[] features) Gets the confidence level for a prediction.- Parameters:
features- input features- Returns:
- confidence score between 0 and 1
-
getUncertainty
default double getUncertainty(double physicsPrediction, double[] features) Gets the uncertainty (standard deviation) for a prediction.- Parameters:
physicsPrediction- the physics predictionfeatures- input features- Returns:
- predicted standard deviation
-