{-# 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.FraudDetector.Types.TrainingMetrics where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FraudDetector.Types.MetricDataPoint
import qualified Amazonka.Prelude as Prelude
data TrainingMetrics = TrainingMetrics'
{
TrainingMetrics -> Maybe Double
auc :: Prelude.Maybe Prelude.Double,
TrainingMetrics -> Maybe [MetricDataPoint]
metricDataPoints :: Prelude.Maybe [MetricDataPoint]
}
deriving (TrainingMetrics -> TrainingMetrics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrainingMetrics -> TrainingMetrics -> Bool
$c/= :: TrainingMetrics -> TrainingMetrics -> Bool
== :: TrainingMetrics -> TrainingMetrics -> Bool
$c== :: TrainingMetrics -> TrainingMetrics -> Bool
Prelude.Eq, ReadPrec [TrainingMetrics]
ReadPrec TrainingMetrics
Int -> ReadS TrainingMetrics
ReadS [TrainingMetrics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrainingMetrics]
$creadListPrec :: ReadPrec [TrainingMetrics]
readPrec :: ReadPrec TrainingMetrics
$creadPrec :: ReadPrec TrainingMetrics
readList :: ReadS [TrainingMetrics]
$creadList :: ReadS [TrainingMetrics]
readsPrec :: Int -> ReadS TrainingMetrics
$creadsPrec :: Int -> ReadS TrainingMetrics
Prelude.Read, Int -> TrainingMetrics -> ShowS
[TrainingMetrics] -> ShowS
TrainingMetrics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrainingMetrics] -> ShowS
$cshowList :: [TrainingMetrics] -> ShowS
show :: TrainingMetrics -> String
$cshow :: TrainingMetrics -> String
showsPrec :: Int -> TrainingMetrics -> ShowS
$cshowsPrec :: Int -> TrainingMetrics -> ShowS
Prelude.Show, forall x. Rep TrainingMetrics x -> TrainingMetrics
forall x. TrainingMetrics -> Rep TrainingMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrainingMetrics x -> TrainingMetrics
$cfrom :: forall x. TrainingMetrics -> Rep TrainingMetrics x
Prelude.Generic)
newTrainingMetrics ::
TrainingMetrics
newTrainingMetrics :: TrainingMetrics
newTrainingMetrics =
TrainingMetrics'
{ $sel:auc:TrainingMetrics' :: Maybe Double
auc = forall a. Maybe a
Prelude.Nothing,
$sel:metricDataPoints:TrainingMetrics' :: Maybe [MetricDataPoint]
metricDataPoints = forall a. Maybe a
Prelude.Nothing
}
trainingMetrics_auc :: Lens.Lens' TrainingMetrics (Prelude.Maybe Prelude.Double)
trainingMetrics_auc :: Lens' TrainingMetrics (Maybe Double)
trainingMetrics_auc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrainingMetrics' {Maybe Double
auc :: Maybe Double
$sel:auc:TrainingMetrics' :: TrainingMetrics -> Maybe Double
auc} -> Maybe Double
auc) (\s :: TrainingMetrics
s@TrainingMetrics' {} Maybe Double
a -> TrainingMetrics
s {$sel:auc:TrainingMetrics' :: Maybe Double
auc = Maybe Double
a} :: TrainingMetrics)
trainingMetrics_metricDataPoints :: Lens.Lens' TrainingMetrics (Prelude.Maybe [MetricDataPoint])
trainingMetrics_metricDataPoints :: Lens' TrainingMetrics (Maybe [MetricDataPoint])
trainingMetrics_metricDataPoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrainingMetrics' {Maybe [MetricDataPoint]
metricDataPoints :: Maybe [MetricDataPoint]
$sel:metricDataPoints:TrainingMetrics' :: TrainingMetrics -> Maybe [MetricDataPoint]
metricDataPoints} -> Maybe [MetricDataPoint]
metricDataPoints) (\s :: TrainingMetrics
s@TrainingMetrics' {} Maybe [MetricDataPoint]
a -> TrainingMetrics
s {$sel:metricDataPoints:TrainingMetrics' :: Maybe [MetricDataPoint]
metricDataPoints = Maybe [MetricDataPoint]
a} :: TrainingMetrics) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON TrainingMetrics where
parseJSON :: Value -> Parser TrainingMetrics
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TrainingMetrics"
( \Object
x ->
Maybe Double -> Maybe [MetricDataPoint] -> TrainingMetrics
TrainingMetrics'
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
"auc")
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
"metricDataPoints"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable TrainingMetrics where
hashWithSalt :: Int -> TrainingMetrics -> Int
hashWithSalt Int
_salt TrainingMetrics' {Maybe Double
Maybe [MetricDataPoint]
metricDataPoints :: Maybe [MetricDataPoint]
auc :: Maybe Double
$sel:metricDataPoints:TrainingMetrics' :: TrainingMetrics -> Maybe [MetricDataPoint]
$sel:auc:TrainingMetrics' :: TrainingMetrics -> Maybe Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
auc
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [MetricDataPoint]
metricDataPoints
instance Prelude.NFData TrainingMetrics where
rnf :: TrainingMetrics -> ()
rnf TrainingMetrics' {Maybe Double
Maybe [MetricDataPoint]
metricDataPoints :: Maybe [MetricDataPoint]
auc :: Maybe Double
$sel:metricDataPoints:TrainingMetrics' :: TrainingMetrics -> Maybe [MetricDataPoint]
$sel:auc:TrainingMetrics' :: TrainingMetrics -> Maybe Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
auc
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [MetricDataPoint]
metricDataPoints