All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sagemaker.model.HyperParameterTrainingJobSummary Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.sagemaker.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* The container for the summary information about a training job. *

*/ @Generated("software.amazon.awssdk:codegen") public final class HyperParameterTrainingJobSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TRAINING_JOB_DEFINITION_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TrainingJobDefinitionName").getter(getter(HyperParameterTrainingJobSummary::trainingJobDefinitionName)) .setter(setter(Builder::trainingJobDefinitionName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobDefinitionName").build()) .build(); private static final SdkField TRAINING_JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TrainingJobName").getter(getter(HyperParameterTrainingJobSummary::trainingJobName)) .setter(setter(Builder::trainingJobName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobName").build()).build(); private static final SdkField TRAINING_JOB_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TrainingJobArn").getter(getter(HyperParameterTrainingJobSummary::trainingJobArn)) .setter(setter(Builder::trainingJobArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobArn").build()).build(); private static final SdkField TUNING_JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TuningJobName").getter(getter(HyperParameterTrainingJobSummary::tuningJobName)) .setter(setter(Builder::tuningJobName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TuningJobName").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CreationTime").getter(getter(HyperParameterTrainingJobSummary::creationTime)) .setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build(); private static final SdkField TRAINING_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("TrainingStartTime").getter(getter(HyperParameterTrainingJobSummary::trainingStartTime)) .setter(setter(Builder::trainingStartTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingStartTime").build()).build(); private static final SdkField TRAINING_END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("TrainingEndTime").getter(getter(HyperParameterTrainingJobSummary::trainingEndTime)) .setter(setter(Builder::trainingEndTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingEndTime").build()).build(); private static final SdkField TRAINING_JOB_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TrainingJobStatus").getter(getter(HyperParameterTrainingJobSummary::trainingJobStatusAsString)) .setter(setter(Builder::trainingJobStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobStatus").build()).build(); private static final SdkField> TUNED_HYPER_PARAMETERS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("TunedHyperParameters") .getter(getter(HyperParameterTrainingJobSummary::tunedHyperParameters)) .setter(setter(Builder::tunedHyperParameters)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TunedHyperParameters").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("FailureReason").getter(getter(HyperParameterTrainingJobSummary::failureReason)) .setter(setter(Builder::failureReason)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReason").build()).build(); private static final SdkField FINAL_HYPER_PARAMETER_TUNING_JOB_OBJECTIVE_METRIC_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("FinalHyperParameterTuningJobObjectiveMetric") .getter(getter(HyperParameterTrainingJobSummary::finalHyperParameterTuningJobObjectiveMetric)) .setter(setter(Builder::finalHyperParameterTuningJobObjectiveMetric)) .constructor(FinalHyperParameterTuningJobObjectiveMetric::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("FinalHyperParameterTuningJobObjectiveMetric").build()).build(); private static final SdkField OBJECTIVE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ObjectiveStatus").getter(getter(HyperParameterTrainingJobSummary::objectiveStatusAsString)) .setter(setter(Builder::objectiveStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ObjectiveStatus").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( TRAINING_JOB_DEFINITION_NAME_FIELD, TRAINING_JOB_NAME_FIELD, TRAINING_JOB_ARN_FIELD, TUNING_JOB_NAME_FIELD, CREATION_TIME_FIELD, TRAINING_START_TIME_FIELD, TRAINING_END_TIME_FIELD, TRAINING_JOB_STATUS_FIELD, TUNED_HYPER_PARAMETERS_FIELD, FAILURE_REASON_FIELD, FINAL_HYPER_PARAMETER_TUNING_JOB_OBJECTIVE_METRIC_FIELD, OBJECTIVE_STATUS_FIELD)); private static final long serialVersionUID = 1L; private final String trainingJobDefinitionName; private final String trainingJobName; private final String trainingJobArn; private final String tuningJobName; private final Instant creationTime; private final Instant trainingStartTime; private final Instant trainingEndTime; private final String trainingJobStatus; private final Map tunedHyperParameters; private final String failureReason; private final FinalHyperParameterTuningJobObjectiveMetric finalHyperParameterTuningJobObjectiveMetric; private final String objectiveStatus; private HyperParameterTrainingJobSummary(BuilderImpl builder) { this.trainingJobDefinitionName = builder.trainingJobDefinitionName; this.trainingJobName = builder.trainingJobName; this.trainingJobArn = builder.trainingJobArn; this.tuningJobName = builder.tuningJobName; this.creationTime = builder.creationTime; this.trainingStartTime = builder.trainingStartTime; this.trainingEndTime = builder.trainingEndTime; this.trainingJobStatus = builder.trainingJobStatus; this.tunedHyperParameters = builder.tunedHyperParameters; this.failureReason = builder.failureReason; this.finalHyperParameterTuningJobObjectiveMetric = builder.finalHyperParameterTuningJobObjectiveMetric; this.objectiveStatus = builder.objectiveStatus; } /** *

* The training job definition name. *

* * @return The training job definition name. */ public final String trainingJobDefinitionName() { return trainingJobDefinitionName; } /** *

* The name of the training job. *

* * @return The name of the training job. */ public final String trainingJobName() { return trainingJobName; } /** *

* The Amazon Resource Name (ARN) of the training job. *

* * @return The Amazon Resource Name (ARN) of the training job. */ public final String trainingJobArn() { return trainingJobArn; } /** *

* The HyperParameter tuning job that launched the training job. *

* * @return The HyperParameter tuning job that launched the training job. */ public final String tuningJobName() { return tuningJobName; } /** *

* The date and time that the training job was created. *

* * @return The date and time that the training job was created. */ public final Instant creationTime() { return creationTime; } /** *

* The date and time that the training job started. *

* * @return The date and time that the training job started. */ public final Instant trainingStartTime() { return trainingStartTime; } /** *

* Specifies the time when the training job ends on training instances. You are billed for the time interval between * the value of TrainingStartTime and this time. For successful jobs and stopped jobs, this is the time * after model artifacts are uploaded. For failed jobs, this is the time when SageMaker detects a job failure. *

* * @return Specifies the time when the training job ends on training instances. You are billed for the time interval * between the value of TrainingStartTime and this time. For successful jobs and stopped jobs, * this is the time after model artifacts are uploaded. For failed jobs, this is the time when SageMaker * detects a job failure. */ public final Instant trainingEndTime() { return trainingEndTime; } /** *

* The status of the training job. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #trainingJobStatus} * will return {@link TrainingJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #trainingJobStatusAsString}. *

* * @return The status of the training job. * @see TrainingJobStatus */ public final TrainingJobStatus trainingJobStatus() { return TrainingJobStatus.fromValue(trainingJobStatus); } /** *

* The status of the training job. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #trainingJobStatus} * will return {@link TrainingJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #trainingJobStatusAsString}. *

* * @return The status of the training job. * @see TrainingJobStatus */ public final String trainingJobStatusAsString() { return trainingJobStatus; } /** * For responses, this returns true if the service returned a value for the TunedHyperParameters property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasTunedHyperParameters() { return tunedHyperParameters != null && !(tunedHyperParameters instanceof SdkAutoConstructMap); } /** *

* A list of the hyperparameters for which you specified ranges to search. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTunedHyperParameters} method. *

* * @return A list of the hyperparameters for which you specified ranges to search. */ public final Map tunedHyperParameters() { return tunedHyperParameters; } /** *

* The reason that the training job failed. *

* * @return The reason that the training job failed. */ public final String failureReason() { return failureReason; } /** *

* The FinalHyperParameterTuningJobObjectiveMetric object that specifies the value of the objective metric of the * tuning job that launched this training job. *

* * @return The FinalHyperParameterTuningJobObjectiveMetric object that specifies the value of the objective metric * of the tuning job that launched this training job. */ public final FinalHyperParameterTuningJobObjectiveMetric finalHyperParameterTuningJobObjectiveMetric() { return finalHyperParameterTuningJobObjectiveMetric; } /** *

* The status of the objective metric for the training job: *

*
    *
  • *

    * Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning job and * used in the hyperparameter tuning process. *

    *
  • *
*
    *
  • *

    * Pending: The training job is in progress and evaluation of its final objective metric is pending. *

    *
  • *
*
    *
  • *

    * Failed: The final objective metric for the training job was not evaluated, and was not used in the hyperparameter * tuning process. This typically occurs when the training job failed or did not emit an objective metric. *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #objectiveStatus} * will return {@link ObjectiveStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #objectiveStatusAsString}. *

* * @return The status of the objective metric for the training job:

*
    *
  • *

    * Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning job * and used in the hyperparameter tuning process. *

    *
  • *
*
    *
  • *

    * Pending: The training job is in progress and evaluation of its final objective metric is pending. *

    *
  • *
*
    *
  • *

    * Failed: The final objective metric for the training job was not evaluated, and was not used in the * hyperparameter tuning process. This typically occurs when the training job failed or did not emit an * objective metric. *

    *
  • * @see ObjectiveStatus */ public final ObjectiveStatus objectiveStatus() { return ObjectiveStatus.fromValue(objectiveStatus); } /** *

    * The status of the objective metric for the training job: *

    *
      *
    • *

      * Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning job and * used in the hyperparameter tuning process. *

      *
    • *
    *
      *
    • *

      * Pending: The training job is in progress and evaluation of its final objective metric is pending. *

      *
    • *
    *
      *
    • *

      * Failed: The final objective metric for the training job was not evaluated, and was not used in the hyperparameter * tuning process. This typically occurs when the training job failed or did not emit an objective metric. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #objectiveStatus} * will return {@link ObjectiveStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #objectiveStatusAsString}. *

    * * @return The status of the objective metric for the training job:

    *
      *
    • *

      * Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning job * and used in the hyperparameter tuning process. *

      *
    • *
    *
      *
    • *

      * Pending: The training job is in progress and evaluation of its final objective metric is pending. *

      *
    • *
    *
      *
    • *

      * Failed: The final objective metric for the training job was not evaluated, and was not used in the * hyperparameter tuning process. This typically occurs when the training job failed or did not emit an * objective metric. *

      *
    • * @see ObjectiveStatus */ public final String objectiveStatusAsString() { return objectiveStatus; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(trainingJobDefinitionName()); hashCode = 31 * hashCode + Objects.hashCode(trainingJobName()); hashCode = 31 * hashCode + Objects.hashCode(trainingJobArn()); hashCode = 31 * hashCode + Objects.hashCode(tuningJobName()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(trainingStartTime()); hashCode = 31 * hashCode + Objects.hashCode(trainingEndTime()); hashCode = 31 * hashCode + Objects.hashCode(trainingJobStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasTunedHyperParameters() ? tunedHyperParameters() : null); hashCode = 31 * hashCode + Objects.hashCode(failureReason()); hashCode = 31 * hashCode + Objects.hashCode(finalHyperParameterTuningJobObjectiveMetric()); hashCode = 31 * hashCode + Objects.hashCode(objectiveStatusAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof HyperParameterTrainingJobSummary)) { return false; } HyperParameterTrainingJobSummary other = (HyperParameterTrainingJobSummary) obj; return Objects.equals(trainingJobDefinitionName(), other.trainingJobDefinitionName()) && Objects.equals(trainingJobName(), other.trainingJobName()) && Objects.equals(trainingJobArn(), other.trainingJobArn()) && Objects.equals(tuningJobName(), other.tuningJobName()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(trainingStartTime(), other.trainingStartTime()) && Objects.equals(trainingEndTime(), other.trainingEndTime()) && Objects.equals(trainingJobStatusAsString(), other.trainingJobStatusAsString()) && hasTunedHyperParameters() == other.hasTunedHyperParameters() && Objects.equals(tunedHyperParameters(), other.tunedHyperParameters()) && Objects.equals(failureReason(), other.failureReason()) && Objects.equals(finalHyperParameterTuningJobObjectiveMetric(), other.finalHyperParameterTuningJobObjectiveMetric()) && Objects.equals(objectiveStatusAsString(), other.objectiveStatusAsString()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("HyperParameterTrainingJobSummary").add("TrainingJobDefinitionName", trainingJobDefinitionName()) .add("TrainingJobName", trainingJobName()).add("TrainingJobArn", trainingJobArn()) .add("TuningJobName", tuningJobName()).add("CreationTime", creationTime()) .add("TrainingStartTime", trainingStartTime()).add("TrainingEndTime", trainingEndTime()) .add("TrainingJobStatus", trainingJobStatusAsString()) .add("TunedHyperParameters", hasTunedHyperParameters() ? tunedHyperParameters() : null) .add("FailureReason", failureReason()) .add("FinalHyperParameterTuningJobObjectiveMetric", finalHyperParameterTuningJobObjectiveMetric()) .add("ObjectiveStatus", objectiveStatusAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "TrainingJobDefinitionName": return Optional.ofNullable(clazz.cast(trainingJobDefinitionName())); case "TrainingJobName": return Optional.ofNullable(clazz.cast(trainingJobName())); case "TrainingJobArn": return Optional.ofNullable(clazz.cast(trainingJobArn())); case "TuningJobName": return Optional.ofNullable(clazz.cast(tuningJobName())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "TrainingStartTime": return Optional.ofNullable(clazz.cast(trainingStartTime())); case "TrainingEndTime": return Optional.ofNullable(clazz.cast(trainingEndTime())); case "TrainingJobStatus": return Optional.ofNullable(clazz.cast(trainingJobStatusAsString())); case "TunedHyperParameters": return Optional.ofNullable(clazz.cast(tunedHyperParameters())); case "FailureReason": return Optional.ofNullable(clazz.cast(failureReason())); case "FinalHyperParameterTuningJobObjectiveMetric": return Optional.ofNullable(clazz.cast(finalHyperParameterTuningJobObjectiveMetric())); case "ObjectiveStatus": return Optional.ofNullable(clazz.cast(objectiveStatusAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((HyperParameterTrainingJobSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The training job definition name. *

      * * @param trainingJobDefinitionName * The training job definition name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingJobDefinitionName(String trainingJobDefinitionName); /** *

      * The name of the training job. *

      * * @param trainingJobName * The name of the training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingJobName(String trainingJobName); /** *

      * The Amazon Resource Name (ARN) of the training job. *

      * * @param trainingJobArn * The Amazon Resource Name (ARN) of the training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingJobArn(String trainingJobArn); /** *

      * The HyperParameter tuning job that launched the training job. *

      * * @param tuningJobName * The HyperParameter tuning job that launched the training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tuningJobName(String tuningJobName); /** *

      * The date and time that the training job was created. *

      * * @param creationTime * The date and time that the training job was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

      * The date and time that the training job started. *

      * * @param trainingStartTime * The date and time that the training job started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingStartTime(Instant trainingStartTime); /** *

      * Specifies the time when the training job ends on training instances. You are billed for the time interval * between the value of TrainingStartTime and this time. For successful jobs and stopped jobs, this * is the time after model artifacts are uploaded. For failed jobs, this is the time when SageMaker detects a * job failure. *

      * * @param trainingEndTime * Specifies the time when the training job ends on training instances. You are billed for the time * interval between the value of TrainingStartTime and this time. For successful jobs and * stopped jobs, this is the time after model artifacts are uploaded. For failed jobs, this is the time * when SageMaker detects a job failure. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingEndTime(Instant trainingEndTime); /** *

      * The status of the training job. *

      * * @param trainingJobStatus * The status of the training job. * @see TrainingJobStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TrainingJobStatus */ Builder trainingJobStatus(String trainingJobStatus); /** *

      * The status of the training job. *

      * * @param trainingJobStatus * The status of the training job. * @see TrainingJobStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TrainingJobStatus */ Builder trainingJobStatus(TrainingJobStatus trainingJobStatus); /** *

      * A list of the hyperparameters for which you specified ranges to search. *

      * * @param tunedHyperParameters * A list of the hyperparameters for which you specified ranges to search. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tunedHyperParameters(Map tunedHyperParameters); /** *

      * The reason that the training job failed. *

      * * @param failureReason * The reason that the training job failed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureReason(String failureReason); /** *

      * The FinalHyperParameterTuningJobObjectiveMetric object that specifies the value of the objective metric of * the tuning job that launched this training job. *

      * * @param finalHyperParameterTuningJobObjectiveMetric * The FinalHyperParameterTuningJobObjectiveMetric object that specifies the value of the objective * metric of the tuning job that launched this training job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder finalHyperParameterTuningJobObjectiveMetric( FinalHyperParameterTuningJobObjectiveMetric finalHyperParameterTuningJobObjectiveMetric); /** *

      * The FinalHyperParameterTuningJobObjectiveMetric object that specifies the value of the objective metric of * the tuning job that launched this training job. *

      * This is a convenience method that creates an instance of the * {@link FinalHyperParameterTuningJobObjectiveMetric.Builder} avoiding the need to create one manually via * {@link FinalHyperParameterTuningJobObjectiveMetric#builder()}. * *

      * When the {@link Consumer} completes, {@link FinalHyperParameterTuningJobObjectiveMetric.Builder#build()} is * called immediately and its result is passed to * {@link #finalHyperParameterTuningJobObjectiveMetric(FinalHyperParameterTuningJobObjectiveMetric)}. * * @param finalHyperParameterTuningJobObjectiveMetric * a consumer that will call methods on {@link FinalHyperParameterTuningJobObjectiveMetric.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #finalHyperParameterTuningJobObjectiveMetric(FinalHyperParameterTuningJobObjectiveMetric) */ default Builder finalHyperParameterTuningJobObjectiveMetric( Consumer finalHyperParameterTuningJobObjectiveMetric) { return finalHyperParameterTuningJobObjectiveMetric(FinalHyperParameterTuningJobObjectiveMetric.builder() .applyMutation(finalHyperParameterTuningJobObjectiveMetric).build()); } /** *

      * The status of the objective metric for the training job: *

      *
        *
      • *

        * Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning job and * used in the hyperparameter tuning process. *

        *
      • *
      *
        *
      • *

        * Pending: The training job is in progress and evaluation of its final objective metric is pending. *

        *
      • *
      *
        *
      • *

        * Failed: The final objective metric for the training job was not evaluated, and was not used in the * hyperparameter tuning process. This typically occurs when the training job failed or did not emit an * objective metric. *

        *
      • *
      * * @param objectiveStatus * The status of the objective metric for the training job:

      *
        *
      • *

        * Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning * job and used in the hyperparameter tuning process. *

        *
      • *
      *
        *
      • *

        * Pending: The training job is in progress and evaluation of its final objective metric is pending. *

        *
      • *
      *
        *
      • *

        * Failed: The final objective metric for the training job was not evaluated, and was not used in the * hyperparameter tuning process. This typically occurs when the training job failed or did not emit an * objective metric. *

        *
      • * @see ObjectiveStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectiveStatus */ Builder objectiveStatus(String objectiveStatus); /** *

        * The status of the objective metric for the training job: *

        *
          *
        • *

          * Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning job and * used in the hyperparameter tuning process. *

          *
        • *
        *
          *
        • *

          * Pending: The training job is in progress and evaluation of its final objective metric is pending. *

          *
        • *
        *
          *
        • *

          * Failed: The final objective metric for the training job was not evaluated, and was not used in the * hyperparameter tuning process. This typically occurs when the training job failed or did not emit an * objective metric. *

          *
        • *
        * * @param objectiveStatus * The status of the objective metric for the training job:

        *
          *
        • *

          * Succeeded: The final objective metric for the training job was evaluated by the hyperparameter tuning * job and used in the hyperparameter tuning process. *

          *
        • *
        *
          *
        • *

          * Pending: The training job is in progress and evaluation of its final objective metric is pending. *

          *
        • *
        *
          *
        • *

          * Failed: The final objective metric for the training job was not evaluated, and was not used in the * hyperparameter tuning process. This typically occurs when the training job failed or did not emit an * objective metric. *

          *
        • * @see ObjectiveStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ObjectiveStatus */ Builder objectiveStatus(ObjectiveStatus objectiveStatus); } static final class BuilderImpl implements Builder { private String trainingJobDefinitionName; private String trainingJobName; private String trainingJobArn; private String tuningJobName; private Instant creationTime; private Instant trainingStartTime; private Instant trainingEndTime; private String trainingJobStatus; private Map tunedHyperParameters = DefaultSdkAutoConstructMap.getInstance(); private String failureReason; private FinalHyperParameterTuningJobObjectiveMetric finalHyperParameterTuningJobObjectiveMetric; private String objectiveStatus; private BuilderImpl() { } private BuilderImpl(HyperParameterTrainingJobSummary model) { trainingJobDefinitionName(model.trainingJobDefinitionName); trainingJobName(model.trainingJobName); trainingJobArn(model.trainingJobArn); tuningJobName(model.tuningJobName); creationTime(model.creationTime); trainingStartTime(model.trainingStartTime); trainingEndTime(model.trainingEndTime); trainingJobStatus(model.trainingJobStatus); tunedHyperParameters(model.tunedHyperParameters); failureReason(model.failureReason); finalHyperParameterTuningJobObjectiveMetric(model.finalHyperParameterTuningJobObjectiveMetric); objectiveStatus(model.objectiveStatus); } public final String getTrainingJobDefinitionName() { return trainingJobDefinitionName; } public final void setTrainingJobDefinitionName(String trainingJobDefinitionName) { this.trainingJobDefinitionName = trainingJobDefinitionName; } @Override public final Builder trainingJobDefinitionName(String trainingJobDefinitionName) { this.trainingJobDefinitionName = trainingJobDefinitionName; return this; } public final String getTrainingJobName() { return trainingJobName; } public final void setTrainingJobName(String trainingJobName) { this.trainingJobName = trainingJobName; } @Override public final Builder trainingJobName(String trainingJobName) { this.trainingJobName = trainingJobName; return this; } public final String getTrainingJobArn() { return trainingJobArn; } public final void setTrainingJobArn(String trainingJobArn) { this.trainingJobArn = trainingJobArn; } @Override public final Builder trainingJobArn(String trainingJobArn) { this.trainingJobArn = trainingJobArn; return this; } public final String getTuningJobName() { return tuningJobName; } public final void setTuningJobName(String tuningJobName) { this.tuningJobName = tuningJobName; } @Override public final Builder tuningJobName(String tuningJobName) { this.tuningJobName = tuningJobName; return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final Instant getTrainingStartTime() { return trainingStartTime; } public final void setTrainingStartTime(Instant trainingStartTime) { this.trainingStartTime = trainingStartTime; } @Override public final Builder trainingStartTime(Instant trainingStartTime) { this.trainingStartTime = trainingStartTime; return this; } public final Instant getTrainingEndTime() { return trainingEndTime; } public final void setTrainingEndTime(Instant trainingEndTime) { this.trainingEndTime = trainingEndTime; } @Override public final Builder trainingEndTime(Instant trainingEndTime) { this.trainingEndTime = trainingEndTime; return this; } public final String getTrainingJobStatus() { return trainingJobStatus; } public final void setTrainingJobStatus(String trainingJobStatus) { this.trainingJobStatus = trainingJobStatus; } @Override public final Builder trainingJobStatus(String trainingJobStatus) { this.trainingJobStatus = trainingJobStatus; return this; } @Override public final Builder trainingJobStatus(TrainingJobStatus trainingJobStatus) { this.trainingJobStatus(trainingJobStatus == null ? null : trainingJobStatus.toString()); return this; } public final Map getTunedHyperParameters() { if (tunedHyperParameters instanceof SdkAutoConstructMap) { return null; } return tunedHyperParameters; } public final void setTunedHyperParameters(Map tunedHyperParameters) { this.tunedHyperParameters = HyperParametersCopier.copy(tunedHyperParameters); } @Override public final Builder tunedHyperParameters(Map tunedHyperParameters) { this.tunedHyperParameters = HyperParametersCopier.copy(tunedHyperParameters); return this; } public final String getFailureReason() { return failureReason; } public final void setFailureReason(String failureReason) { this.failureReason = failureReason; } @Override public final Builder failureReason(String failureReason) { this.failureReason = failureReason; return this; } public final FinalHyperParameterTuningJobObjectiveMetric.Builder getFinalHyperParameterTuningJobObjectiveMetric() { return finalHyperParameterTuningJobObjectiveMetric != null ? finalHyperParameterTuningJobObjectiveMetric.toBuilder() : null; } public final void setFinalHyperParameterTuningJobObjectiveMetric( FinalHyperParameterTuningJobObjectiveMetric.BuilderImpl finalHyperParameterTuningJobObjectiveMetric) { this.finalHyperParameterTuningJobObjectiveMetric = finalHyperParameterTuningJobObjectiveMetric != null ? finalHyperParameterTuningJobObjectiveMetric .build() : null; } @Override public final Builder finalHyperParameterTuningJobObjectiveMetric( FinalHyperParameterTuningJobObjectiveMetric finalHyperParameterTuningJobObjectiveMetric) { this.finalHyperParameterTuningJobObjectiveMetric = finalHyperParameterTuningJobObjectiveMetric; return this; } public final String getObjectiveStatus() { return objectiveStatus; } public final void setObjectiveStatus(String objectiveStatus) { this.objectiveStatus = objectiveStatus; } @Override public final Builder objectiveStatus(String objectiveStatus) { this.objectiveStatus = objectiveStatus; return this; } @Override public final Builder objectiveStatus(ObjectiveStatus objectiveStatus) { this.objectiveStatus(objectiveStatus == null ? null : objectiveStatus.toString()); return this; } @Override public HyperParameterTrainingJobSummary build() { return new HyperParameterTrainingJobSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy