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

commonMain.aws.sdk.kotlin.services.textract.model.EvaluationMetric.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.textract.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The evaluation metrics (F1 score, Precision, and Recall) for an adapter version.
 */
public class EvaluationMetric private constructor(builder: Builder) {
    /**
     * The F1 score for an adapter version.
     */
    public val f1Score: kotlin.Float = builder.f1Score
    /**
     * The Precision score for an adapter version.
     */
    public val precision: kotlin.Float = builder.precision
    /**
     * The Recall score for an adapter version.
     */
    public val recall: kotlin.Float = builder.recall

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.textract.model.EvaluationMetric = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("EvaluationMetric(")
        append("f1Score=$f1Score,")
        append("precision=$precision,")
        append("recall=$recall")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = f1Score.hashCode()
        result = 31 * result + (precision.hashCode())
        result = 31 * result + (recall.hashCode())
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as EvaluationMetric

        if (!(f1Score?.equals(other.f1Score) ?: (other.f1Score == null))) return false
        if (!(precision?.equals(other.precision) ?: (other.precision == null))) return false
        if (!(recall?.equals(other.recall) ?: (other.recall == null))) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.textract.model.EvaluationMetric = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The F1 score for an adapter version.
         */
        public var f1Score: kotlin.Float = 0f
        /**
         * The Precision score for an adapter version.
         */
        public var precision: kotlin.Float = 0f
        /**
         * The Recall score for an adapter version.
         */
        public var recall: kotlin.Float = 0f

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.textract.model.EvaluationMetric) : this() {
            this.f1Score = x.f1Score
            this.precision = x.precision
            this.recall = x.recall
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.textract.model.EvaluationMetric = EvaluationMetric(this)

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy