{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Forecast.CreatePredictor
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an Amazon Forecast predictor.
--
-- In the request, provide a dataset group and either specify an algorithm
-- or let Amazon Forecast choose an algorithm for you using AutoML. If you
-- specify an algorithm, you also can override algorithm-specific
-- hyperparameters.
--
-- Amazon Forecast uses the algorithm to train a predictor using the latest
-- version of the datasets in the specified dataset group. You can then
-- generate a forecast using the CreateForecast operation.
--
-- To see the evaluation metrics, use the GetAccuracyMetrics operation.
--
-- You can specify a featurization configuration to fill and aggregate the
-- data fields in the @TARGET_TIME_SERIES@ dataset to improve model
-- training. For more information, see FeaturizationConfig.
--
-- For RELATED_TIME_SERIES datasets, @CreatePredictor@ verifies that the
-- @DataFrequency@ specified when the dataset was created matches the
-- @ForecastFrequency@. TARGET_TIME_SERIES datasets don\'t have this
-- restriction. Amazon Forecast also verifies the delimiter and timestamp
-- format. For more information, see howitworks-datasets-groups.
--
-- By default, predictors are trained and evaluated at the 0.1 (P10), 0.5
-- (P50), and 0.9 (P90) quantiles. You can choose custom forecast types to
-- train and evaluate your predictor by setting the @ForecastTypes@.
--
-- __AutoML__
--
-- If you want Amazon Forecast to evaluate each algorithm and choose the
-- one that minimizes the @objective function@, set @PerformAutoML@ to
-- @true@. The @objective function@ is defined as the mean of the weighted
-- losses over the forecast types. By default, these are the p10, p50, and
-- p90 quantile losses. For more information, see EvaluationResult.
--
-- When AutoML is enabled, the following properties are disallowed:
--
-- -   @AlgorithmArn@
--
-- -   @HPOConfig@
--
-- -   @PerformHPO@
--
-- -   @TrainingParameters@
--
-- To get a list of all of your predictors, use the ListPredictors
-- operation.
--
-- Before you can use the predictor to create a forecast, the @Status@ of
-- the predictor must be @ACTIVE@, signifying that training has completed.
-- To get the status, use the DescribePredictor operation.
module Amazonka.Forecast.CreatePredictor
  ( -- * Creating a Request
    CreatePredictor (..),
    newCreatePredictor,

    -- * Request Lenses
    createPredictor_performAutoML,
    createPredictor_trainingParameters,
    createPredictor_algorithmArn,
    createPredictor_hPOConfig,
    createPredictor_optimizationMetric,
    createPredictor_autoMLOverrideStrategy,
    createPredictor_evaluationParameters,
    createPredictor_encryptionConfig,
    createPredictor_forecastTypes,
    createPredictor_performHPO,
    createPredictor_tags,
    createPredictor_predictorName,
    createPredictor_forecastHorizon,
    createPredictor_inputDataConfig,
    createPredictor_featurizationConfig,

    -- * Destructuring the Response
    CreatePredictorResponse (..),
    newCreatePredictorResponse,

    -- * Response Lenses
    createPredictorResponse_predictorArn,
    createPredictorResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Forecast.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreatePredictor' smart constructor.
data CreatePredictor = CreatePredictor'
  { -- | Whether to perform AutoML. When Amazon Forecast performs AutoML, it
    -- evaluates the algorithms it provides and chooses the best algorithm and
    -- configuration for your training dataset.
    --
    -- The default value is @false@. In this case, you are required to specify
    -- an algorithm.
    --
    -- Set @PerformAutoML@ to @true@ to have Amazon Forecast perform AutoML.
    -- This is a good option if you aren\'t sure which algorithm is suitable
    -- for your training data. In this case, @PerformHPO@ must be false.
    CreatePredictor -> Maybe Bool
performAutoML :: Prelude.Maybe Prelude.Bool,
    -- | The hyperparameters to override for model training. The hyperparameters
    -- that you can override are listed in the individual algorithms. For the
    -- list of supported algorithms, see aws-forecast-choosing-recipes.
    CreatePredictor -> Maybe (HashMap Text Text)
trainingParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the algorithm to use for model
    -- training. Required if @PerformAutoML@ is not set to @true@.
    --
    -- __Supported algorithms:__
    --
    -- -   @arn:aws:forecast:::algorithm\/ARIMA@
    --
    -- -   @arn:aws:forecast:::algorithm\/CNN-QR@
    --
    -- -   @arn:aws:forecast:::algorithm\/Deep_AR_Plus@
    --
    -- -   @arn:aws:forecast:::algorithm\/ETS@
    --
    -- -   @arn:aws:forecast:::algorithm\/NPTS@
    --
    -- -   @arn:aws:forecast:::algorithm\/Prophet@
    CreatePredictor -> Maybe Text
algorithmArn :: Prelude.Maybe Prelude.Text,
    -- | Provides hyperparameter override values for the algorithm. If you don\'t
    -- provide this parameter, Amazon Forecast uses default values. The
    -- individual algorithms specify which hyperparameters support
    -- hyperparameter optimization (HPO). For more information, see
    -- aws-forecast-choosing-recipes.
    --
    -- If you included the @HPOConfig@ object, you must set @PerformHPO@ to
    -- true.
    CreatePredictor -> Maybe HyperParameterTuningJobConfig
hPOConfig :: Prelude.Maybe HyperParameterTuningJobConfig,
    -- | The accuracy metric used to optimize the predictor.
    CreatePredictor -> Maybe OptimizationMetric
optimizationMetric :: Prelude.Maybe OptimizationMetric,
    -- | The @LatencyOptimized@ AutoML override strategy is only available in
    -- private beta. Contact AWS Support or your account manager to learn more
    -- about access privileges.
    --
    -- Used to overide the default AutoML strategy, which is to optimize
    -- predictor accuracy. To apply an AutoML strategy that minimizes training
    -- time, use @LatencyOptimized@.
    --
    -- This parameter is only valid for predictors trained using AutoML.
    CreatePredictor -> Maybe AutoMLOverrideStrategy
autoMLOverrideStrategy :: Prelude.Maybe AutoMLOverrideStrategy,
    -- | Used to override the default evaluation parameters of the specified
    -- algorithm. Amazon Forecast evaluates a predictor by splitting a dataset
    -- into training data and testing data. The evaluation parameters define
    -- how to perform the split and the number of iterations.
    CreatePredictor -> Maybe EvaluationParameters
evaluationParameters :: Prelude.Maybe EvaluationParameters,
    -- | An AWS Key Management Service (KMS) key and the AWS Identity and Access
    -- Management (IAM) role that Amazon Forecast can assume to access the key.
    CreatePredictor -> Maybe EncryptionConfig
encryptionConfig :: Prelude.Maybe EncryptionConfig,
    -- | Specifies the forecast types used to train a predictor. You can specify
    -- up to five forecast types. Forecast types can be quantiles from 0.01 to
    -- 0.99, by increments of 0.01 or higher. You can also specify the mean
    -- forecast with @mean@.
    --
    -- The default value is @[\"0.10\", \"0.50\", \"0.9\"]@.
    CreatePredictor -> Maybe (NonEmpty Text)
forecastTypes :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | Whether to perform hyperparameter optimization (HPO). HPO finds optimal
    -- hyperparameter values for your training data. The process of performing
    -- HPO is known as running a hyperparameter tuning job.
    --
    -- The default value is @false@. In this case, Amazon Forecast uses default
    -- hyperparameter values from the chosen algorithm.
    --
    -- To override the default values, set @PerformHPO@ to @true@ and,
    -- optionally, supply the HyperParameterTuningJobConfig object. The tuning
    -- job specifies a metric to optimize, which hyperparameters participate in
    -- tuning, and the valid range for each tunable hyperparameter. In this
    -- case, you are required to specify an algorithm and @PerformAutoML@ must
    -- be false.
    --
    -- The following algorithms support HPO:
    --
    -- -   DeepAR+
    --
    -- -   CNN-QR
    CreatePredictor -> Maybe Bool
performHPO :: Prelude.Maybe Prelude.Bool,
    -- | The optional metadata that you apply to the predictor to help you
    -- categorize and organize them. Each tag consists of a key and an optional
    -- value, both of which you define.
    --
    -- The following basic restrictions apply to tags:
    --
    -- -   Maximum number of tags per resource - 50.
    --
    -- -   For each resource, each tag key must be unique, and each tag key can
    --     have only one value.
    --
    -- -   Maximum key length - 128 Unicode characters in UTF-8.
    --
    -- -   Maximum value length - 256 Unicode characters in UTF-8.
    --
    -- -   If your tagging schema is used across multiple services and
    --     resources, remember that other services may have restrictions on
    --     allowed characters. Generally allowed characters are: letters,
    --     numbers, and spaces representable in UTF-8, and the following
    --     characters: + - = . _ : \/ \@.
    --
    -- -   Tag keys and values are case sensitive.
    --
    -- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
    --     such as a prefix for keys as it is reserved for AWS use. You cannot
    --     edit or delete tag keys with this prefix. Values can have this
    --     prefix. If a tag value has @aws@ as its prefix but the key does not,
    --     then Forecast considers it to be a user tag and will count against
    --     the limit of 50 tags. Tags with only the key prefix of @aws@ do not
    --     count against your tags per resource limit.
    CreatePredictor -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A name for the predictor.
    CreatePredictor -> Text
predictorName :: Prelude.Text,
    -- | Specifies the number of time-steps that the model is trained to predict.
    -- The forecast horizon is also called the prediction length.
    --
    -- For example, if you configure a dataset for daily data collection (using
    -- the @DataFrequency@ parameter of the CreateDataset operation) and set
    -- the forecast horizon to 10, the model returns predictions for 10 days.
    --
    -- The maximum forecast horizon is the lesser of 500 time-steps or 1\/3 of
    -- the TARGET_TIME_SERIES dataset length.
    CreatePredictor -> Int
forecastHorizon :: Prelude.Int,
    -- | Describes the dataset group that contains the data to use to train the
    -- predictor.
    CreatePredictor -> InputDataConfig
inputDataConfig :: InputDataConfig,
    -- | The featurization configuration.
    CreatePredictor -> FeaturizationConfig
featurizationConfig :: FeaturizationConfig
  }
  deriving (CreatePredictor -> CreatePredictor -> Bool
(CreatePredictor -> CreatePredictor -> Bool)
-> (CreatePredictor -> CreatePredictor -> Bool)
-> Eq CreatePredictor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePredictor -> CreatePredictor -> Bool
$c/= :: CreatePredictor -> CreatePredictor -> Bool
== :: CreatePredictor -> CreatePredictor -> Bool
$c== :: CreatePredictor -> CreatePredictor -> Bool
Prelude.Eq, Int -> CreatePredictor -> ShowS
[CreatePredictor] -> ShowS
CreatePredictor -> String
(Int -> CreatePredictor -> ShowS)
-> (CreatePredictor -> String)
-> ([CreatePredictor] -> ShowS)
-> Show CreatePredictor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePredictor] -> ShowS
$cshowList :: [CreatePredictor] -> ShowS
show :: CreatePredictor -> String
$cshow :: CreatePredictor -> String
showsPrec :: Int -> CreatePredictor -> ShowS
$cshowsPrec :: Int -> CreatePredictor -> ShowS
Prelude.Show, (forall x. CreatePredictor -> Rep CreatePredictor x)
-> (forall x. Rep CreatePredictor x -> CreatePredictor)
-> Generic CreatePredictor
forall x. Rep CreatePredictor x -> CreatePredictor
forall x. CreatePredictor -> Rep CreatePredictor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreatePredictor x -> CreatePredictor
$cfrom :: forall x. CreatePredictor -> Rep CreatePredictor x
Prelude.Generic)

-- |
-- Create a value of 'CreatePredictor' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'performAutoML', 'createPredictor_performAutoML' - Whether to perform AutoML. When Amazon Forecast performs AutoML, it
-- evaluates the algorithms it provides and chooses the best algorithm and
-- configuration for your training dataset.
--
-- The default value is @false@. In this case, you are required to specify
-- an algorithm.
--
-- Set @PerformAutoML@ to @true@ to have Amazon Forecast perform AutoML.
-- This is a good option if you aren\'t sure which algorithm is suitable
-- for your training data. In this case, @PerformHPO@ must be false.
--
-- 'trainingParameters', 'createPredictor_trainingParameters' - The hyperparameters to override for model training. The hyperparameters
-- that you can override are listed in the individual algorithms. For the
-- list of supported algorithms, see aws-forecast-choosing-recipes.
--
-- 'algorithmArn', 'createPredictor_algorithmArn' - The Amazon Resource Name (ARN) of the algorithm to use for model
-- training. Required if @PerformAutoML@ is not set to @true@.
--
-- __Supported algorithms:__
--
-- -   @arn:aws:forecast:::algorithm\/ARIMA@
--
-- -   @arn:aws:forecast:::algorithm\/CNN-QR@
--
-- -   @arn:aws:forecast:::algorithm\/Deep_AR_Plus@
--
-- -   @arn:aws:forecast:::algorithm\/ETS@
--
-- -   @arn:aws:forecast:::algorithm\/NPTS@
--
-- -   @arn:aws:forecast:::algorithm\/Prophet@
--
-- 'hPOConfig', 'createPredictor_hPOConfig' - Provides hyperparameter override values for the algorithm. If you don\'t
-- provide this parameter, Amazon Forecast uses default values. The
-- individual algorithms specify which hyperparameters support
-- hyperparameter optimization (HPO). For more information, see
-- aws-forecast-choosing-recipes.
--
-- If you included the @HPOConfig@ object, you must set @PerformHPO@ to
-- true.
--
-- 'optimizationMetric', 'createPredictor_optimizationMetric' - The accuracy metric used to optimize the predictor.
--
-- 'autoMLOverrideStrategy', 'createPredictor_autoMLOverrideStrategy' - The @LatencyOptimized@ AutoML override strategy is only available in
-- private beta. Contact AWS Support or your account manager to learn more
-- about access privileges.
--
-- Used to overide the default AutoML strategy, which is to optimize
-- predictor accuracy. To apply an AutoML strategy that minimizes training
-- time, use @LatencyOptimized@.
--
-- This parameter is only valid for predictors trained using AutoML.
--
-- 'evaluationParameters', 'createPredictor_evaluationParameters' - Used to override the default evaluation parameters of the specified
-- algorithm. Amazon Forecast evaluates a predictor by splitting a dataset
-- into training data and testing data. The evaluation parameters define
-- how to perform the split and the number of iterations.
--
-- 'encryptionConfig', 'createPredictor_encryptionConfig' - An AWS Key Management Service (KMS) key and the AWS Identity and Access
-- Management (IAM) role that Amazon Forecast can assume to access the key.
--
-- 'forecastTypes', 'createPredictor_forecastTypes' - Specifies the forecast types used to train a predictor. You can specify
-- up to five forecast types. Forecast types can be quantiles from 0.01 to
-- 0.99, by increments of 0.01 or higher. You can also specify the mean
-- forecast with @mean@.
--
-- The default value is @[\"0.10\", \"0.50\", \"0.9\"]@.
--
-- 'performHPO', 'createPredictor_performHPO' - Whether to perform hyperparameter optimization (HPO). HPO finds optimal
-- hyperparameter values for your training data. The process of performing
-- HPO is known as running a hyperparameter tuning job.
--
-- The default value is @false@. In this case, Amazon Forecast uses default
-- hyperparameter values from the chosen algorithm.
--
-- To override the default values, set @PerformHPO@ to @true@ and,
-- optionally, supply the HyperParameterTuningJobConfig object. The tuning
-- job specifies a metric to optimize, which hyperparameters participate in
-- tuning, and the valid range for each tunable hyperparameter. In this
-- case, you are required to specify an algorithm and @PerformAutoML@ must
-- be false.
--
-- The following algorithms support HPO:
--
-- -   DeepAR+
--
-- -   CNN-QR
--
-- 'tags', 'createPredictor_tags' - The optional metadata that you apply to the predictor to help you
-- categorize and organize them. Each tag consists of a key and an optional
-- value, both of which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50.
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8.
--
-- -   Maximum value length - 256 Unicode characters in UTF-8.
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for keys as it is reserved for AWS use. You cannot
--     edit or delete tag keys with this prefix. Values can have this
--     prefix. If a tag value has @aws@ as its prefix but the key does not,
--     then Forecast considers it to be a user tag and will count against
--     the limit of 50 tags. Tags with only the key prefix of @aws@ do not
--     count against your tags per resource limit.
--
-- 'predictorName', 'createPredictor_predictorName' - A name for the predictor.
--
-- 'forecastHorizon', 'createPredictor_forecastHorizon' - Specifies the number of time-steps that the model is trained to predict.
-- The forecast horizon is also called the prediction length.
--
-- For example, if you configure a dataset for daily data collection (using
-- the @DataFrequency@ parameter of the CreateDataset operation) and set
-- the forecast horizon to 10, the model returns predictions for 10 days.
--
-- The maximum forecast horizon is the lesser of 500 time-steps or 1\/3 of
-- the TARGET_TIME_SERIES dataset length.
--
-- 'inputDataConfig', 'createPredictor_inputDataConfig' - Describes the dataset group that contains the data to use to train the
-- predictor.
--
-- 'featurizationConfig', 'createPredictor_featurizationConfig' - The featurization configuration.
newCreatePredictor ::
  -- | 'predictorName'
  Prelude.Text ->
  -- | 'forecastHorizon'
  Prelude.Int ->
  -- | 'inputDataConfig'
  InputDataConfig ->
  -- | 'featurizationConfig'
  FeaturizationConfig ->
  CreatePredictor
newCreatePredictor :: Text
-> Int -> InputDataConfig -> FeaturizationConfig -> CreatePredictor
newCreatePredictor
  Text
pPredictorName_
  Int
pForecastHorizon_
  InputDataConfig
pInputDataConfig_
  FeaturizationConfig
pFeaturizationConfig_ =
    CreatePredictor' :: Maybe Bool
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe HyperParameterTuningJobConfig
-> Maybe OptimizationMetric
-> Maybe AutoMLOverrideStrategy
-> Maybe EvaluationParameters
-> Maybe EncryptionConfig
-> Maybe (NonEmpty Text)
-> Maybe Bool
-> Maybe [Tag]
-> Text
-> Int
-> InputDataConfig
-> FeaturizationConfig
-> CreatePredictor
CreatePredictor'
      { $sel:performAutoML:CreatePredictor' :: Maybe Bool
performAutoML = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:trainingParameters:CreatePredictor' :: Maybe (HashMap Text Text)
trainingParameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:algorithmArn:CreatePredictor' :: Maybe Text
algorithmArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:hPOConfig:CreatePredictor' :: Maybe HyperParameterTuningJobConfig
hPOConfig = Maybe HyperParameterTuningJobConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:optimizationMetric:CreatePredictor' :: Maybe OptimizationMetric
optimizationMetric = Maybe OptimizationMetric
forall a. Maybe a
Prelude.Nothing,
        $sel:autoMLOverrideStrategy:CreatePredictor' :: Maybe AutoMLOverrideStrategy
autoMLOverrideStrategy = Maybe AutoMLOverrideStrategy
forall a. Maybe a
Prelude.Nothing,
        $sel:evaluationParameters:CreatePredictor' :: Maybe EvaluationParameters
evaluationParameters = Maybe EvaluationParameters
forall a. Maybe a
Prelude.Nothing,
        $sel:encryptionConfig:CreatePredictor' :: Maybe EncryptionConfig
encryptionConfig = Maybe EncryptionConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:forecastTypes:CreatePredictor' :: Maybe (NonEmpty Text)
forecastTypes = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:performHPO:CreatePredictor' :: Maybe Bool
performHPO = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreatePredictor' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:predictorName:CreatePredictor' :: Text
predictorName = Text
pPredictorName_,
        $sel:forecastHorizon:CreatePredictor' :: Int
forecastHorizon = Int
pForecastHorizon_,
        $sel:inputDataConfig:CreatePredictor' :: InputDataConfig
inputDataConfig = InputDataConfig
pInputDataConfig_,
        $sel:featurizationConfig:CreatePredictor' :: FeaturizationConfig
featurizationConfig = FeaturizationConfig
pFeaturizationConfig_
      }

-- | Whether to perform AutoML. When Amazon Forecast performs AutoML, it
-- evaluates the algorithms it provides and chooses the best algorithm and
-- configuration for your training dataset.
--
-- The default value is @false@. In this case, you are required to specify
-- an algorithm.
--
-- Set @PerformAutoML@ to @true@ to have Amazon Forecast perform AutoML.
-- This is a good option if you aren\'t sure which algorithm is suitable
-- for your training data. In this case, @PerformHPO@ must be false.
createPredictor_performAutoML :: Lens.Lens' CreatePredictor (Prelude.Maybe Prelude.Bool)
createPredictor_performAutoML :: (Maybe Bool -> f (Maybe Bool))
-> CreatePredictor -> f CreatePredictor
createPredictor_performAutoML = (CreatePredictor -> Maybe Bool)
-> (CreatePredictor -> Maybe Bool -> CreatePredictor)
-> Lens CreatePredictor CreatePredictor (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe Bool
performAutoML :: Maybe Bool
$sel:performAutoML:CreatePredictor' :: CreatePredictor -> Maybe Bool
performAutoML} -> Maybe Bool
performAutoML) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe Bool
a -> CreatePredictor
s {$sel:performAutoML:CreatePredictor' :: Maybe Bool
performAutoML = Maybe Bool
a} :: CreatePredictor)

-- | The hyperparameters to override for model training. The hyperparameters
-- that you can override are listed in the individual algorithms. For the
-- list of supported algorithms, see aws-forecast-choosing-recipes.
createPredictor_trainingParameters :: Lens.Lens' CreatePredictor (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createPredictor_trainingParameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreatePredictor -> f CreatePredictor
createPredictor_trainingParameters = (CreatePredictor -> Maybe (HashMap Text Text))
-> (CreatePredictor
    -> Maybe (HashMap Text Text) -> CreatePredictor)
-> Lens
     CreatePredictor
     CreatePredictor
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe (HashMap Text Text)
trainingParameters :: Maybe (HashMap Text Text)
$sel:trainingParameters:CreatePredictor' :: CreatePredictor -> Maybe (HashMap Text Text)
trainingParameters} -> Maybe (HashMap Text Text)
trainingParameters) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe (HashMap Text Text)
a -> CreatePredictor
s {$sel:trainingParameters:CreatePredictor' :: Maybe (HashMap Text Text)
trainingParameters = Maybe (HashMap Text Text)
a} :: CreatePredictor) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreatePredictor -> f CreatePredictor)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreatePredictor
-> f CreatePredictor
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the algorithm to use for model
-- training. Required if @PerformAutoML@ is not set to @true@.
--
-- __Supported algorithms:__
--
-- -   @arn:aws:forecast:::algorithm\/ARIMA@
--
-- -   @arn:aws:forecast:::algorithm\/CNN-QR@
--
-- -   @arn:aws:forecast:::algorithm\/Deep_AR_Plus@
--
-- -   @arn:aws:forecast:::algorithm\/ETS@
--
-- -   @arn:aws:forecast:::algorithm\/NPTS@
--
-- -   @arn:aws:forecast:::algorithm\/Prophet@
createPredictor_algorithmArn :: Lens.Lens' CreatePredictor (Prelude.Maybe Prelude.Text)
createPredictor_algorithmArn :: (Maybe Text -> f (Maybe Text))
-> CreatePredictor -> f CreatePredictor
createPredictor_algorithmArn = (CreatePredictor -> Maybe Text)
-> (CreatePredictor -> Maybe Text -> CreatePredictor)
-> Lens CreatePredictor CreatePredictor (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe Text
algorithmArn :: Maybe Text
$sel:algorithmArn:CreatePredictor' :: CreatePredictor -> Maybe Text
algorithmArn} -> Maybe Text
algorithmArn) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe Text
a -> CreatePredictor
s {$sel:algorithmArn:CreatePredictor' :: Maybe Text
algorithmArn = Maybe Text
a} :: CreatePredictor)

-- | Provides hyperparameter override values for the algorithm. If you don\'t
-- provide this parameter, Amazon Forecast uses default values. The
-- individual algorithms specify which hyperparameters support
-- hyperparameter optimization (HPO). For more information, see
-- aws-forecast-choosing-recipes.
--
-- If you included the @HPOConfig@ object, you must set @PerformHPO@ to
-- true.
createPredictor_hPOConfig :: Lens.Lens' CreatePredictor (Prelude.Maybe HyperParameterTuningJobConfig)
createPredictor_hPOConfig :: (Maybe HyperParameterTuningJobConfig
 -> f (Maybe HyperParameterTuningJobConfig))
-> CreatePredictor -> f CreatePredictor
createPredictor_hPOConfig = (CreatePredictor -> Maybe HyperParameterTuningJobConfig)
-> (CreatePredictor
    -> Maybe HyperParameterTuningJobConfig -> CreatePredictor)
-> Lens
     CreatePredictor
     CreatePredictor
     (Maybe HyperParameterTuningJobConfig)
     (Maybe HyperParameterTuningJobConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe HyperParameterTuningJobConfig
hPOConfig :: Maybe HyperParameterTuningJobConfig
$sel:hPOConfig:CreatePredictor' :: CreatePredictor -> Maybe HyperParameterTuningJobConfig
hPOConfig} -> Maybe HyperParameterTuningJobConfig
hPOConfig) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe HyperParameterTuningJobConfig
a -> CreatePredictor
s {$sel:hPOConfig:CreatePredictor' :: Maybe HyperParameterTuningJobConfig
hPOConfig = Maybe HyperParameterTuningJobConfig
a} :: CreatePredictor)

