1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <note>
/// <p>This object belongs to the <code>CreatePredictor</code> operation. If you created your predictor with <code>CreateAutoPredictor</code>, see <code>AttributeConfig</code>.</p>
/// </note>
/// <p>Provides featurization (transformation) information for a dataset field. This object is part of the <code>FeaturizationConfig</code> object.</p>
/// <p>For example:</p>
/// <p> <code>{</code> </p>
/// <p> <code>"AttributeName": "demand",</code> </p>
/// <p> <code>FeaturizationPipeline [ {</code> </p>
/// <p> <code>"FeaturizationMethodName": "filling",</code> </p>
/// <p> <code>"FeaturizationMethodParameters": {"aggregation": "avg", "backfill": "nan"}</code> </p>
/// <p> <code>} ]</code> </p>
/// <p> <code>}</code> </p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Featurization {
/// <p>The name of the schema attribute that specifies the data field to be featurized. Amazon Forecast supports the target field of the <code>TARGET_TIME_SERIES</code> and the <code>RELATED_TIME_SERIES</code> datasets. For example, for the <code>RETAIL</code> domain, the target is <code>demand</code>, and for the <code>CUSTOM</code> domain, the target is <code>target_value</code>. For more information, see <code>howitworks-missing-values</code>.</p>
pub attribute_name: ::std::option::Option<::std::string::String>,
/// <p>An array of one <code>FeaturizationMethod</code> object that specifies the feature transformation method.</p>
pub featurization_pipeline: ::std::option::Option<::std::vec::Vec<crate::types::FeaturizationMethod>>,
}
impl Featurization {
/// <p>The name of the schema attribute that specifies the data field to be featurized. Amazon Forecast supports the target field of the <code>TARGET_TIME_SERIES</code> and the <code>RELATED_TIME_SERIES</code> datasets. For example, for the <code>RETAIL</code> domain, the target is <code>demand</code>, and for the <code>CUSTOM</code> domain, the target is <code>target_value</code>. For more information, see <code>howitworks-missing-values</code>.</p>
pub fn attribute_name(&self) -> ::std::option::Option<&str> {
self.attribute_name.as_deref()
}
/// <p>An array of one <code>FeaturizationMethod</code> object that specifies the feature transformation method.</p>
pub fn featurization_pipeline(&self) -> ::std::option::Option<&[crate::types::FeaturizationMethod]> {
self.featurization_pipeline.as_deref()
}
}
impl Featurization {
/// Creates a new builder-style object to manufacture [`Featurization`](crate::types::Featurization).
pub fn builder() -> crate::types::builders::FeaturizationBuilder {
crate::types::builders::FeaturizationBuilder::default()
}
}
/// A builder for [`Featurization`](crate::types::Featurization).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct FeaturizationBuilder {
pub(crate) attribute_name: ::std::option::Option<::std::string::String>,
pub(crate) featurization_pipeline: ::std::option::Option<::std::vec::Vec<crate::types::FeaturizationMethod>>,
}
impl FeaturizationBuilder {
/// <p>The name of the schema attribute that specifies the data field to be featurized. Amazon Forecast supports the target field of the <code>TARGET_TIME_SERIES</code> and the <code>RELATED_TIME_SERIES</code> datasets. For example, for the <code>RETAIL</code> domain, the target is <code>demand</code>, and for the <code>CUSTOM</code> domain, the target is <code>target_value</code>. For more information, see <code>howitworks-missing-values</code>.</p>
pub fn attribute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.attribute_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the schema attribute that specifies the data field to be featurized. Amazon Forecast supports the target field of the <code>TARGET_TIME_SERIES</code> and the <code>RELATED_TIME_SERIES</code> datasets. For example, for the <code>RETAIL</code> domain, the target is <code>demand</code>, and for the <code>CUSTOM</code> domain, the target is <code>target_value</code>. For more information, see <code>howitworks-missing-values</code>.</p>
pub fn set_attribute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.attribute_name = input;
self
}
/// <p>The name of the schema attribute that specifies the data field to be featurized. Amazon Forecast supports the target field of the <code>TARGET_TIME_SERIES</code> and the <code>RELATED_TIME_SERIES</code> datasets. For example, for the <code>RETAIL</code> domain, the target is <code>demand</code>, and for the <code>CUSTOM</code> domain, the target is <code>target_value</code>. For more information, see <code>howitworks-missing-values</code>.</p>
pub fn get_attribute_name(&self) -> &::std::option::Option<::std::string::String> {
&self.attribute_name
}
/// Appends an item to `featurization_pipeline`.
///
/// To override the contents of this collection use [`set_featurization_pipeline`](Self::set_featurization_pipeline).
///
/// <p>An array of one <code>FeaturizationMethod</code> object that specifies the feature transformation method.</p>
pub fn featurization_pipeline(mut self, input: crate::types::FeaturizationMethod) -> Self {
let mut v = self.featurization_pipeline.unwrap_or_default();
v.push(input);
self.featurization_pipeline = ::std::option::Option::Some(v);
self
}
/// <p>An array of one <code>FeaturizationMethod</code> object that specifies the feature transformation method.</p>
pub fn set_featurization_pipeline(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FeaturizationMethod>>) -> Self {
self.featurization_pipeline = input;
self
}
/// <p>An array of one <code>FeaturizationMethod</code> object that specifies the feature transformation method.</p>
pub fn get_featurization_pipeline(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FeaturizationMethod>> {
&self.featurization_pipeline
}
/// Consumes the builder and constructs a [`Featurization`](crate::types::Featurization).
pub fn build(self) -> crate::types::Featurization {
crate::types::Featurization {
attribute_name: self.attribute_name,
featurization_pipeline: self.featurization_pipeline,
}
}
}