com.amazonaws.services.forecast.model.FeaturizationMethod Maven / Gradle / Ivy
Show all versions of aws-java-sdk-forecast Show documentation
/*
* Copyright 2019-2024 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.forecast.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Provides information about the method that featurizes (transforms) a dataset field. The method is part of the
* FeaturizationPipeline
of the Featurization object.
*
*
* The following is an example of how you specify a FeaturizationMethod
object.
*
*
* {
*
*
* "FeaturizationMethodName": "filling",
*
*
* "FeaturizationMethodParameters": {"aggregation": "sum", "middlefill": "zero", "backfill": "zero"}
*
*
* }
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class FeaturizationMethod implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the method. The "filling" method is the only supported method.
*
*/
private String featurizationMethodName;
/**
*
* The method parameters (key-value pairs), which are a map of override parameters. Specify these parameters to
* override the default values. Related Time Series attributes do not accept aggregation parameters.
*
*
* The following list shows the parameters and their valid values for the "filling" featurization method for a
* Target Time Series dataset. Bold signifies the default value.
*
*
* -
*
* aggregation
: sum, avg
, first
, min
, max
*
*
* -
*
* frontfill
: none
*
*
* -
*
* middlefill
: zero, nan
(not a number), value
, median
,
* mean
, min
, max
*
*
* -
*
* backfill
: zero, nan
, value
, median
, mean
,
* min
, max
*
*
*
*
* The following list shows the parameters and their valid values for a Related Time Series featurization
* method (there are no defaults):
*
*
* -
*
* middlefill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* backfill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* futurefill
: zero
, value
, median
, mean
,
* min
, max
*
*
*
*
* To set a filling method to a specific value, set the fill parameter to value
and define the value in
* a corresponding _value
parameter. For example, to set backfilling to a value of 2, include the
* following: "backfill": "value"
and "backfill_value":"2"
.
*
*/
private java.util.Map featurizationMethodParameters;
/**
*
* The name of the method. The "filling" method is the only supported method.
*
*
* @param featurizationMethodName
* The name of the method. The "filling" method is the only supported method.
* @see FeaturizationMethodName
*/
public void setFeaturizationMethodName(String featurizationMethodName) {
this.featurizationMethodName = featurizationMethodName;
}
/**
*
* The name of the method. The "filling" method is the only supported method.
*
*
* @return The name of the method. The "filling" method is the only supported method.
* @see FeaturizationMethodName
*/
public String getFeaturizationMethodName() {
return this.featurizationMethodName;
}
/**
*
* The name of the method. The "filling" method is the only supported method.
*
*
* @param featurizationMethodName
* The name of the method. The "filling" method is the only supported method.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FeaturizationMethodName
*/
public FeaturizationMethod withFeaturizationMethodName(String featurizationMethodName) {
setFeaturizationMethodName(featurizationMethodName);
return this;
}
/**
*
* The name of the method. The "filling" method is the only supported method.
*
*
* @param featurizationMethodName
* The name of the method. The "filling" method is the only supported method.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FeaturizationMethodName
*/
public FeaturizationMethod withFeaturizationMethodName(FeaturizationMethodName featurizationMethodName) {
this.featurizationMethodName = featurizationMethodName.toString();
return this;
}
/**
*
* The method parameters (key-value pairs), which are a map of override parameters. Specify these parameters to
* override the default values. Related Time Series attributes do not accept aggregation parameters.
*
*
* The following list shows the parameters and their valid values for the "filling" featurization method for a
* Target Time Series dataset. Bold signifies the default value.
*
*
* -
*
* aggregation
: sum, avg
, first
, min
, max
*
*
* -
*
* frontfill
: none
*
*
* -
*
* middlefill
: zero, nan
(not a number), value
, median
,
* mean
, min
, max
*
*
* -
*
* backfill
: zero, nan
, value
, median
, mean
,
* min
, max
*
*
*
*
* The following list shows the parameters and their valid values for a Related Time Series featurization
* method (there are no defaults):
*
*
* -
*
* middlefill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* backfill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* futurefill
: zero
, value
, median
, mean
,
* min
, max
*
*
*
*
* To set a filling method to a specific value, set the fill parameter to value
and define the value in
* a corresponding _value
parameter. For example, to set backfilling to a value of 2, include the
* following: "backfill": "value"
and "backfill_value":"2"
.
*
*
* @return The method parameters (key-value pairs), which are a map of override parameters. Specify these parameters
* to override the default values. Related Time Series attributes do not accept aggregation parameters.
*
* The following list shows the parameters and their valid values for the "filling" featurization method for
* a Target Time Series dataset. Bold signifies the default value.
*
*
* -
*
* aggregation
: sum, avg
, first
, min
,
* max
*
*
* -
*
* frontfill
: none
*
*
* -
*
* middlefill
: zero, nan
(not a number), value
,
* median
, mean
, min
, max
*
*
* -
*
* backfill
: zero, nan
, value
, median
,
* mean
, min
, max
*
*
*
*
* The following list shows the parameters and their valid values for a Related Time Series
* featurization method (there are no defaults):
*
*
* -
*
* middlefill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* backfill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* futurefill
: zero
, value
, median
, mean
,
* min
, max
*
*
*
*
* To set a filling method to a specific value, set the fill parameter to value
and define the
* value in a corresponding _value
parameter. For example, to set backfilling to a value of 2,
* include the following: "backfill": "value"
and "backfill_value":"2"
.
*/
public java.util.Map getFeaturizationMethodParameters() {
return featurizationMethodParameters;
}
/**
*
* The method parameters (key-value pairs), which are a map of override parameters. Specify these parameters to
* override the default values. Related Time Series attributes do not accept aggregation parameters.
*
*
* The following list shows the parameters and their valid values for the "filling" featurization method for a
* Target Time Series dataset. Bold signifies the default value.
*
*
* -
*
* aggregation
: sum, avg
, first
, min
, max
*
*
* -
*
* frontfill
: none
*
*
* -
*
* middlefill
: zero, nan
(not a number), value
, median
,
* mean
, min
, max
*
*
* -
*
* backfill
: zero, nan
, value
, median
, mean
,
* min
, max
*
*
*
*
* The following list shows the parameters and their valid values for a Related Time Series featurization
* method (there are no defaults):
*
*
* -
*
* middlefill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* backfill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* futurefill
: zero
, value
, median
, mean
,
* min
, max
*
*
*
*
* To set a filling method to a specific value, set the fill parameter to value
and define the value in
* a corresponding _value
parameter. For example, to set backfilling to a value of 2, include the
* following: "backfill": "value"
and "backfill_value":"2"
.
*
*
* @param featurizationMethodParameters
* The method parameters (key-value pairs), which are a map of override parameters. Specify these parameters
* to override the default values. Related Time Series attributes do not accept aggregation parameters.
*
* The following list shows the parameters and their valid values for the "filling" featurization method for
* a Target Time Series dataset. Bold signifies the default value.
*
*
* -
*
* aggregation
: sum, avg
, first
, min
,
* max
*
*
* -
*
* frontfill
: none
*
*
* -
*
* middlefill
: zero, nan
(not a number), value
,
* median
, mean
, min
, max
*
*
* -
*
* backfill
: zero, nan
, value
, median
,
* mean
, min
, max
*
*
*
*
* The following list shows the parameters and their valid values for a Related Time Series
* featurization method (there are no defaults):
*
*
* -
*
* middlefill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* backfill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* futurefill
: zero
, value
, median
, mean
,
* min
, max
*
*
*
*
* To set a filling method to a specific value, set the fill parameter to value
and define the
* value in a corresponding _value
parameter. For example, to set backfilling to a value of 2,
* include the following: "backfill": "value"
and "backfill_value":"2"
.
*/
public void setFeaturizationMethodParameters(java.util.Map featurizationMethodParameters) {
this.featurizationMethodParameters = featurizationMethodParameters;
}
/**
*
* The method parameters (key-value pairs), which are a map of override parameters. Specify these parameters to
* override the default values. Related Time Series attributes do not accept aggregation parameters.
*
*
* The following list shows the parameters and their valid values for the "filling" featurization method for a
* Target Time Series dataset. Bold signifies the default value.
*
*
* -
*
* aggregation
: sum, avg
, first
, min
, max
*
*
* -
*
* frontfill
: none
*
*
* -
*
* middlefill
: zero, nan
(not a number), value
, median
,
* mean
, min
, max
*
*
* -
*
* backfill
: zero, nan
, value
, median
, mean
,
* min
, max
*
*
*
*
* The following list shows the parameters and their valid values for a Related Time Series featurization
* method (there are no defaults):
*
*
* -
*
* middlefill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* backfill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* futurefill
: zero
, value
, median
, mean
,
* min
, max
*
*
*
*
* To set a filling method to a specific value, set the fill parameter to value
and define the value in
* a corresponding _value
parameter. For example, to set backfilling to a value of 2, include the
* following: "backfill": "value"
and "backfill_value":"2"
.
*
*
* @param featurizationMethodParameters
* The method parameters (key-value pairs), which are a map of override parameters. Specify these parameters
* to override the default values. Related Time Series attributes do not accept aggregation parameters.
*
* The following list shows the parameters and their valid values for the "filling" featurization method for
* a Target Time Series dataset. Bold signifies the default value.
*
*
* -
*
* aggregation
: sum, avg
, first
, min
,
* max
*
*
* -
*
* frontfill
: none
*
*
* -
*
* middlefill
: zero, nan
(not a number), value
,
* median
, mean
, min
, max
*
*
* -
*
* backfill
: zero, nan
, value
, median
,
* mean
, min
, max
*
*
*
*
* The following list shows the parameters and their valid values for a Related Time Series
* featurization method (there are no defaults):
*
*
* -
*
* middlefill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* backfill
: zero
, value
, median
, mean
,
* min
, max
*
*
* -
*
* futurefill
: zero
, value
, median
, mean
,
* min
, max
*
*
*
*
* To set a filling method to a specific value, set the fill parameter to value
and define the
* value in a corresponding _value
parameter. For example, to set backfilling to a value of 2,
* include the following: "backfill": "value"
and "backfill_value":"2"
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FeaturizationMethod withFeaturizationMethodParameters(java.util.Map featurizationMethodParameters) {
setFeaturizationMethodParameters(featurizationMethodParameters);
return this;
}
/**
* Add a single FeaturizationMethodParameters entry
*
* @see FeaturizationMethod#withFeaturizationMethodParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public FeaturizationMethod addFeaturizationMethodParametersEntry(String key, String value) {
if (null == this.featurizationMethodParameters) {
this.featurizationMethodParameters = new java.util.HashMap();
}
if (this.featurizationMethodParameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.featurizationMethodParameters.put(key, value);
return this;
}
/**
* Removes all the entries added into FeaturizationMethodParameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FeaturizationMethod clearFeaturizationMethodParametersEntries() {
this.featurizationMethodParameters = null;
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 (getFeaturizationMethodName() != null)
sb.append("FeaturizationMethodName: ").append(getFeaturizationMethodName()).append(",");
if (getFeaturizationMethodParameters() != null)
sb.append("FeaturizationMethodParameters: ").append(getFeaturizationMethodParameters());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof FeaturizationMethod == false)
return false;
FeaturizationMethod other = (FeaturizationMethod) obj;
if (other.getFeaturizationMethodName() == null ^ this.getFeaturizationMethodName() == null)
return false;
if (other.getFeaturizationMethodName() != null && other.getFeaturizationMethodName().equals(this.getFeaturizationMethodName()) == false)
return false;
if (other.getFeaturizationMethodParameters() == null ^ this.getFeaturizationMethodParameters() == null)
return false;
if (other.getFeaturizationMethodParameters() != null
&& other.getFeaturizationMethodParameters().equals(this.getFeaturizationMethodParameters()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFeaturizationMethodName() == null) ? 0 : getFeaturizationMethodName().hashCode());
hashCode = prime * hashCode + ((getFeaturizationMethodParameters() == null) ? 0 : getFeaturizationMethodParameters().hashCode());
return hashCode;
}
@Override
public FeaturizationMethod clone() {
try {
return (FeaturizationMethod) 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.forecast.model.transform.FeaturizationMethodMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}