-- | The accuracy metric used to optimize the predictor.
createPredictor_optimizationMetric :: Lens.Lens' CreatePredictor (Prelude.Maybe OptimizationMetric)
createPredictor_optimizationMetric :: (Maybe OptimizationMetric -> f (Maybe OptimizationMetric))
-> CreatePredictor -> f CreatePredictor
createPredictor_optimizationMetric = (CreatePredictor -> Maybe OptimizationMetric)
-> (CreatePredictor -> Maybe OptimizationMetric -> CreatePredictor)
-> Lens
     CreatePredictor
     CreatePredictor
     (Maybe OptimizationMetric)
     (Maybe OptimizationMetric)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe OptimizationMetric
optimizationMetric :: Maybe OptimizationMetric
$sel:optimizationMetric:CreatePredictor' :: CreatePredictor -> Maybe OptimizationMetric
optimizationMetric} -> Maybe OptimizationMetric
optimizationMetric) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe OptimizationMetric
a -> CreatePredictor
s {$sel:optimizationMetric:CreatePredictor' :: Maybe OptimizationMetric
optimizationMetric = Maybe OptimizationMetric
a} :: CreatePredictor)

-- | The @LatencyOptimized@ AutoML override strategy is only available in
-- private beta. Contact AWS Support or your account manager to learn more
-- about access privileges.
--
-- Used to overide the default AutoML strategy, which is to optimize
-- predictor accuracy. To apply an AutoML strategy that minimizes training
-- time, use @LatencyOptimized@.
--
-- This parameter is only valid for predictors trained using AutoML.
createPredictor_autoMLOverrideStrategy :: Lens.Lens' CreatePredictor (Prelude.Maybe AutoMLOverrideStrategy)
createPredictor_autoMLOverrideStrategy :: (Maybe AutoMLOverrideStrategy -> f (Maybe AutoMLOverrideStrategy))
-> CreatePredictor -> f CreatePredictor
createPredictor_autoMLOverrideStrategy = (CreatePredictor -> Maybe AutoMLOverrideStrategy)
-> (CreatePredictor
    -> Maybe AutoMLOverrideStrategy -> CreatePredictor)
