Class AlwaysEvaluateSafeGuard

  • All Implemented Interfaces:
    IEvaluationSafeGuard

    public class AlwaysEvaluateSafeGuard
    extends java.lang.Object
    implements IEvaluationSafeGuard
    The AlwaysEvaluateSafeGuard is more of a dummy encoding of a safe guard that will always predict that any algorithm will be evaluated within the timeout and return a result in instant time. It thus can be employed to disable the safe guard feature of the PipelineEvaluator.
    • Constructor Summary

      Constructors 
      Constructor Description
      AlwaysEvaluateSafeGuard()
      Standard constructor for initializing an AlwaysEvaluateSafeGuard.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double predictInductionTime​(ai.libs.jaicore.components.api.IComponentInstance ci, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTrain)
      Predicts the runtime that is required for inducing a model.
      double predictInferenceTime​(ai.libs.jaicore.components.api.IComponentInstance ci, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTrain, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTest)
      Predicts the runtime that is required for doing inference with the given model.
      boolean predictWillAdhereToTimeout​(ai.libs.jaicore.components.api.IComponentInstance ci, org.api4.java.algorithm.Timeout timeout)
      Predicts whether a component instance ci is likely to adhere to the given timeout.
      void registerListener​(java.lang.Object listener)  
      void updateWithActualInformation​(ai.libs.jaicore.components.api.IComponentInstance ci, ITimeTrackingLearner learner)
      Updates the safe guard with current information obtained by measuring the induction and inference time of the given component instance on-line.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AlwaysEvaluateSafeGuard

        public AlwaysEvaluateSafeGuard()
        Standard constructor for initializing an AlwaysEvaluateSafeGuard.
    • Method Detail

      • predictWillAdhereToTimeout

        public boolean predictWillAdhereToTimeout​(ai.libs.jaicore.components.api.IComponentInstance ci,
                                                  org.api4.java.algorithm.Timeout timeout)
                                           throws java.lang.Exception
        Description copied from interface: IEvaluationSafeGuard
        Predicts whether a component instance ci is likely to adhere to the given timeout.
        Specified by:
        predictWillAdhereToTimeout in interface IEvaluationSafeGuard
        timeout - The timeout posed to the evaluation of the component instance.
        Returns:
        Returns true iff the component instance can likely be evaluated within the given timeout.
        Throws:
        java.lang.Exception
      • predictInductionTime

        public double predictInductionTime​(ai.libs.jaicore.components.api.IComponentInstance ci,
                                           org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTrain)
                                    throws java.lang.Exception
        Description copied from interface: IEvaluationSafeGuard
        Predicts the runtime that is required for inducing a model.
        Specified by:
        predictInductionTime in interface IEvaluationSafeGuard
        Parameters:
        ci - The component instance describing the model to predict the induction time for.
        Returns:
        The time needed for inducing a model.
        Throws:
        java.lang.Exception
      • predictInferenceTime

        public double predictInferenceTime​(ai.libs.jaicore.components.api.IComponentInstance ci,
                                           org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTrain,
                                           org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTest)
                                    throws java.lang.Exception
        Description copied from interface: IEvaluationSafeGuard
        Predicts the runtime that is required for doing inference with the given model.
        Specified by:
        predictInferenceTime in interface IEvaluationSafeGuard
        Parameters:
        ci - The component instance describing the model to predict the inference time for.
        Returns:
        The time needed for making predictions on the validation set.
        Throws:
        java.lang.Exception
      • updateWithActualInformation

        public void updateWithActualInformation​(ai.libs.jaicore.components.api.IComponentInstance ci,
                                                ITimeTrackingLearner learner)
        Description copied from interface: IEvaluationSafeGuard
        Updates the safe guard with current information obtained by measuring the induction and inference time of the given component instance on-line.
        Specified by:
        updateWithActualInformation in interface IEvaluationSafeGuard
        Parameters:
        ci - The component instance describing the model to update the actual information for.
        learner - The learner that has been used to evaluate the component instance. It must be a time tracking learner.