Package ai.libs.mlplan.safeguard
Class AlwaysPreventSafeGuard
- java.lang.Object
-
- ai.libs.mlplan.safeguard.AlwaysPreventSafeGuard
-
- All Implemented Interfaces:
IEvaluationSafeGuard
public class AlwaysPreventSafeGuard extends java.lang.Object implements IEvaluationSafeGuard
-
-
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 AlwaysPreventSafeGuard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublepredictInductionTime(ai.libs.jaicore.components.model.ComponentInstance ci, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTrain)Predicts the runtime that is required for inducing a model.doublepredictInferenceTime(ai.libs.jaicore.components.model.ComponentInstance 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.booleanpredictWillAdhereToTimeout(ai.libs.jaicore.components.model.ComponentInstance ci, org.api4.java.algorithm.Timeout timeout)Predicts whether a component instanceciis likely to adhere to the giventimeout.voidregisterListener(java.lang.Object listener)voidupdateWithActualInformation(ai.libs.jaicore.components.model.ComponentInstance ci, ITimeTrackingLearner wrappedLearner)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.model.ComponentInstance ci, org.api4.java.algorithm.Timeout timeout) throws java.lang.ExceptionDescription copied from interface:IEvaluationSafeGuardPredicts whether a component instanceciis likely to adhere to the giventimeout.- Specified by:
predictWillAdhereToTimeoutin interfaceIEvaluationSafeGuardtimeout- 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.model.ComponentInstance ci, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTrain) throws java.lang.ExceptionDescription copied from interface:IEvaluationSafeGuardPredicts the runtime that is required for inducing a model.- Specified by:
predictInductionTimein 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.model.ComponentInstance ci, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTrain, org.api4.java.ai.ml.core.dataset.supervised.ILabeledDataset<?> dTest) throws java.lang.ExceptionDescription copied from interface:IEvaluationSafeGuardPredicts the runtime that is required for doing inference with the given model.- Specified by:
predictInferenceTimein 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.model.ComponentInstance ci, ITimeTrackingLearner wrappedLearner)Description copied from interface:IEvaluationSafeGuardUpdates the safe guard with current information obtained by measuring the induction and inference time of the given component instance on-line.- Specified by:
updateWithActualInformationin interfaceIEvaluationSafeGuard- Parameters:
ci- The component instance describing the model to update the actual information for.wrappedLearner- 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:
registerListenerin interfaceIEvaluationSafeGuard
-
-