-> Lens
     CreatePredictor
     CreatePredictor
     (Maybe AutoMLOverrideStrategy)
     (Maybe AutoMLOverrideStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe AutoMLOverrideStrategy
autoMLOverrideStrategy :: Maybe AutoMLOverrideStrategy
$sel:autoMLOverrideStrategy:CreatePredictor' :: CreatePredictor -> Maybe AutoMLOverrideStrategy
autoMLOverrideStrategy} -> Maybe AutoMLOverrideStrategy
autoMLOverrideStrategy) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe AutoMLOverrideStrategy
a -> CreatePredictor
s {$sel:autoMLOverrideStrategy:CreatePredictor' :: Maybe AutoMLOverrideStrategy
autoMLOverrideStrategy = Maybe AutoMLOverrideStrategy
a} :: CreatePredictor)

-- | Used to override the default evaluation parameters of the specified
-- algorithm. Amazon Forecast evaluates a predictor by splitting a dataset
-- into training data and testing data. The evaluation parameters define
-- how to perform the split and the number of iterations.
createPredictor_evaluationParameters :: Lens.Lens' CreatePredictor (Prelude.Maybe EvaluationParameters)
createPredictor_evaluationParameters :: (Maybe EvaluationParameters -> f (Maybe EvaluationParameters))
-> CreatePredictor -> f CreatePredictor
createPredictor_evaluationParameters = (CreatePredictor -> Maybe EvaluationParameters)
-> (CreatePredictor
    -> Maybe EvaluationParameters -> CreatePredictor)
