All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.googleapis.bigquery.BinaryClassificationMetrics.scala Maven / Gradle / Ivy

There is a newer version: 0.4.5-v2-20240905
Show newest version
package googleapis.bigquery

import io.circe._
import io.circe.syntax._

final case class BinaryClassificationMetrics(
    /** Aggregate classification metrics.
      */
    aggregateClassificationMetrics: Option[AggregateClassificationMetrics] = None,
    /** Binary confusion matrix at multiple thresholds.
      */
    binaryConfusionMatrixList: Option[List[BinaryConfusionMatrix]] = None,
    /** Label representing the negative class.
      */
    negativeLabel: Option[String] = None,
    /** Label representing the positive class.
      */
    positiveLabel: Option[String] = None,
)
object BinaryClassificationMetrics {
  implicit val encoder: Encoder[
    BinaryClassificationMetrics
  ] = Encoder.instance { x =>
    Json.obj(
      "aggregateClassificationMetrics" := x.aggregateClassificationMetrics,
      "binaryConfusionMatrixList" := x.binaryConfusionMatrixList,
      "negativeLabel" := x.negativeLabel,
      "positiveLabel" := x.positiveLabel,
    )
  }
  implicit val decoder: Decoder[
    BinaryClassificationMetrics
  ] = Decoder.instance { c =>
    for {
      v0 <- c.get[Option[AggregateClassificationMetrics]]("aggregateClassificationMetrics")
      v1 <- c.get[Option[List[BinaryConfusionMatrix]]]("binaryConfusionMatrixList")
      v2 <- c.get[Option[String]]("negativeLabel")
      v3 <- c.get[Option[String]]("positiveLabel")
    } yield BinaryClassificationMetrics(v0, v1, v2, v3)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy