/* * Copyright 2018-2023 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 com.amazonaws.services.sagemaker.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* A channel is a named input source that training algorithms can consume. The validation dataset size is limited to * less than 2 GB. The training dataset size must be less than 100 GB. For more information, see Channel. *
** A validation dataset must contain the same headers as the training dataset. *
** The data source for an AutoML channel. *
*/ private AutoMLDataSource dataSource; /** *
* You can use Gzip
or None
. The default value is None
.
*
* The name of the target variable in supervised learning, usually represented by 'y'. *
*/ private String targetAttributeName; /** *
* The content type of the data from the input source. You can use text/csv;header=present
or
* x-application/vnd.amazon+parquet
. The default value is text/csv;header=present
.
*
* The channel type (optional) is an enum
string. The default value is training
. Channels
* for training and validation must share the same ContentType
and TargetAttributeName
.
* For information on specifying training and validation channel types, see How to specify training and validation datasets.
*
* If specified, this column name indicates which column of the dataset should be treated as sample weights for use * by the objective metric during the training, evaluation, and the selection of the best model. This column is not * considered as a predictive feature. For more information on Autopilot metrics, see Metrics and * validation. *
** Sample weights should be numeric, non-negative, with larger values indicating which rows are more important than * others. Data points that have invalid or no weight value are excluded. *
** Support for sample weights is available in Ensembling * mode only. *
*/ private String sampleWeightAttributeName; /** ** The data source for an AutoML channel. *
* * @param dataSource * The data source for an AutoML channel. */ public void setDataSource(AutoMLDataSource dataSource) { this.dataSource = dataSource; } /** ** The data source for an AutoML channel. *
* * @return The data source for an AutoML channel. */ public AutoMLDataSource getDataSource() { return this.dataSource; } /** ** The data source for an AutoML channel. *
* * @param dataSource * The data source for an AutoML channel. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoMLChannel withDataSource(AutoMLDataSource dataSource) { setDataSource(dataSource); return this; } /** *
* You can use Gzip
or None
. The default value is None
.
*
Gzip
or None
. The default value is None
.
* @see CompressionType
*/
public void setCompressionType(String compressionType) {
this.compressionType = compressionType;
}
/**
*
* You can use Gzip
or None
. The default value is None
.
*
Gzip
or None
. The default value is None
.
* @see CompressionType
*/
public String getCompressionType() {
return this.compressionType;
}
/**
*
* You can use Gzip
or None
. The default value is None
.
*
Gzip
or None
. The default value is None
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CompressionType
*/
public AutoMLChannel withCompressionType(String compressionType) {
setCompressionType(compressionType);
return this;
}
/**
*
* You can use Gzip
or None
. The default value is None
.
*
Gzip
or None
. The default value is None
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CompressionType
*/
public AutoMLChannel withCompressionType(CompressionType compressionType) {
this.compressionType = compressionType.toString();
return this;
}
/**
* * The name of the target variable in supervised learning, usually represented by 'y'. *
* * @param targetAttributeName * The name of the target variable in supervised learning, usually represented by 'y'. */ public void setTargetAttributeName(String targetAttributeName) { this.targetAttributeName = targetAttributeName; } /** ** The name of the target variable in supervised learning, usually represented by 'y'. *
* * @return The name of the target variable in supervised learning, usually represented by 'y'. */ public String getTargetAttributeName() { return this.targetAttributeName; } /** ** The name of the target variable in supervised learning, usually represented by 'y'. *
* * @param targetAttributeName * The name of the target variable in supervised learning, usually represented by 'y'. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoMLChannel withTargetAttributeName(String targetAttributeName) { setTargetAttributeName(targetAttributeName); return this; } /** *
* The content type of the data from the input source. You can use text/csv;header=present
or
* x-application/vnd.amazon+parquet
. The default value is text/csv;header=present
.
*
text/csv;header=present
or
* x-application/vnd.amazon+parquet
. The default value is text/csv;header=present
.
*/
public void setContentType(String contentType) {
this.contentType = contentType;
}
/**
*
* The content type of the data from the input source. You can use text/csv;header=present
or
* x-application/vnd.amazon+parquet
. The default value is text/csv;header=present
.
*
text/csv;header=present
or
* x-application/vnd.amazon+parquet
. The default value is text/csv;header=present
.
*/
public String getContentType() {
return this.contentType;
}
/**
*
* The content type of the data from the input source. You can use text/csv;header=present
or
* x-application/vnd.amazon+parquet
. The default value is text/csv;header=present
.
*
text/csv;header=present
or
* x-application/vnd.amazon+parquet
. The default value is text/csv;header=present
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AutoMLChannel withContentType(String contentType) {
setContentType(contentType);
return this;
}
/**
*
* The channel type (optional) is an enum
string. The default value is training
. Channels
* for training and validation must share the same ContentType
and TargetAttributeName
.
* For information on specifying training and validation channel types, see How to specify training and validation datasets.
*
enum
string. The default value is training
.
* Channels for training and validation must share the same ContentType
and
* TargetAttributeName
. For information on specifying training and validation channel types, see
* How to specify training and validation datasets.
* @see AutoMLChannelType
*/
public void setChannelType(String channelType) {
this.channelType = channelType;
}
/**
*
* The channel type (optional) is an enum
string. The default value is training
. Channels
* for training and validation must share the same ContentType
and TargetAttributeName
.
* For information on specifying training and validation channel types, see How to specify training and validation datasets.
*
enum
string. The default value is training
.
* Channels for training and validation must share the same ContentType
and
* TargetAttributeName
. For information on specifying training and validation channel types,
* see How to specify training and validation datasets.
* @see AutoMLChannelType
*/
public String getChannelType() {
return this.channelType;
}
/**
*
* The channel type (optional) is an enum
string. The default value is training
. Channels
* for training and validation must share the same ContentType
and TargetAttributeName
.
* For information on specifying training and validation channel types, see How to specify training and validation datasets.
*
enum
string. The default value is training
.
* Channels for training and validation must share the same ContentType
and
* TargetAttributeName
. For information on specifying training and validation channel types, see
* How to specify training and validation datasets.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AutoMLChannelType
*/
public AutoMLChannel withChannelType(String channelType) {
setChannelType(channelType);
return this;
}
/**
*
* The channel type (optional) is an enum
string. The default value is training
. Channels
* for training and validation must share the same ContentType
and TargetAttributeName
.
* For information on specifying training and validation channel types, see How to specify training and validation datasets.
*
enum
string. The default value is training
.
* Channels for training and validation must share the same ContentType
and
* TargetAttributeName
. For information on specifying training and validation channel types, see
* How to specify training and validation datasets.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AutoMLChannelType
*/
public AutoMLChannel withChannelType(AutoMLChannelType channelType) {
this.channelType = channelType.toString();
return this;
}
/**
* * If specified, this column name indicates which column of the dataset should be treated as sample weights for use * by the objective metric during the training, evaluation, and the selection of the best model. This column is not * considered as a predictive feature. For more information on Autopilot metrics, see Metrics and * validation. *
** Sample weights should be numeric, non-negative, with larger values indicating which rows are more important than * others. Data points that have invalid or no weight value are excluded. *
** Support for sample weights is available in Ensembling * mode only. *
* * @param sampleWeightAttributeName * If specified, this column name indicates which column of the dataset should be treated as sample weights * for use by the objective metric during the training, evaluation, and the selection of the best model. This * column is not considered as a predictive feature. For more information on Autopilot metrics, see Metrics and * validation. ** Sample weights should be numeric, non-negative, with larger values indicating which rows are more * important than others. Data points that have invalid or no weight value are excluded. *
** Support for sample weights is available in Ensembling mode only. */ public void setSampleWeightAttributeName(String sampleWeightAttributeName) { this.sampleWeightAttributeName = sampleWeightAttributeName; } /** *
* If specified, this column name indicates which column of the dataset should be treated as sample weights for use * by the objective metric during the training, evaluation, and the selection of the best model. This column is not * considered as a predictive feature. For more information on Autopilot metrics, see Metrics and * validation. *
** Sample weights should be numeric, non-negative, with larger values indicating which rows are more important than * others. Data points that have invalid or no weight value are excluded. *
** Support for sample weights is available in Ensembling * mode only. *
* * @return If specified, this column name indicates which column of the dataset should be treated as sample weights * for use by the objective metric during the training, evaluation, and the selection of the best model. * This column is not considered as a predictive feature. For more information on Autopilot metrics, see Metrics and * validation. ** Sample weights should be numeric, non-negative, with larger values indicating which rows are more * important than others. Data points that have invalid or no weight value are excluded. *
** Support for sample weights is available in Ensembling mode only. */ public String getSampleWeightAttributeName() { return this.sampleWeightAttributeName; } /** *
* If specified, this column name indicates which column of the dataset should be treated as sample weights for use * by the objective metric during the training, evaluation, and the selection of the best model. This column is not * considered as a predictive feature. For more information on Autopilot metrics, see Metrics and * validation. *
** Sample weights should be numeric, non-negative, with larger values indicating which rows are more important than * others. Data points that have invalid or no weight value are excluded. *
** Support for sample weights is available in Ensembling * mode only. *
* * @param sampleWeightAttributeName * If specified, this column name indicates which column of the dataset should be treated as sample weights * for use by the objective metric during the training, evaluation, and the selection of the best model. This * column is not considered as a predictive feature. For more information on Autopilot metrics, see Metrics and * validation. ** Sample weights should be numeric, non-negative, with larger values indicating which rows are more * important than others. Data points that have invalid or no weight value are excluded. *
** Support for sample weights is available in Ensembling mode only. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoMLChannel withSampleWeightAttributeName(String sampleWeightAttributeName) { setSampleWeightAttributeName(sampleWeightAttributeName); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDataSource() != null) sb.append("DataSource: ").append(getDataSource()).append(","); if (getCompressionType() != null) sb.append("CompressionType: ").append(getCompressionType()).append(","); if (getTargetAttributeName() != null) sb.append("TargetAttributeName: ").append(getTargetAttributeName()).append(","); if (getContentType() != null) sb.append("ContentType: ").append(getContentType()).append(","); if (getChannelType() != null) sb.append("ChannelType: ").append(getChannelType()).append(","); if (getSampleWeightAttributeName() != null) sb.append("SampleWeightAttributeName: ").append(getSampleWeightAttributeName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AutoMLChannel == false) return false; AutoMLChannel other = (AutoMLChannel) obj; if (other.getDataSource() == null ^ this.getDataSource() == null) return false; if (other.getDataSource() != null && other.getDataSource().equals(this.getDataSource()) == false) return false; if (other.getCompressionType() == null ^ this.getCompressionType() == null) return false; if (other.getCompressionType() != null && other.getCompressionType().equals(this.getCompressionType()) == false) return false; if (other.getTargetAttributeName() == null ^ this.getTargetAttributeName() == null) return false; if (other.getTargetAttributeName() != null && other.getTargetAttributeName().equals(this.getTargetAttributeName()) == false) return false; if (other.getContentType() == null ^ this.getContentType() == null) return false; if (other.getContentType() != null && other.getContentType().equals(this.getContentType()) == false) return false; if (other.getChannelType() == null ^ this.getChannelType() == null) return false; if (other.getChannelType() != null && other.getChannelType().equals(this.getChannelType()) == false) return false; if (other.getSampleWeightAttributeName() == null ^ this.getSampleWeightAttributeName() == null) return false; if (other.getSampleWeightAttributeName() != null && other.getSampleWeightAttributeName().equals(this.getSampleWeightAttributeName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDataSource() == null) ? 0 : getDataSource().hashCode()); hashCode = prime * hashCode + ((getCompressionType() == null) ? 0 : getCompressionType().hashCode()); hashCode = prime * hashCode + ((getTargetAttributeName() == null) ? 0 : getTargetAttributeName().hashCode()); hashCode = prime * hashCode + ((getContentType() == null) ? 0 : getContentType().hashCode()); hashCode = prime * hashCode + ((getChannelType() == null) ? 0 : getChannelType().hashCode()); hashCode = prime * hashCode + ((getSampleWeightAttributeName() == null) ? 0 : getSampleWeightAttributeName().hashCode()); return hashCode; } @Override public AutoMLChannel clone() { try { return (AutoMLChannel) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.sagemaker.model.transform.AutoMLChannelMarshaller.getInstance().marshall(this, protocolMarshaller); } }