-> Lens
     CreatePredictor
     CreatePredictor
     (Maybe EvaluationParameters)
     (Maybe EvaluationParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe EvaluationParameters
evaluationParameters :: Maybe EvaluationParameters
$sel:evaluationParameters:CreatePredictor' :: CreatePredictor -> Maybe EvaluationParameters
evaluationParameters} -> Maybe EvaluationParameters
evaluationParameters) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe EvaluationParameters
a -> CreatePredictor
s {$sel:evaluationParameters:CreatePredictor' :: Maybe EvaluationParameters
evaluationParameters = Maybe EvaluationParameters
a} :: CreatePredictor)

-- | An AWS Key Management Service (KMS) key and the AWS Identity and Access
-- Management (IAM) role that Amazon Forecast can assume to access the key.
createPredictor_encryptionConfig :: Lens.Lens' CreatePredictor (Prelude.Maybe EncryptionConfig)
createPredictor_encryptionConfig :: (Maybe EncryptionConfig -> f (Maybe EncryptionConfig))
-> CreatePredictor -> f CreatePredictor
createPredictor_encryptionConfig = (CreatePredictor -> Maybe EncryptionConfig)
-> (CreatePredictor -> Maybe EncryptionConfig -> CreatePredictor)
-> Lens
     CreatePredictor
     CreatePredictor
     (Maybe EncryptionConfig)
     (Maybe EncryptionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe EncryptionConfig
encryptionConfig :: Maybe EncryptionConfig
$sel:encryptionConfig:CreatePredictor' :: CreatePredictor -> Maybe EncryptionConfig
encryptionConfig} -> Maybe EncryptionConfig
encryptionConfig) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe EncryptionConfig
a -> CreatePredictor
s {$sel:encryptionConfig:CreatePredictor' :: Maybe EncryptionConfig
encryptionConfig = Maybe EncryptionConfig
a} :: CreatePredictor)

-- | Specifies the forecast types used to train a predictor. You can specify
-- up to five forecast types. Forecast types can be quantiles from 0.01 to
-- 0.99, by increments of 0.01 or higher. You can also specify the mean
-- forecast with @mean@.
--
-- The default value is @[\"0.10\", \"0.50\", \"0.9\"]@.
createPredictor_forecastTypes :: Lens.Lens' CreatePredictor (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
createPredictor_forecastTypes :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CreatePredictor -> f CreatePredictor
createPredictor_forecastTypes = (CreatePredictor -> Maybe (NonEmpty Text))
-> (CreatePredictor -> Maybe (NonEmpty Text) -> CreatePredictor)
-> Lens
     CreatePredictor
     CreatePredictor
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe (NonEmpty Text)
forecastTypes :: Maybe (NonEmpty Text)
$sel:forecastTypes:CreatePredictor' :: CreatePredictor -> Maybe (NonEmpty Text)
forecastTypes} -> Maybe (NonEmpty Text)
forecastTypes) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe (NonEmpty Text)
a -> CreatePredictor
s {$sel:forecastTypes:CreatePredictor' :: Maybe (NonEmpty Text)
forecastTypes = Maybe (NonEmpty Text)
a} :: CreatePredictor) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> CreatePredictor -> f CreatePredictor)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CreatePredictor
-> f CreatePredictor
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Whether to perform hyperparameter optimization (HPO). HPO finds optimal
-- hyperparameter values for your training data. The process of performing
-- HPO is known as running a hyperparameter tuning job.
--
-- The default value is @false@. In this case, Amazon Forecast uses default
-- hyperparameter values from the chosen algorithm.
--
-- To override the default values, set @PerformHPO@ to @true@ and,
-- optionally, supply the HyperParameterTuningJobConfig object. The tuning
-- job specifies a metric to optimize, which hyperparameters participate in
-- tuning, and the valid range for each tunable hyperparameter. In this
-- case, you are required to specify an algorithm and @PerformAutoML@ must
-- be false.
--
-- The following algorithms support HPO:
--
-- -   DeepAR+
--
-- -   CNN-QR
createPredictor_performHPO :: Lens.Lens' CreatePredictor (Prelude.Maybe Prelude.Bool)
createPredictor_performHPO :: (Maybe Bool -> f (Maybe Bool))
-> CreatePredictor -> f CreatePredictor
createPredictor_performHPO = (CreatePredictor -> Maybe Bool)
-> (CreatePredictor -> Maybe Bool -> CreatePredictor)
-> Lens CreatePredictor CreatePredictor (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe Bool
performHPO :: Maybe Bool
$sel:performHPO:CreatePredictor' :: CreatePredictor -> Maybe Bool
performHPO} -> Maybe Bool
performHPO) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe Bool
a -> CreatePredictor
s {$sel:performHPO:CreatePredictor' :: Maybe Bool
performHPO = Maybe Bool
a} :: CreatePredictor)

-- | The optional metadata that you apply to the predictor to help you
-- categorize and organize them. Each tag consists of a key and an optional
-- value, both of which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50.
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8.
--
-- -   Maximum value length - 256 Unicode characters in UTF-8.
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for keys as it is reserved for AWS use. You cannot
--     edit or delete tag keys with this prefix. Values can have this
--     prefix. If a tag value has @aws@ as its prefix but the key does not,
--     then Forecast considers it to be a user tag and will count against
--     the limit of 50 tags. Tags with only the key prefix of @aws@ do not
--     count against your tags per resource limit.
createPredictor_tags :: Lens.Lens' CreatePredictor (Prelude.Maybe [Tag])
createPredictor_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreatePredictor -> f CreatePredictor
createPredictor_tags = (CreatePredictor -> Maybe [Tag])
-> (CreatePredictor -> Maybe [Tag] -> CreatePredictor)
-> Lens CreatePredictor CreatePredictor (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreatePredictor' :: CreatePredictor -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreatePredictor
s@CreatePredictor' {} Maybe [Tag]
a -> CreatePredictor
s {$sel:tags:CreatePredictor' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreatePredictor) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreatePredictor -> f CreatePredictor)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreatePredictor
-> f CreatePredictor
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A name for the predictor.
createPredictor_predictorName :: Lens.Lens' CreatePredictor Prelude.Text
createPredictor_predictorName :: (Text -> f Text) -> CreatePredictor -> f CreatePredictor
createPredictor_predictorName = (CreatePredictor -> Text)
-> (CreatePredictor -> Text -> CreatePredictor)
-> Lens CreatePredictor CreatePredictor Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Text
predictorName :: Text
$sel:predictorName:CreatePredictor' :: CreatePredictor -> Text
predictorName} -> Text
predictorName) (\s :: CreatePredictor
s@CreatePredictor' {} Text
a -> CreatePredictor
s {$sel:predictorName:CreatePredictor' :: Text
predictorName = Text
a} :: CreatePredictor)

-- | Specifies the number of time-steps that the model is trained to predict.
-- The forecast horizon is also called the prediction length.
--
-- For example, if you configure a dataset for daily data collection (using
-- the @DataFrequency@ parameter of the CreateDataset operation) and set
-- the forecast horizon to 10, the model returns predictions for 10 days.
--
-- The maximum forecast horizon is the lesser of 500 time-steps or 1\/3 of
-- the TARGET_TIME_SERIES dataset length.
createPredictor_forecastHorizon :: Lens.Lens' CreatePredictor Prelude.Int
createPredictor_forecastHorizon :: (Int -> f Int) -> CreatePredictor -> f CreatePredictor
createPredictor_forecastHorizon = (CreatePredictor -> Int)
-> (CreatePredictor -> Int -> CreatePredictor)
-> Lens CreatePredictor CreatePredictor Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {Int
forecastHorizon :: Int
$sel:forecastHorizon:CreatePredictor' :: CreatePredictor -> Int
forecastHorizon} -> Int
forecastHorizon) (\s :: CreatePredictor
s@CreatePredictor' {} Int
a -> CreatePredictor
s {$sel:forecastHorizon:CreatePredictor' :: Int
forecastHorizon = Int
a} :: CreatePredictor)

-- | Describes the dataset group that contains the data to use to train the
-- predictor.
createPredictor_inputDataConfig :: Lens.Lens' CreatePredictor InputDataConfig
createPredictor_inputDataConfig :: (InputDataConfig -> f InputDataConfig)
-> CreatePredictor -> f CreatePredictor
createPredictor_inputDataConfig = (CreatePredictor -> InputDataConfig)
-> (CreatePredictor -> InputDataConfig -> CreatePredictor)
-> Lens
     CreatePredictor CreatePredictor InputDataConfig InputDataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {InputDataConfig
inputDataConfig :: InputDataConfig
$sel:inputDataConfig:CreatePredictor' :: CreatePredictor -> InputDataConfig
inputDataConfig} -> InputDataConfig
inputDataConfig) (\s :: CreatePredictor
s@CreatePredictor' {} InputDataConfig
a -> CreatePredictor
s {$sel:inputDataConfig:CreatePredictor' :: InputDataConfig
inputDataConfig = InputDataConfig
a} :: CreatePredictor)

-- | The featurization configuration.
createPredictor_featurizationConfig :: Lens.Lens' CreatePredictor FeaturizationConfig
createPredictor_featurizationConfig :: (FeaturizationConfig -> f FeaturizationConfig)
-> CreatePredictor -> f CreatePredictor
createPredictor_featurizationConfig = (CreatePredictor -> FeaturizationConfig)
-> (CreatePredictor -> FeaturizationConfig -> CreatePredictor)
-> Lens
     CreatePredictor
     CreatePredictor
     FeaturizationConfig
     FeaturizationConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictor' {FeaturizationConfig
featurizationConfig :: FeaturizationConfig
$sel:featurizationConfig:CreatePredictor' :: CreatePredictor -> FeaturizationConfig
featurizationConfig} -> FeaturizationConfig
featurizationConfig) (\s :: CreatePredictor
s@CreatePredictor' {} FeaturizationConfig
a -> CreatePredictor
s {$sel:featurizationConfig:CreatePredictor' :: FeaturizationConfig
featurizationConfig = FeaturizationConfig
a} :: CreatePredictor)

instance Core.AWSRequest CreatePredictor where
  type
    AWSResponse CreatePredictor =
      CreatePredictorResponse
  request :: CreatePredictor -> Request CreatePredictor
request = Service -> CreatePredictor -> Request CreatePredictor
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreatePredictor
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreatePredictor)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreatePredictor))
-> Logger
-> Service
-> Proxy CreatePredictor
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreatePredictor)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreatePredictorResponse
CreatePredictorResponse'
            (Maybe Text -> Int -> CreatePredictorResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreatePredictorResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PredictorArn")
            Either String (Int -> CreatePredictorResponse)
-> Either String Int -> Either String CreatePredictorResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreatePredictor

instance Prelude.NFData CreatePredictor

instance Core.ToHeaders CreatePredictor where
  toHeaders :: CreatePredictor -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreatePredictor -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonForecast.CreatePredictor" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreatePredictor where
  toJSON :: CreatePredictor -> Value
toJSON CreatePredictor' {Int
Maybe Bool
Maybe [Tag]
Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text Text)
Maybe AutoMLOverrideStrategy
Maybe EncryptionConfig
Maybe EvaluationParameters
Maybe OptimizationMetric
Maybe HyperParameterTuningJobConfig
Text
FeaturizationConfig
InputDataConfig
featurizationConfig :: FeaturizationConfig
inputDataConfig :: InputDataConfig
forecastHorizon :: Int
predictorName :: Text
tags :: Maybe [Tag]
performHPO :: Maybe Bool
forecastTypes :: Maybe (NonEmpty Text)
encryptionConfig :: Maybe EncryptionConfig
evaluationParameters :: Maybe EvaluationParameters
autoMLOverrideStrategy :: Maybe AutoMLOverrideStrategy
optimizationMetric :: Maybe OptimizationMetric
hPOConfig :: Maybe HyperParameterTuningJobConfig
algorithmArn :: Maybe Text
trainingParameters :: Maybe (HashMap Text Text)
performAutoML :: Maybe Bool
$sel:featurizationConfig:CreatePredictor' :: CreatePredictor -> FeaturizationConfig
$sel:inputDataConfig:CreatePredictor' :: CreatePredictor -> InputDataConfig
$sel:forecastHorizon:CreatePredictor' :: CreatePredictor -> Int
$sel:predictorName:CreatePredictor' :: CreatePredictor -> Text
$sel:tags:CreatePredictor' :: CreatePredictor -> Maybe [Tag]
$sel:performHPO:CreatePredictor' :: CreatePredictor -> Maybe Bool
$sel:forecastTypes:CreatePredictor' :: CreatePredictor -> Maybe (NonEmpty Text)
$sel:encryptionConfig:CreatePredictor' :: CreatePredictor -> Maybe EncryptionConfig
$sel:evaluationParameters:CreatePredictor' :: CreatePredictor -> Maybe EvaluationParameters
$sel:autoMLOverrideStrategy:CreatePredictor' :: CreatePredictor -> Maybe AutoMLOverrideStrategy
$sel:optimizationMetric:CreatePredictor' :: CreatePredictor -> Maybe OptimizationMetric
$sel:hPOConfig:CreatePredictor' :: CreatePredictor -> Maybe HyperParameterTuningJobConfig
$sel:algorithmArn:CreatePredictor' :: CreatePredictor -> Maybe Text
$sel:trainingParameters:CreatePredictor' :: CreatePredictor -> Maybe (HashMap Text Text)
$sel:performAutoML:CreatePredictor' :: CreatePredictor -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PerformAutoML" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
performAutoML,
            (Text
"TrainingParameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
trainingParameters,
            (Text
"AlgorithmArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
algorithmArn,
            (Text
"HPOConfig" Text -> HyperParameterTuningJobConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HyperParameterTuningJobConfig -> Pair)
-> Maybe HyperParameterTuningJobConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HyperParameterTuningJobConfig
hPOConfig,
            (Text
"OptimizationMetric" Text -> OptimizationMetric -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (OptimizationMetric -> Pair)
-> Maybe OptimizationMetric -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OptimizationMetric
optimizationMetric,
            (Text
"AutoMLOverrideStrategy" Text -> AutoMLOverrideStrategy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AutoMLOverrideStrategy -> Pair)
-> Maybe AutoMLOverrideStrategy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AutoMLOverrideStrategy
autoMLOverrideStrategy,
            (Text
"EvaluationParameters" Text -> EvaluationParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EvaluationParameters -> Pair)
-> Maybe EvaluationParameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EvaluationParameters
evaluationParameters,
            (Text
"EncryptionConfig" Text -> EncryptionConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EncryptionConfig -> Pair) -> Maybe EncryptionConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncryptionConfig
encryptionConfig,
            (Text
"ForecastTypes" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
forecastTypes,
            (Text
"PerformHPO" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
performHPO,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PredictorName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
predictorName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ForecastHorizon" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
forecastHorizon),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"InputDataConfig" Text -> InputDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InputDataConfig
inputDataConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"FeaturizationConfig" Text -> FeaturizationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FeaturizationConfig
featurizationConfig)
          ]
      )

instance Core.ToPath CreatePredictor where
  toPath :: CreatePredictor -> ByteString
toPath = ByteString -> CreatePredictor -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery CreatePredictor where
  toQuery :: CreatePredictor -> QueryString
toQuery = QueryString -> CreatePredictor -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreatePredictorResponse' smart constructor.
data CreatePredictorResponse = CreatePredictorResponse'
  { -- | The Amazon Resource Name (ARN) of the predictor.
    CreatePredictorResponse -> Maybe Text
predictorArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreatePredictorResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreatePredictorResponse -> CreatePredictorResponse -> Bool
(CreatePredictorResponse -> CreatePredictorResponse -> Bool)
-> (CreatePredictorResponse -> CreatePredictorResponse -> Bool)
-> Eq CreatePredictorResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreatePredictorResponse -> CreatePredictorResponse -> Bool
$c/= :: CreatePredictorResponse -> CreatePredictorResponse -> Bool
== :: CreatePredictorResponse -> CreatePredictorResponse -> Bool
$c== :: CreatePredictorResponse -> CreatePredictorResponse -> Bool
Prelude.Eq, ReadPrec [CreatePredictorResponse]
ReadPrec CreatePredictorResponse
Int -> ReadS CreatePredictorResponse
ReadS [CreatePredictorResponse]
(Int -> ReadS CreatePredictorResponse)
-> ReadS [CreatePredictorResponse]
-> ReadPrec CreatePredictorResponse
-> ReadPrec [CreatePredictorResponse]
-> Read CreatePredictorResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreatePredictorResponse]
$creadListPrec :: ReadPrec [CreatePredictorResponse]
readPrec :: ReadPrec CreatePredictorResponse
$creadPrec :: ReadPrec CreatePredictorResponse
readList :: ReadS [CreatePredictorResponse]
$creadList :: ReadS [CreatePredictorResponse]
readsPrec :: Int -> ReadS CreatePredictorResponse
$creadsPrec :: Int -> ReadS CreatePredictorResponse
Prelude.Read, Int -> CreatePredictorResponse -> ShowS
[CreatePredictorResponse] -> ShowS
CreatePredictorResponse -> String
(Int -> CreatePredictorResponse -> ShowS)
-> (CreatePredictorResponse -> String)
-> ([CreatePredictorResponse] -> ShowS)
-> Show CreatePredictorResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreatePredictorResponse] -> ShowS
$cshowList :: [CreatePredictorResponse] -> ShowS
show :: CreatePredictorResponse -> String
$cshow :: CreatePredictorResponse -> String
showsPrec :: Int -> CreatePredictorResponse -> ShowS
$cshowsPrec :: Int -> CreatePredictorResponse -> ShowS
Prelude.Show, (forall x.
 CreatePredictorResponse -> Rep CreatePredictorResponse x)
