Class RiskMLInterface

java.lang.Object
neqsim.process.safety.risk.ml.RiskMLInterface
All Implemented Interfaces:
Serializable

public class RiskMLInterface extends Object implements Serializable
Machine Learning Integration Interface for Risk Assessment.

Provides a standardized interface for integrating external machine learning models with the NeqSim risk framework. Supports various ML use cases including:

  • Failure prediction models
  • Anomaly detection
  • Remaining useful life (RUL) prediction
  • Process optimization under risk constraints
Version:
1.0
Author:
NeqSim Development Team
See Also:
  • Field Details

  • Constructor Details

    • RiskMLInterface

      public RiskMLInterface(String name)
      Creates an ML interface.
      Parameters:
      name - interface name
  • Method Details

    • registerModel

      public void registerModel(RiskMLInterface.MLModel model)
      Registers an ML model.
      Parameters:
      model - ML model
    • createFailurePredictionModel

      public RiskMLInterface.MLModel createFailurePredictionModel(String modelId, String modelName)
      Creates and registers a failure prediction model.
      Parameters:
      modelId - model ID
      modelName - model name
      Returns:
      created model
    • createAnomalyDetectionModel

      public RiskMLInterface.MLModel createAnomalyDetectionModel(String modelId, String modelName)
      Creates and registers an anomaly detection model.
      Parameters:
      modelId - model ID
      modelName - model name
      Returns:
      created model
    • createRULModel

      public RiskMLInterface.MLModel createRULModel(String modelId, String modelName)
      Creates and registers an RUL prediction model.
      Parameters:
      modelId - model ID
      modelName - model name
      Returns:
      created model
    • registerFeatureExtractor

      public void registerFeatureExtractor(String name, RiskMLInterface.FeatureExtractor extractor)
      Registers a feature extractor.
      Parameters:
      name - extractor name
      extractor - feature extractor
    • predict

      public RiskMLInterface.MLPrediction predict(String modelId, Map<String,Double> features)
      Makes a prediction using a registered model.
      Parameters:
      modelId - model ID
      features - input features
      Returns:
      prediction result
    • predictWithExtraction

      public RiskMLInterface.MLPrediction predictWithExtraction(String modelId, String extractorName, Map<String,Object> processData)
      Makes a prediction with feature extraction.
      Parameters:
      modelId - model ID
      extractorName - feature extractor name
      processData - raw process data
      Returns:
      prediction result
    • provideFeedback

      public void provideFeedback(Instant predictionTimestamp, double actualValue)
      Provides feedback on a prediction (for model improvement).
      Parameters:
      predictionTimestamp - timestamp of prediction
      actualValue - actual observed value
    • getModelPerformance

      public RiskMLInterface.ModelPerformanceMetrics getModelPerformance(String modelId)
      Gets model performance metrics.
      Parameters:
      modelId - model ID
      Returns:
      performance metrics
    • getName

      public String getName()
    • getModel

      public RiskMLInterface.MLModel getModel(String modelId)
    • getModels

      public List<RiskMLInterface.MLModel> getModels()
    • getActiveModels

      public List<RiskMLInterface.MLModel> getActiveModels()
    • toMap

      public Map<String,Object> toMap()
      Converts to map for JSON serialization.
      Returns:
      map representation
    • toJson

      public String toJson()
      Converts to JSON string.
      Returns:
      JSON representation
    • toString

      public String toString()
      Overrides:
      toString in class Object