{-# 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.TrainingResult where
import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.Types.DataValidationMetrics
import Amazonka.FraudDetector.Types.TrainingMetrics
import Amazonka.FraudDetector.Types.VariableImportanceMetrics
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TrainingResult = TrainingResult'
{
TrainingResult -> Maybe DataValidationMetrics
dataValidationMetrics :: Prelude.Maybe DataValidationMetrics,
TrainingResult -> Maybe TrainingMetrics
trainingMetrics :: Prelude.Maybe TrainingMetrics,
TrainingResult -> Maybe VariableImportanceMetrics
variableImportanceMetrics :: Prelude.Maybe VariableImportanceMetrics
}
deriving (TrainingResult -> TrainingResult -> Bool
(TrainingResult -> TrainingResult -> Bool)
-> (TrainingResult -> TrainingResult -> Bool) -> Eq TrainingResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrainingResult -> TrainingResult -> Bool
$c/= :: TrainingResult -> TrainingResult -> Bool
== :: TrainingResult -> TrainingResult -> Bool
$c== :: TrainingResult -> TrainingResult -> Bool
Prelude.Eq, ReadPrec [TrainingResult]
ReadPrec TrainingResult
Int -> ReadS TrainingResult
ReadS [TrainingResult]
(Int -> ReadS TrainingResult)
-> ReadS [TrainingResult]
-> ReadPrec TrainingResult
-> ReadPrec [TrainingResult]
-> Read TrainingResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrainingResult]
$creadListPrec :: ReadPrec [TrainingResult]
readPrec :: ReadPrec TrainingResult
$creadPrec :: ReadPrec TrainingResult
readList :: ReadS [TrainingResult]
$creadList :: ReadS [TrainingResult]
readsPrec :: Int -> ReadS TrainingResult
$creadsPrec :: Int -> ReadS TrainingResult
Prelude.Read, Int -> TrainingResult -> ShowS
[TrainingResult] -> ShowS
TrainingResult -> String
(Int -> TrainingResult -> ShowS)
-> (TrainingResult -> String)
-> ([TrainingResult] -> ShowS)
-> Show TrainingResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrainingResult] -> ShowS
$cshowList :: [TrainingResult] -> ShowS
show :: TrainingResult -> String
$cshow :: TrainingResult -> String
showsPrec :: Int -> TrainingResult -> ShowS
$cshowsPrec :: Int -> TrainingResult -> ShowS
Prelude.Show, (forall x. TrainingResult -> Rep TrainingResult x)
-> (forall x. Rep TrainingResult x -> TrainingResult)
-> Generic TrainingResult
forall x. Rep TrainingResult x -> TrainingResult
forall x. TrainingResult -> Rep TrainingResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrainingResult x -> TrainingResult
$cfrom :: forall x. TrainingResult -> Rep TrainingResult x
Prelude.Generic)
newTrainingResult ::
TrainingResult
newTrainingResult :: TrainingResult
newTrainingResult =
TrainingResult' :: Maybe DataValidationMetrics
-> Maybe TrainingMetrics
-> Maybe VariableImportanceMetrics
-> TrainingResult
TrainingResult'
{ $sel:dataValidationMetrics:TrainingResult' :: Maybe DataValidationMetrics
dataValidationMetrics =
Maybe DataValidationMetrics
forall a. Maybe a
Prelude.Nothing,
$sel:trainingMetrics:TrainingResult' :: Maybe TrainingMetrics
trainingMetrics = Maybe TrainingMetrics
forall a. Maybe a
Prelude.Nothing,
$sel:variableImportanceMetrics:TrainingResult' :: Maybe VariableImportanceMetrics
variableImportanceMetrics = Maybe VariableImportanceMetrics
forall a. Maybe a
Prelude.Nothing
}
trainingResult_dataValidationMetrics :: Lens.Lens' TrainingResult (Prelude.Maybe DataValidationMetrics)
trainingResult_dataValidationMetrics :: (Maybe DataValidationMetrics -> f (Maybe DataValidationMetrics))
-> TrainingResult -> f TrainingResult
trainingResult_dataValidationMetrics = (TrainingResult -> Maybe DataValidationMetrics)
-> (TrainingResult
-> Maybe DataValidationMetrics -> TrainingResult)
-> Lens
TrainingResult
TrainingResult
(Maybe DataValidationMetrics)
(Maybe DataValidationMetrics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrainingResult' {Maybe DataValidationMetrics
dataValidationMetrics :: Maybe DataValidationMetrics
$sel:dataValidationMetrics:TrainingResult' :: TrainingResult -> Maybe DataValidationMetrics
dataValidationMetrics} -> Maybe DataValidationMetrics
dataValidationMetrics) (\s :: TrainingResult
s@TrainingResult' {} Maybe DataValidationMetrics
a -> TrainingResult
s {$sel:dataValidationMetrics:TrainingResult' :: Maybe DataValidationMetrics
dataValidationMetrics = Maybe DataValidationMetrics
a} :: TrainingResult)
trainingResult_trainingMetrics :: Lens.Lens' TrainingResult (Prelude.Maybe TrainingMetrics)
trainingResult_trainingMetrics :: (Maybe TrainingMetrics -> f (Maybe TrainingMetrics))
-> TrainingResult -> f TrainingResult
trainingResult_trainingMetrics = (TrainingResult -> Maybe TrainingMetrics)
-> (TrainingResult -> Maybe TrainingMetrics -> TrainingResult)
-> Lens
TrainingResult
TrainingResult
(Maybe TrainingMetrics)
(Maybe TrainingMetrics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrainingResult' {Maybe TrainingMetrics
trainingMetrics :: Maybe TrainingMetrics
$sel:trainingMetrics:TrainingResult' :: TrainingResult -> Maybe TrainingMetrics
trainingMetrics} -> Maybe TrainingMetrics
trainingMetrics) (\s :: TrainingResult
s@TrainingResult' {} Maybe TrainingMetrics
a -> TrainingResult
s {$sel:trainingMetrics:TrainingResult' :: Maybe TrainingMetrics
trainingMetrics = Maybe TrainingMetrics
a} :: TrainingResult)
trainingResult_variableImportanceMetrics :: Lens.Lens' TrainingResult (Prelude.Maybe VariableImportanceMetrics)
trainingResult_variableImportanceMetrics :: (Maybe VariableImportanceMetrics
-> f (Maybe VariableImportanceMetrics))
-> TrainingResult -> f TrainingResult
trainingResult_variableImportanceMetrics = (TrainingResult -> Maybe VariableImportanceMetrics)
-> (TrainingResult
-> Maybe VariableImportanceMetrics -> TrainingResult)
-> Lens
TrainingResult
TrainingResult
(Maybe VariableImportanceMetrics)
(Maybe VariableImportanceMetrics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrainingResult' {Maybe VariableImportanceMetrics
variableImportanceMetrics :: Maybe VariableImportanceMetrics
$sel:variableImportanceMetrics:TrainingResult' :: TrainingResult -> Maybe VariableImportanceMetrics
variableImportanceMetrics} -> Maybe VariableImportanceMetrics
variableImportanceMetrics) (\s :: TrainingResult
s@TrainingResult' {} Maybe VariableImportanceMetrics
a -> TrainingResult
s {$sel:variableImportanceMetrics:TrainingResult' :: Maybe VariableImportanceMetrics
variableImportanceMetrics = Maybe VariableImportanceMetrics
a} :: TrainingResult)
instance Core.FromJSON TrainingResult where
parseJSON :: Value -> Parser TrainingResult
parseJSON =
String
-> (Object -> Parser TrainingResult)
-> Value
-> Parser TrainingResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TrainingResult"
( \Object
x ->
Maybe DataValidationMetrics
-> Maybe TrainingMetrics
-> Maybe VariableImportanceMetrics
-> TrainingResult
TrainingResult'
(Maybe DataValidationMetrics
-> Maybe TrainingMetrics
-> Maybe VariableImportanceMetrics
-> TrainingResult)
-> Parser (Maybe DataValidationMetrics)
-> Parser
(Maybe TrainingMetrics
-> Maybe VariableImportanceMetrics -> TrainingResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DataValidationMetrics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"dataValidationMetrics")
Parser
(Maybe TrainingMetrics
-> Maybe VariableImportanceMetrics -> TrainingResult)
-> Parser (Maybe TrainingMetrics)
-> Parser (Maybe VariableImportanceMetrics -> TrainingResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TrainingMetrics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"trainingMetrics")
Parser (Maybe VariableImportanceMetrics -> TrainingResult)
-> Parser (Maybe VariableImportanceMetrics)
-> Parser TrainingResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VariableImportanceMetrics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"variableImportanceMetrics")
)
instance Prelude.Hashable TrainingResult
instance Prelude.NFData TrainingResult