-> (forall x.
    Rep CreatePredictorResponse x -> CreatePredictorResponse)
-> Generic CreatePredictorResponse
forall x. Rep CreatePredictorResponse x -> CreatePredictorResponse
forall x. CreatePredictorResponse -> Rep CreatePredictorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreatePredictorResponse x -> CreatePredictorResponse
$cfrom :: forall x. CreatePredictorResponse -> Rep CreatePredictorResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreatePredictorResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'predictorArn', 'createPredictorResponse_predictorArn' - The Amazon Resource Name (ARN) of the predictor.
--
-- 'httpStatus', 'createPredictorResponse_httpStatus' - The response's http status code.
newCreatePredictorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreatePredictorResponse
newCreatePredictorResponse :: Int -> CreatePredictorResponse
newCreatePredictorResponse Int
pHttpStatus_ =
  CreatePredictorResponse' :: Maybe Text -> Int -> CreatePredictorResponse
CreatePredictorResponse'
    { $sel:predictorArn:CreatePredictorResponse' :: Maybe Text
predictorArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreatePredictorResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the predictor.
createPredictorResponse_predictorArn :: Lens.Lens' CreatePredictorResponse (Prelude.Maybe Prelude.Text)
createPredictorResponse_predictorArn :: (Maybe Text -> f (Maybe Text))
-> CreatePredictorResponse -> f CreatePredictorResponse
createPredictorResponse_predictorArn = (CreatePredictorResponse -> Maybe Text)
-> (CreatePredictorResponse
    -> Maybe Text -> CreatePredictorResponse)
-> Lens
     CreatePredictorResponse
     CreatePredictorResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictorResponse' {Maybe Text
predictorArn :: Maybe Text
$sel:predictorArn:CreatePredictorResponse' :: CreatePredictorResponse -> Maybe Text
predictorArn} -> Maybe Text
predictorArn) (\s :: CreatePredictorResponse
s@CreatePredictorResponse' {} Maybe Text
a -> CreatePredictorResponse
s {$sel:predictorArn:CreatePredictorResponse' :: Maybe Text
predictorArn = Maybe Text
a} :: CreatePredictorResponse)

-- | The response's http status code.
createPredictorResponse_httpStatus :: Lens.Lens' CreatePredictorResponse Prelude.Int
createPredictorResponse_httpStatus :: (Int -> f Int)
-> CreatePredictorResponse -> f CreatePredictorResponse
createPredictorResponse_httpStatus = (CreatePredictorResponse -> Int)
-> (CreatePredictorResponse -> Int -> CreatePredictorResponse)
-> Lens CreatePredictorResponse CreatePredictorResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreatePredictorResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreatePredictorResponse' :: CreatePredictorResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreatePredictorResponse
s@CreatePredictorResponse' {} Int
a -> CreatePredictorResponse
s {$sel:httpStatus:CreatePredictorResponse' :: Int
httpStatus = Int
a} :: CreatePredictorResponse)

instance Prelude.NFData CreatePredictorResponse