{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Forecast.Types.ErrorMetric where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ErrorMetric = ErrorMetric'
{
ErrorMetric -> Maybe Text
forecastType :: Prelude.Maybe Prelude.Text,
ErrorMetric -> Maybe Double
mape :: Prelude.Maybe Prelude.Double,
ErrorMetric -> Maybe Double
mase :: Prelude.Maybe Prelude.Double,
ErrorMetric -> Maybe Double
rmse :: Prelude.Maybe Prelude.Double,
ErrorMetric -> Maybe Double
wape :: Prelude.Maybe Prelude.Double
}
deriving (ErrorMetric -> ErrorMetric -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ErrorMetric -> ErrorMetric -> Bool
$c/= :: ErrorMetric -> ErrorMetric -> Bool
== :: ErrorMetric -> ErrorMetric -> Bool
$c== :: ErrorMetric -> ErrorMetric -> Bool
Prelude.Eq, ReadPrec [ErrorMetric]
ReadPrec ErrorMetric
Int -> ReadS ErrorMetric
ReadS [ErrorMetric]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ErrorMetric]
$creadListPrec :: ReadPrec [ErrorMetric]
readPrec :: ReadPrec ErrorMetric
$creadPrec :: ReadPrec ErrorMetric
readList :: ReadS [ErrorMetric]
$creadList :: ReadS [ErrorMetric]
readsPrec :: Int -> ReadS ErrorMetric
$creadsPrec :: Int -> ReadS ErrorMetric
Prelude.Read, Int -> ErrorMetric -> ShowS
[ErrorMetric] -> ShowS
ErrorMetric -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ErrorMetric] -> ShowS
$cshowList :: [ErrorMetric] -> ShowS
show :: ErrorMetric -> String
$cshow :: ErrorMetric -> String
showsPrec :: Int -> ErrorMetric -> ShowS
$cshowsPrec :: Int -> ErrorMetric -> ShowS
Prelude.Show, forall x. Rep ErrorMetric x -> ErrorMetric
forall x. ErrorMetric -> Rep ErrorMetric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ErrorMetric x -> ErrorMetric
$cfrom :: forall x. ErrorMetric -> Rep ErrorMetric x
Prelude.Generic)
newErrorMetric ::
ErrorMetric
newErrorMetric :: ErrorMetric
newErrorMetric =
ErrorMetric'
{ $sel:forecastType:ErrorMetric' :: Maybe Text
forecastType = forall a. Maybe a
Prelude.Nothing,
$sel:mape:ErrorMetric' :: Maybe Double
mape = forall a. Maybe a
Prelude.Nothing,
$sel:mase:ErrorMetric' :: Maybe Double
mase = forall a. Maybe a
Prelude.Nothing,
$sel:rmse:ErrorMetric' :: Maybe Double
rmse = forall a. Maybe a
Prelude.Nothing,
$sel:wape:ErrorMetric' :: Maybe Double
wape = forall a. Maybe a
Prelude.Nothing
}
errorMetric_forecastType :: Lens.Lens' ErrorMetric (Prelude.Maybe Prelude.Text)
errorMetric_forecastType :: Lens' ErrorMetric (Maybe Text)
errorMetric_forecastType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorMetric' {Maybe Text
forecastType :: Maybe Text
$sel:forecastType:ErrorMetric' :: ErrorMetric -> Maybe Text
forecastType} -> Maybe Text
forecastType) (\s :: ErrorMetric
s@ErrorMetric' {} Maybe Text
a -> ErrorMetric
s {$sel:forecastType:ErrorMetric' :: Maybe Text
forecastType = Maybe Text
a} :: ErrorMetric)
errorMetric_mape :: Lens.Lens' ErrorMetric (Prelude.Maybe Prelude.Double)
errorMetric_mape :: Lens' ErrorMetric (Maybe Double)
errorMetric_mape = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorMetric' {Maybe Double
mape :: Maybe Double
$sel:mape:ErrorMetric' :: ErrorMetric -> Maybe Double
mape} -> Maybe Double
mape) (\s :: ErrorMetric
s@ErrorMetric' {} Maybe Double
a -> ErrorMetric
s {$sel:mape:ErrorMetric' :: Maybe Double
mape = Maybe Double
a} :: ErrorMetric)
errorMetric_mase :: Lens.Lens' ErrorMetric (Prelude.Maybe Prelude.Double)
errorMetric_mase :: Lens' ErrorMetric (Maybe Double)
errorMetric_mase = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorMetric' {Maybe Double
mase :: Maybe Double
$sel:mase:ErrorMetric' :: ErrorMetric -> Maybe Double
mase} -> Maybe Double
mase) (\s :: ErrorMetric
s@ErrorMetric' {} Maybe Double
a -> ErrorMetric
s {$sel:mase:ErrorMetric' :: Maybe Double
mase = Maybe Double
a} :: ErrorMetric)
errorMetric_rmse :: Lens.Lens' ErrorMetric (Prelude.Maybe Prelude.Double)
errorMetric_rmse :: Lens' ErrorMetric (Maybe Double)
errorMetric_rmse = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorMetric' {Maybe Double
rmse :: Maybe Double
$sel:rmse:ErrorMetric' :: ErrorMetric -> Maybe Double
rmse} -> Maybe Double
rmse) (\s :: ErrorMetric
s@ErrorMetric' {} Maybe Double
a -> ErrorMetric
s {$sel:rmse:ErrorMetric' :: Maybe Double
rmse = Maybe Double
a} :: ErrorMetric)
errorMetric_wape :: Lens.Lens' ErrorMetric (Prelude.Maybe Prelude.Double)
errorMetric_wape :: Lens' ErrorMetric (Maybe Double)
errorMetric_wape = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ErrorMetric' {Maybe Double
wape :: Maybe Double
$sel:wape:ErrorMetric' :: ErrorMetric -> Maybe Double
wape} -> Maybe Double
wape) (\s :: ErrorMetric
s@ErrorMetric' {} Maybe Double
a -> ErrorMetric
s {$sel:wape:ErrorMetric' :: Maybe Double
wape = Maybe Double
a} :: ErrorMetric)
instance Data.FromJSON ErrorMetric where
parseJSON :: Value -> Parser ErrorMetric
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ErrorMetric"
( \Object
x ->
Maybe Text
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe Double
-> ErrorMetric
ErrorMetric'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ForecastType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MAPE")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MASE")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"RMSE")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"WAPE")
)
instance Prelude.Hashable ErrorMetric where
hashWithSalt :: Int -> ErrorMetric -> Int
hashWithSalt Int
_salt ErrorMetric' {Maybe Double
Maybe Text
wape :: Maybe Double
rmse :: Maybe Double
mase :: Maybe Double
mape :: Maybe Double
forecastType :: Maybe Text
$sel:wape:ErrorMetric' :: ErrorMetric -> Maybe Double
$sel:rmse:ErrorMetric' :: ErrorMetric -> Maybe Double
$sel:mase:ErrorMetric' :: ErrorMetric -> Maybe Double
$sel:mape:ErrorMetric' :: ErrorMetric -> Maybe Double
$sel:forecastType:ErrorMetric' :: ErrorMetric -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
forecastType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
mape
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
mase
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
rmse
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
wape
instance Prelude.NFData ErrorMetric where
rnf :: ErrorMetric -> ()
rnf ErrorMetric' {Maybe Double
Maybe Text
wape :: Maybe Double
rmse :: Maybe Double
mase :: Maybe Double
mape :: Maybe Double
forecastType :: Maybe Text
$sel:wape:ErrorMetric' :: ErrorMetric -> Maybe Double
$sel:rmse:ErrorMetric' :: ErrorMetric -> Maybe Double
$sel:mase:ErrorMetric' :: ErrorMetric -> Maybe Double
$sel:mape:ErrorMetric' :: ErrorMetric -> Maybe Double
$sel:forecastType:ErrorMetric' :: ErrorMetric -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
forecastType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
mape
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
mase
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
rmse
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
wape