{-# 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.Glue.Types.ConfusionMatrix where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConfusionMatrix = ConfusionMatrix'
{
ConfusionMatrix -> Maybe Integer
numTrueNegatives :: Prelude.Maybe Prelude.Integer,
ConfusionMatrix -> Maybe Integer
numFalseNegatives :: Prelude.Maybe Prelude.Integer,
ConfusionMatrix -> Maybe Integer
numTruePositives :: Prelude.Maybe Prelude.Integer,
ConfusionMatrix -> Maybe Integer
numFalsePositives :: Prelude.Maybe Prelude.Integer
}
deriving (ConfusionMatrix -> ConfusionMatrix -> Bool
(ConfusionMatrix -> ConfusionMatrix -> Bool)
-> (ConfusionMatrix -> ConfusionMatrix -> Bool)
-> Eq ConfusionMatrix
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfusionMatrix -> ConfusionMatrix -> Bool
$c/= :: ConfusionMatrix -> ConfusionMatrix -> Bool
== :: ConfusionMatrix -> ConfusionMatrix -> Bool
$c== :: ConfusionMatrix -> ConfusionMatrix -> Bool
Prelude.Eq, ReadPrec [ConfusionMatrix]
ReadPrec ConfusionMatrix
Int -> ReadS ConfusionMatrix
ReadS [ConfusionMatrix]
(Int -> ReadS ConfusionMatrix)
-> ReadS [ConfusionMatrix]
-> ReadPrec ConfusionMatrix
-> ReadPrec [ConfusionMatrix]
-> Read ConfusionMatrix
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfusionMatrix]
$creadListPrec :: ReadPrec [ConfusionMatrix]
readPrec :: ReadPrec ConfusionMatrix
$creadPrec :: ReadPrec ConfusionMatrix
readList :: ReadS [ConfusionMatrix]
$creadList :: ReadS [ConfusionMatrix]
readsPrec :: Int -> ReadS ConfusionMatrix
$creadsPrec :: Int -> ReadS ConfusionMatrix
Prelude.Read, Int -> ConfusionMatrix -> ShowS
[ConfusionMatrix] -> ShowS
ConfusionMatrix -> String
(Int -> ConfusionMatrix -> ShowS)
-> (ConfusionMatrix -> String)
-> ([ConfusionMatrix] -> ShowS)
-> Show ConfusionMatrix
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfusionMatrix] -> ShowS
$cshowList :: [ConfusionMatrix] -> ShowS
show :: ConfusionMatrix -> String
$cshow :: ConfusionMatrix -> String
showsPrec :: Int -> ConfusionMatrix -> ShowS
$cshowsPrec :: Int -> ConfusionMatrix -> ShowS
Prelude.Show, (forall x. ConfusionMatrix -> Rep ConfusionMatrix x)
-> (forall x. Rep ConfusionMatrix x -> ConfusionMatrix)
-> Generic ConfusionMatrix
forall x. Rep ConfusionMatrix x -> ConfusionMatrix
forall x. ConfusionMatrix -> Rep ConfusionMatrix x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfusionMatrix x -> ConfusionMatrix
$cfrom :: forall x. ConfusionMatrix -> Rep ConfusionMatrix x
Prelude.Generic)
newConfusionMatrix ::
ConfusionMatrix
newConfusionMatrix :: ConfusionMatrix
newConfusionMatrix =
ConfusionMatrix' :: Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> ConfusionMatrix
ConfusionMatrix'
{ $sel:numTrueNegatives:ConfusionMatrix' :: Maybe Integer
numTrueNegatives =
Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:numFalseNegatives:ConfusionMatrix' :: Maybe Integer
numFalseNegatives = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:numTruePositives:ConfusionMatrix' :: Maybe Integer
numTruePositives = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:numFalsePositives:ConfusionMatrix' :: Maybe Integer
numFalsePositives = Maybe Integer
forall a. Maybe a
Prelude.Nothing
}
confusionMatrix_numTrueNegatives :: Lens.Lens' ConfusionMatrix (Prelude.Maybe Prelude.Integer)
confusionMatrix_numTrueNegatives :: (Maybe Integer -> f (Maybe Integer))
-> ConfusionMatrix -> f ConfusionMatrix
confusionMatrix_numTrueNegatives = (ConfusionMatrix -> Maybe Integer)
-> (ConfusionMatrix -> Maybe Integer -> ConfusionMatrix)
-> Lens
ConfusionMatrix ConfusionMatrix (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfusionMatrix' {Maybe Integer
numTrueNegatives :: Maybe Integer
$sel:numTrueNegatives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
numTrueNegatives} -> Maybe Integer
numTrueNegatives) (\s :: ConfusionMatrix
s@ConfusionMatrix' {} Maybe Integer
a -> ConfusionMatrix
s {$sel:numTrueNegatives:ConfusionMatrix' :: Maybe Integer
numTrueNegatives = Maybe Integer
a} :: ConfusionMatrix)
confusionMatrix_numFalseNegatives :: Lens.Lens' ConfusionMatrix (Prelude.Maybe Prelude.Integer)
confusionMatrix_numFalseNegatives :: (Maybe Integer -> f (Maybe Integer))
-> ConfusionMatrix -> f ConfusionMatrix
confusionMatrix_numFalseNegatives = (ConfusionMatrix -> Maybe Integer)
-> (ConfusionMatrix -> Maybe Integer -> ConfusionMatrix)
-> Lens
ConfusionMatrix ConfusionMatrix (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfusionMatrix' {Maybe Integer
numFalseNegatives :: Maybe Integer
$sel:numFalseNegatives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
numFalseNegatives} -> Maybe Integer
numFalseNegatives) (\s :: ConfusionMatrix
s@ConfusionMatrix' {} Maybe Integer
a -> ConfusionMatrix
s {$sel:numFalseNegatives:ConfusionMatrix' :: Maybe Integer
numFalseNegatives = Maybe Integer
a} :: ConfusionMatrix)
confusionMatrix_numTruePositives :: Lens.Lens' ConfusionMatrix (Prelude.Maybe Prelude.Integer)
confusionMatrix_numTruePositives :: (Maybe Integer -> f (Maybe Integer))
-> ConfusionMatrix -> f ConfusionMatrix
confusionMatrix_numTruePositives = (ConfusionMatrix -> Maybe Integer)
-> (ConfusionMatrix -> Maybe Integer -> ConfusionMatrix)
-> Lens
ConfusionMatrix ConfusionMatrix (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfusionMatrix' {Maybe Integer
numTruePositives :: Maybe Integer
$sel:numTruePositives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
numTruePositives} -> Maybe Integer
numTruePositives) (\s :: ConfusionMatrix
s@ConfusionMatrix' {} Maybe Integer
a -> ConfusionMatrix
s {$sel:numTruePositives:ConfusionMatrix' :: Maybe Integer
numTruePositives = Maybe Integer
a} :: ConfusionMatrix)
confusionMatrix_numFalsePositives :: Lens.Lens' ConfusionMatrix (Prelude.Maybe Prelude.Integer)
confusionMatrix_numFalsePositives :: (Maybe Integer -> f (Maybe Integer))
-> ConfusionMatrix -> f ConfusionMatrix
confusionMatrix_numFalsePositives = (ConfusionMatrix -> Maybe Integer)
-> (ConfusionMatrix -> Maybe Integer -> ConfusionMatrix)
-> Lens
ConfusionMatrix ConfusionMatrix (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfusionMatrix' {Maybe Integer
numFalsePositives :: Maybe Integer
$sel:numFalsePositives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
numFalsePositives} -> Maybe Integer
numFalsePositives) (\s :: ConfusionMatrix
s@ConfusionMatrix' {} Maybe Integer
a -> ConfusionMatrix
s {$sel:numFalsePositives:ConfusionMatrix' :: Maybe Integer
numFalsePositives = Maybe Integer
a} :: ConfusionMatrix)
instance Core.FromJSON ConfusionMatrix where
parseJSON :: Value -> Parser ConfusionMatrix
parseJSON =
String
-> (Object -> Parser ConfusionMatrix)
-> Value
-> Parser ConfusionMatrix
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ConfusionMatrix"
( \Object
x ->
Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> ConfusionMatrix
ConfusionMatrix'
(Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> ConfusionMatrix)
-> Parser (Maybe Integer)
-> Parser
(Maybe Integer
-> Maybe Integer -> Maybe Integer -> ConfusionMatrix)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumTrueNegatives")
Parser
(Maybe Integer
-> Maybe Integer -> Maybe Integer -> ConfusionMatrix)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> Maybe Integer -> ConfusionMatrix)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumFalseNegatives")
Parser (Maybe Integer -> Maybe Integer -> ConfusionMatrix)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> ConfusionMatrix)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumTruePositives")
Parser (Maybe Integer -> ConfusionMatrix)
-> Parser (Maybe Integer) -> Parser ConfusionMatrix
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumFalsePositives")
)
instance Prelude.Hashable ConfusionMatrix
instance Prelude.NFData ConfusionMatrix