{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.FraudDetector.Types.TFIModelPerformance
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.FraudDetector.Types.TFIModelPerformance 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

-- | The Transaction Fraud Insights (TFI) model performance score.
--
-- /See:/ 'newTFIModelPerformance' smart constructor.
data TFIModelPerformance = TFIModelPerformance'
  { -- | The area under the curve (auc). This summarizes the total positive rate
    -- (tpr) and false positive rate (FPR) across all possible model score
    -- thresholds.
    TFIModelPerformance -> Maybe Double
auc :: Prelude.Maybe Prelude.Double
  }
  deriving (TFIModelPerformance -> TFIModelPerformance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TFIModelPerformance -> TFIModelPerformance -> Bool
$c/= :: TFIModelPerformance -> TFIModelPerformance -> Bool
== :: TFIModelPerformance -> TFIModelPerformance -> Bool
$c== :: TFIModelPerformance -> TFIModelPerformance -> Bool
Prelude.Eq, ReadPrec [TFIModelPerformance]
ReadPrec TFIModelPerformance
Int -> ReadS TFIModelPerformance
ReadS [TFIModelPerformance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TFIModelPerformance]
$creadListPrec :: ReadPrec [TFIModelPerformance]
readPrec :: ReadPrec TFIModelPerformance
$creadPrec :: ReadPrec TFIModelPerformance
readList :: ReadS [TFIModelPerformance]
$creadList :: ReadS [TFIModelPerformance]
readsPrec :: Int -> ReadS TFIModelPerformance
$creadsPrec :: Int -> ReadS TFIModelPerformance
Prelude.Read, Int -> TFIModelPerformance -> ShowS
[TFIModelPerformance] -> ShowS
TFIModelPerformance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TFIModelPerformance] -> ShowS
$cshowList :: [TFIModelPerformance] -> ShowS
show :: TFIModelPerformance -> String
$cshow :: TFIModelPerformance -> String
showsPrec :: Int -> TFIModelPerformance -> ShowS
$cshowsPrec :: Int -> TFIModelPerformance -> ShowS
Prelude.Show, forall x. Rep TFIModelPerformance x -> TFIModelPerformance
forall x. TFIModelPerformance -> Rep TFIModelPerformance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TFIModelPerformance x -> TFIModelPerformance
$cfrom :: forall x. TFIModelPerformance -> Rep TFIModelPerformance x
Prelude.Generic)

-- |
-- Create a value of 'TFIModelPerformance' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'auc', 'tFIModelPerformance_auc' - The area under the curve (auc). This summarizes the total positive rate
-- (tpr) and false positive rate (FPR) across all possible model score
-- thresholds.
newTFIModelPerformance ::
  TFIModelPerformance
newTFIModelPerformance :: TFIModelPerformance
newTFIModelPerformance =
  TFIModelPerformance' {$sel:auc:TFIModelPerformance' :: Maybe Double
auc = forall a. Maybe a
Prelude.Nothing}

-- | The area under the curve (auc). This summarizes the total positive rate
-- (tpr) and false positive rate (FPR) across all possible model score
-- thresholds.
tFIModelPerformance_auc :: Lens.Lens' TFIModelPerformance (Prelude.Maybe Prelude.Double)
tFIModelPerformance_auc :: Lens' TFIModelPerformance (Maybe Double)
tFIModelPerformance_auc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TFIModelPerformance' {Maybe Double
auc :: Maybe Double
$sel:auc:TFIModelPerformance' :: TFIModelPerformance -> Maybe Double
auc} -> Maybe Double
auc) (\s :: TFIModelPerformance
s@TFIModelPerformance' {} Maybe Double
a -> TFIModelPerformance
s {$sel:auc:TFIModelPerformance' :: Maybe Double
auc = Maybe Double
a} :: TFIModelPerformance)

instance Data.FromJSON TFIModelPerformance where
  parseJSON :: Value -> Parser TFIModelPerformance
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TFIModelPerformance"
      ( \Object
x ->
          Maybe Double -> TFIModelPerformance
TFIModelPerformance' 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")
      )

instance Prelude.Hashable TFIModelPerformance where
  hashWithSalt :: Int -> TFIModelPerformance -> Int
hashWithSalt Int
_salt TFIModelPerformance' {Maybe Double
auc :: Maybe Double
$sel:auc:TFIModelPerformance' :: TFIModelPerformance -> Maybe Double
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
auc

instance Prelude.NFData TFIModelPerformance where
  rnf :: TFIModelPerformance -> ()
rnf TFIModelPerformance' {Maybe Double
auc :: Maybe Double
$sel:auc:TFIModelPerformance' :: TFIModelPerformance -> Maybe Double
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
auc