Package ai.libs.mlplan.safeguard
Class AlwaysEvaluateSafeGuard
- java.lang.Object
-
- ai.libs.mlplan.safeguard.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 thePipelineEvaluator
.
-
-
Field Summary
-
Fields inherited from interface ai.libs.mlplan.safeguard.IEvaluationSafeGuard
ANNOTATION_PREDICTED_INDUCTION_TIME, ANNOTATION_PREDICTED_INFERENCE_TIME, ANNOTATION_SOURCE
-
-
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 instanceci
is likely to adhere to the giventimeout
.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
-
Methods inherited from interface ai.libs.mlplan.safeguard.IEvaluationSafeGuard
predictEvaluationTime
-
-
-
-
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 instanceci
is likely to adhere to the giventimeout
.- Specified by:
predictWillAdhereToTimeout
in interfaceIEvaluationSafeGuard
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 interfaceIEvaluationSafeGuard
- 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 interfaceIEvaluationSafeGuard
- 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 interfaceIEvaluationSafeGuard
- 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.
-
registerListener
public void registerListener(java.lang.Object listener)
- Specified by:
registerListener
in interfaceIEvaluationSafeGuard
-
-