{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ConfusionMatrix = ConfusionMatrix'
{
ConfusionMatrix -> Maybe Integer
numFalseNegatives :: Prelude.Maybe Prelude.Integer,
ConfusionMatrix -> Maybe Integer
numFalsePositives :: Prelude.Maybe Prelude.Integer,
ConfusionMatrix -> Maybe Integer
numTrueNegatives :: Prelude.Maybe Prelude.Integer,
ConfusionMatrix -> Maybe Integer
numTruePositives :: Prelude.Maybe Prelude.Integer
}
deriving (ConfusionMatrix -> ConfusionMatrix -> Bool
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]
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
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. 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'
{ $sel:numFalseNegatives:ConfusionMatrix' :: Maybe Integer
numFalseNegatives =
forall a. Maybe a
Prelude.Nothing,
$sel:numFalsePositives:ConfusionMatrix' :: Maybe Integer
numFalsePositives = forall a. Maybe a
Prelude.Nothing,
$sel:numTrueNegatives:ConfusionMatrix' :: Maybe Integer
numTrueNegatives = forall a. Maybe a
Prelude.Nothing,
$sel:numTruePositives:ConfusionMatrix' :: Maybe Integer
numTruePositives = forall a. Maybe a
Prelude.Nothing
}
confusionMatrix_numFalseNegatives :: Lens.Lens' ConfusionMatrix (Prelude.Maybe Prelude.Integer)
confusionMatrix_numFalseNegatives :: Lens' ConfusionMatrix (Maybe Integer)
confusionMatrix_numFalseNegatives = 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_numFalsePositives :: Lens.Lens' ConfusionMatrix (Prelude.Maybe Prelude.Integer)
confusionMatrix_numFalsePositives :: Lens' ConfusionMatrix (Maybe Integer)
confusionMatrix_numFalsePositives = 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)
confusionMatrix_numTrueNegatives :: Lens.Lens' ConfusionMatrix (Prelude.Maybe Prelude.Integer)
confusionMatrix_numTrueNegatives :: Lens' ConfusionMatrix (Maybe Integer)
confusionMatrix_numTrueNegatives = 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_numTruePositives :: Lens.Lens' ConfusionMatrix (Prelude.Maybe Prelude.Integer)
confusionMatrix_numTruePositives :: Lens' ConfusionMatrix (Maybe Integer)
confusionMatrix_numTruePositives = 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)
instance Data.FromJSON ConfusionMatrix where
parseJSON :: Value -> Parser ConfusionMatrix
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ConfusionMatrix"
( \Object
x ->
Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> ConfusionMatrix
ConfusionMatrix'
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
"NumFalseNegatives")
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
"NumFalsePositives")
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
"NumTrueNegatives")
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
"NumTruePositives")
)
instance Prelude.Hashable ConfusionMatrix where
hashWithSalt :: Int -> ConfusionMatrix -> Int
hashWithSalt Int
_salt ConfusionMatrix' {Maybe Integer
numTruePositives :: Maybe Integer
numTrueNegatives :: Maybe Integer
numFalsePositives :: Maybe Integer
numFalseNegatives :: Maybe Integer
$sel:numTruePositives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
$sel:numTrueNegatives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
$sel:numFalsePositives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
$sel:numFalseNegatives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
numFalseNegatives
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
numFalsePositives
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
numTrueNegatives
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
numTruePositives
instance Prelude.NFData ConfusionMatrix where
rnf :: ConfusionMatrix -> ()
rnf ConfusionMatrix' {Maybe Integer
numTruePositives :: Maybe Integer
numTrueNegatives :: Maybe Integer
numFalsePositives :: Maybe Integer
numFalseNegatives :: Maybe Integer
$sel:numTruePositives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
$sel:numTrueNegatives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
$sel:numFalsePositives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
$sel:numFalseNegatives:ConfusionMatrix' :: ConfusionMatrix -> Maybe Integer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
numFalseNegatives
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
numFalsePositives
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
numTrueNegatives
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
numTruePositives