Class ConceptDriftLocallyAdaptiveMethod

java.lang.Object
es.upm.fi.cig.multictbnc.conceptdriftdetection.ConceptDriftAdaptiveMethod
es.upm.fi.cig.multictbnc.conceptdriftdetection.ConceptDriftLocallyAdaptiveMethod

public class ConceptDriftLocallyAdaptiveMethod extends ConceptDriftAdaptiveMethod
This class implements a concept drift adaptive method that operates locally on each node of a MultiCTBNC model. The method utilizes a Page-Hinkley test to detect significant changes in the local log-likelihood scores of individual nodes, indicating possible concept drifts. Upon detection, the model is adapted accordingly.
  • Constructor Details

    • ConceptDriftLocallyAdaptiveMethod

      public ConceptDriftLocallyAdaptiveMethod(List<String> namesVariables, ConceptDriftScore conceptDriftScore, double magnitudeThreshold, double detectionThreshold, boolean resetAfterConceptDrift, int windowSize, boolean showCharts, String title)
      Initializes the locally adaptive concept drift method with specified parameters.
      Parameters:
      namesVariables - list of variable names used in the model
      conceptDriftScore - scoring mechanism to detect concept drift
      magnitudeThreshold - threshold for magnitude change in the Page-Hinkley test
      detectionThreshold - threshold for drift detection in the Page-Hinkley test
      resetAfterConceptDrift - flag to reset the Page-Hinkley test after detecting a drift
      windowSize - size of the window for the Page-Hinkley test
      showCharts - flag indicating whether to display drift detection charts
      title - title for the drift detection charts
  • Method Details

    • setUpLineChart

      protected void setUpLineChart(String title, double detectionThreshold)
      Sets up line charts for visualizing the evolution of the average local log-likelihood and Page Hinkley values if the charts are enabled.
      Specified by:
      setUpLineChart in class ConceptDriftAdaptiveMethod
      Parameters:
      title - title for the line charts
      detectionThreshold - threshold value for detecting concept drifts
    • adaptModel

      public boolean adaptModel(MultiCTBNC<CPTNode,CIMNode> model, Dataset newBatch) throws ErroneousValueException
      Adapts the provided MultiCTBNC model based on the new data batch. It detects concept drifts and updates the model accordingly.
      Specified by:
      adaptModel in class ConceptDriftAdaptiveMethod
      Parameters:
      model - MultiCTBNC model to be adapted.
      newBatch - new data batch for concept drift detection and model adaptation
      Returns:
      true if a concept drift is detected and the model is adapted, false otherwise
      Throws:
      ErroneousValueException - if an error occurs during the adaptation process
    • getResults

      public String getResults()
      Description copied from class: ConceptDriftAdaptiveMethod
      Returns a String describing the results of the last concept drift detection.
      Specified by:
      getResults in class ConceptDriftAdaptiveMethod
      Returns:
      String describing the concept drift detection results
    • getUpdatingTime

      public long getUpdatingTime()
      Description copied from class: ConceptDriftAdaptiveMethod
      Returns the time taken for the last update of the model.
      Overrides:
      getUpdatingTime in class ConceptDriftAdaptiveMethod
      Returns:
      time taken for updating the model
    • getLastChangedNodes

      public List<Node> getLastChangedNodes()
      Description copied from class: ConceptDriftAdaptiveMethod
      Retrieves the list of nodes that were last identified as having undergone concept drift.
      Specified by:
      getLastChangedNodes in class ConceptDriftAdaptiveMethod
      Returns:
      list of nodes that experienced concept drift in the most recent adaptation