{-# 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.Glue.Types.EvaluationMetrics
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Glue.Types.EvaluationMetrics where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.FindMatchesMetrics
import Amazonka.Glue.Types.TransformType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Evaluation metrics provide an estimate of the quality of your machine
-- learning transform.
--
-- /See:/ 'newEvaluationMetrics' smart constructor.
data EvaluationMetrics = EvaluationMetrics'
  { -- | The evaluation metrics for the find matches algorithm.
    EvaluationMetrics -> Maybe FindMatchesMetrics
findMatchesMetrics :: Prelude.Maybe FindMatchesMetrics,
    -- | The type of machine learning transform.
    EvaluationMetrics -> TransformType
transformType :: TransformType
  }
  deriving (EvaluationMetrics -> EvaluationMetrics -> Bool
(EvaluationMetrics -> EvaluationMetrics -> Bool)
-> (EvaluationMetrics -> EvaluationMetrics -> Bool)
-> Eq EvaluationMetrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EvaluationMetrics -> EvaluationMetrics -> Bool
$c/= :: EvaluationMetrics -> EvaluationMetrics -> Bool
== :: EvaluationMetrics -> EvaluationMetrics -> Bool
$c== :: EvaluationMetrics -> EvaluationMetrics -> Bool
Prelude.Eq, ReadPrec [EvaluationMetrics]
ReadPrec EvaluationMetrics
Int -> ReadS EvaluationMetrics
ReadS [EvaluationMetrics]
(Int -> ReadS EvaluationMetrics)
-> ReadS [EvaluationMetrics]
-> ReadPrec EvaluationMetrics
-> ReadPrec [EvaluationMetrics]
-> Read EvaluationMetrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EvaluationMetrics]
$creadListPrec :: ReadPrec [EvaluationMetrics]
readPrec :: ReadPrec EvaluationMetrics
$creadPrec :: ReadPrec EvaluationMetrics
readList :: ReadS [EvaluationMetrics]
$creadList :: ReadS [EvaluationMetrics]
readsPrec :: Int -> ReadS EvaluationMetrics
$creadsPrec :: Int -> ReadS EvaluationMetrics
Prelude.Read, Int -> EvaluationMetrics -> ShowS
[EvaluationMetrics] -> ShowS
EvaluationMetrics -> String
(Int -> EvaluationMetrics -> ShowS)
-> (EvaluationMetrics -> String)
-> ([EvaluationMetrics] -> ShowS)
-> Show EvaluationMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EvaluationMetrics] -> ShowS
$cshowList :: [EvaluationMetrics] -> ShowS
show :: EvaluationMetrics -> String
$cshow :: EvaluationMetrics -> String
showsPrec :: Int -> EvaluationMetrics -> ShowS
$cshowsPrec :: Int -> EvaluationMetrics -> ShowS
Prelude.Show, (forall x. EvaluationMetrics -> Rep EvaluationMetrics x)
-> (forall x. Rep EvaluationMetrics x -> EvaluationMetrics)
-> Generic EvaluationMetrics
forall x. Rep EvaluationMetrics x -> EvaluationMetrics
forall x. EvaluationMetrics -> Rep EvaluationMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EvaluationMetrics x -> EvaluationMetrics
$cfrom :: forall x. EvaluationMetrics -> Rep EvaluationMetrics x
Prelude.Generic)

-- |
-- Create a value of 'EvaluationMetrics' 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:
--
-- 'findMatchesMetrics', 'evaluationMetrics_findMatchesMetrics' - The evaluation metrics for the find matches algorithm.
--
-- 'transformType', 'evaluationMetrics_transformType' - The type of machine learning transform.
newEvaluationMetrics ::
  -- | 'transformType'
  TransformType ->
  EvaluationMetrics
newEvaluationMetrics :: TransformType -> EvaluationMetrics
newEvaluationMetrics TransformType
pTransformType_ =
  EvaluationMetrics' :: Maybe FindMatchesMetrics -> TransformType -> EvaluationMetrics
EvaluationMetrics'
    { $sel:findMatchesMetrics:EvaluationMetrics' :: Maybe FindMatchesMetrics
findMatchesMetrics =
        Maybe FindMatchesMetrics
forall a. Maybe a
Prelude.Nothing,
      $sel:transformType:EvaluationMetrics' :: TransformType
transformType = TransformType
pTransformType_
    }

-- | The evaluation metrics for the find matches algorithm.
evaluationMetrics_findMatchesMetrics :: Lens.Lens' EvaluationMetrics (Prelude.Maybe FindMatchesMetrics)
evaluationMetrics_findMatchesMetrics :: (Maybe FindMatchesMetrics -> f (Maybe FindMatchesMetrics))
-> EvaluationMetrics -> f EvaluationMetrics
evaluationMetrics_findMatchesMetrics = (EvaluationMetrics -> Maybe FindMatchesMetrics)
-> (EvaluationMetrics
    -> Maybe FindMatchesMetrics -> EvaluationMetrics)
-> Lens
     EvaluationMetrics
     EvaluationMetrics
     (Maybe FindMatchesMetrics)
     (Maybe FindMatchesMetrics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationMetrics' {Maybe FindMatchesMetrics
findMatchesMetrics :: Maybe FindMatchesMetrics
$sel:findMatchesMetrics:EvaluationMetrics' :: EvaluationMetrics -> Maybe FindMatchesMetrics
findMatchesMetrics} -> Maybe FindMatchesMetrics
findMatchesMetrics) (\s :: EvaluationMetrics
s@EvaluationMetrics' {} Maybe FindMatchesMetrics
a -> EvaluationMetrics
s {$sel:findMatchesMetrics:EvaluationMetrics' :: Maybe FindMatchesMetrics
findMatchesMetrics = Maybe FindMatchesMetrics
a} :: EvaluationMetrics)

-- | The type of machine learning transform.
evaluationMetrics_transformType :: Lens.Lens' EvaluationMetrics TransformType
evaluationMetrics_transformType :: (TransformType -> f TransformType)
-> EvaluationMetrics -> f EvaluationMetrics
evaluationMetrics_transformType = (EvaluationMetrics -> TransformType)
-> (EvaluationMetrics -> TransformType -> EvaluationMetrics)
-> Lens
     EvaluationMetrics EvaluationMetrics TransformType TransformType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EvaluationMetrics' {TransformType
transformType :: TransformType
$sel:transformType:EvaluationMetrics' :: EvaluationMetrics -> TransformType
transformType} -> TransformType
transformType) (\s :: EvaluationMetrics
s@EvaluationMetrics' {} TransformType
a -> EvaluationMetrics
s {$sel:transformType:EvaluationMetrics' :: TransformType
transformType = TransformType
a} :: EvaluationMetrics)

instance Core.FromJSON EvaluationMetrics where
  parseJSON :: Value -> Parser EvaluationMetrics
parseJSON =
    String
-> (Object -> Parser EvaluationMetrics)
-> Value
-> Parser EvaluationMetrics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EvaluationMetrics"
      ( \Object
x ->
          Maybe FindMatchesMetrics -> TransformType -> EvaluationMetrics
EvaluationMetrics'
            (Maybe FindMatchesMetrics -> TransformType -> EvaluationMetrics)
-> Parser (Maybe FindMatchesMetrics)
-> Parser (TransformType -> EvaluationMetrics)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FindMatchesMetrics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FindMatchesMetrics")
            Parser (TransformType -> EvaluationMetrics)
-> Parser TransformType -> Parser EvaluationMetrics
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TransformType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TransformType")
      )

instance Prelude.Hashable EvaluationMetrics

instance Prelude.NFData EvaluationMetrics