java.lang.Object
com.azure.resourcemanager.machinelearning.models.EarlyTerminationPolicy
com.azure.resourcemanager.machinelearning.models.BanditPolicy
All Implemented Interfaces:
com.azure.json.JsonSerializable<EarlyTerminationPolicy>

public final class BanditPolicy extends EarlyTerminationPolicy
Defines an early termination policy based on slack criteria, and a frequency and delay interval for evaluation.
  • Constructor Details

    • BanditPolicy

      public BanditPolicy()
      Creates an instance of BanditPolicy class.
  • Method Details

    • policyType

      public EarlyTerminationPolicyType policyType()
      Get the policyType property: [Required] Name of policy configuration.
      Overrides:
      policyType in class EarlyTerminationPolicy
      Returns:
      the policyType value.
    • slackFactor

      public Float slackFactor()
      Get the slackFactor property: Ratio of the allowed distance from the best performing run.
      Returns:
      the slackFactor value.
    • withSlackFactor

      public BanditPolicy withSlackFactor(Float slackFactor)
      Set the slackFactor property: Ratio of the allowed distance from the best performing run.
      Parameters:
      slackFactor - the slackFactor value to set.
      Returns:
      the BanditPolicy object itself.
    • slackAmount

      public Float slackAmount()
      Get the slackAmount property: Absolute distance allowed from the best performing run.
      Returns:
      the slackAmount value.
    • withSlackAmount

      public BanditPolicy withSlackAmount(Float slackAmount)
      Set the slackAmount property: Absolute distance allowed from the best performing run.
      Parameters:
      slackAmount - the slackAmount value to set.
      Returns:
      the BanditPolicy object itself.
    • withEvaluationInterval

      public BanditPolicy withEvaluationInterval(Integer evaluationInterval)
      Set the evaluationInterval property: Interval (number of runs) between policy evaluations.
      Overrides:
      withEvaluationInterval in class EarlyTerminationPolicy
      Parameters:
      evaluationInterval - the evaluationInterval value to set.
      Returns:
      the EarlyTerminationPolicy object itself.
    • withDelayEvaluation

      public BanditPolicy withDelayEvaluation(Integer delayEvaluation)
      Set the delayEvaluation property: Number of intervals by which to delay the first evaluation.
      Overrides:
      withDelayEvaluation in class EarlyTerminationPolicy
      Parameters:
      delayEvaluation - the delayEvaluation value to set.
      Returns:
      the EarlyTerminationPolicy object itself.
    • validate

      public void validate()
      Validates the instance.
      Overrides:
      validate in class EarlyTerminationPolicy
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<EarlyTerminationPolicy>
      Overrides:
      toJson in class EarlyTerminationPolicy
      Throws:
      IOException
    • fromJson

      public static BanditPolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of BanditPolicy from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of BanditPolicy if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the BanditPolicy.