{-# 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.ATIModelPerformance
-- 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.ATIModelPerformance 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 Account Takeover Insights (ATI) model performance score.
--
-- /See:/ 'newATIModelPerformance' smart constructor.
data ATIModelPerformance = ATIModelPerformance'
  { -- | The anomaly separation index (ASI) score. This metric summarizes the
    -- overall ability of the model to separate anomalous activities from the
    -- normal behavior. Depending on the business, a large fraction of these
    -- anomalous activities can be malicious and correspond to the account
    -- takeover attacks. A model with no separability power will have the
    -- lowest possible ASI score of 0.5, whereas the a model with a high
    -- separability power will have the highest possible ASI score of 1.0
    ATIModelPerformance -> Maybe Double
asi :: Prelude.Maybe Prelude.Double
  }
  deriving (ATIModelPerformance -> ATIModelPerformance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ATIModelPerformance -> ATIModelPerformance -> Bool
$c/= :: ATIModelPerformance -> ATIModelPerformance -> Bool
== :: ATIModelPerformance -> ATIModelPerformance -> Bool
$c== :: ATIModelPerformance -> ATIModelPerformance -> Bool
Prelude.Eq, ReadPrec [ATIModelPerformance]
ReadPrec ATIModelPerformance
Int -> ReadS ATIModelPerformance
ReadS [ATIModelPerformance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ATIModelPerformance]
$creadListPrec :: ReadPrec [ATIModelPerformance]
readPrec :: ReadPrec ATIModelPerformance
$creadPrec :: ReadPrec ATIModelPerformance
readList :: ReadS [ATIModelPerformance]
$creadList :: ReadS [ATIModelPerformance]
readsPrec :: Int -> ReadS ATIModelPerformance
$creadsPrec :: Int -> ReadS ATIModelPerformance
Prelude.Read, Int -> ATIModelPerformance -> ShowS
[ATIModelPerformance] -> ShowS
ATIModelPerformance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ATIModelPerformance] -> ShowS
$cshowList :: [ATIModelPerformance] -> ShowS
show :: ATIModelPerformance -> String
$cshow :: ATIModelPerformance -> String
showsPrec :: Int -> ATIModelPerformance -> ShowS
$cshowsPrec :: Int -> ATIModelPerformance -> ShowS
Prelude.Show, forall x. Rep ATIModelPerformance x -> ATIModelPerformance
forall x. ATIModelPerformance -> Rep ATIModelPerformance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ATIModelPerformance x -> ATIModelPerformance
$cfrom :: forall x. ATIModelPerformance -> Rep ATIModelPerformance x
Prelude.Generic)

-- |
-- Create a value of 'ATIModelPerformance' 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:
--
-- 'asi', 'aTIModelPerformance_asi' - The anomaly separation index (ASI) score. This metric summarizes the
-- overall ability of the model to separate anomalous activities from the
-- normal behavior. Depending on the business, a large fraction of these
-- anomalous activities can be malicious and correspond to the account
-- takeover attacks. A model with no separability power will have the
-- lowest possible ASI score of 0.5, whereas the a model with a high
-- separability power will have the highest possible ASI score of 1.0
newATIModelPerformance ::
  ATIModelPerformance
newATIModelPerformance :: ATIModelPerformance
newATIModelPerformance =
  ATIModelPerformance' {$sel:asi:ATIModelPerformance' :: Maybe Double
asi = forall a. Maybe a
Prelude.Nothing}

-- | The anomaly separation index (ASI) score. This metric summarizes the
-- overall ability of the model to separate anomalous activities from the
-- normal behavior. Depending on the business, a large fraction of these
-- anomalous activities can be malicious and correspond to the account
-- takeover attacks. A model with no separability power will have the
-- lowest possible ASI score of 0.5, whereas the a model with a high
-- separability power will have the highest possible ASI score of 1.0
aTIModelPerformance_asi :: Lens.Lens' ATIModelPerformance (Prelude.Maybe Prelude.Double)
aTIModelPerformance_asi :: Lens' ATIModelPerformance (Maybe Double)
aTIModelPerformance_asi = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ATIModelPerformance' {Maybe Double
asi :: Maybe Double
$sel:asi:ATIModelPerformance' :: ATIModelPerformance -> Maybe Double
asi} -> Maybe Double
asi) (\s :: ATIModelPerformance
s@ATIModelPerformance' {} Maybe Double
a -> ATIModelPerformance
s {$sel:asi:ATIModelPerformance' :: Maybe Double
asi = Maybe Double
a} :: ATIModelPerformance)

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

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

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