/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.comprehend.model; import java.io.Serializable; /** *

* The evaluation metrics associated with the evaluated model. *

*/ public class FlywheelModelEvaluationMetrics implements Serializable { /** *

* The average F1 score from the evaluation metrics. *

*/ private Double averageF1Score; /** *

* Average precision metric for the model. *

*/ private Double averagePrecision; /** *

* Average recall metric for the model. *

*/ private Double averageRecall; /** *

* Average accuracy metric for the model. *

*/ private Double averageAccuracy; /** *

* The average F1 score from the evaluation metrics. *

* * @return

* The average F1 score from the evaluation metrics. *

*/ public Double getAverageF1Score() { return averageF1Score; } /** *

* The average F1 score from the evaluation metrics. *

* * @param averageF1Score

* The average F1 score from the evaluation metrics. *

*/ public void setAverageF1Score(Double averageF1Score) { this.averageF1Score = averageF1Score; } /** *

* The average F1 score from the evaluation metrics. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param averageF1Score

* The average F1 score from the evaluation metrics. *

* @return A reference to this updated object so that method calls can be * chained together. */ public FlywheelModelEvaluationMetrics withAverageF1Score(Double averageF1Score) { this.averageF1Score = averageF1Score; return this; } /** *

* Average precision metric for the model. *

* * @return

* Average precision metric for the model. *

*/ public Double getAveragePrecision() { return averagePrecision; } /** *

* Average precision metric for the model. *

* * @param averagePrecision

* Average precision metric for the model. *

*/ public void setAveragePrecision(Double averagePrecision) { this.averagePrecision = averagePrecision; } /** *

* Average precision metric for the model. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param averagePrecision

* Average precision metric for the model. *

* @return A reference to this updated object so that method calls can be * chained together. */ public FlywheelModelEvaluationMetrics withAveragePrecision(Double averagePrecision) { this.averagePrecision = averagePrecision; return this; } /** *

* Average recall metric for the model. *

* * @return

* Average recall metric for the model. *

*/ public Double getAverageRecall() { return averageRecall; } /** *

* Average recall metric for the model. *

* * @param averageRecall

* Average recall metric for the model. *

*/ public void setAverageRecall(Double averageRecall) { this.averageRecall = averageRecall; } /** *

* Average recall metric for the model. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param averageRecall

* Average recall metric for the model. *

* @return A reference to this updated object so that method calls can be * chained together. */ public FlywheelModelEvaluationMetrics withAverageRecall(Double averageRecall) { this.averageRecall = averageRecall; return this; } /** *

* Average accuracy metric for the model. *

* * @return

* Average accuracy metric for the model. *

*/ public Double getAverageAccuracy() { return averageAccuracy; } /** *

* Average accuracy metric for the model. *

* * @param averageAccuracy

* Average accuracy metric for the model. *

*/ public void setAverageAccuracy(Double averageAccuracy) { this.averageAccuracy = averageAccuracy; } /** *

* Average accuracy metric for the model. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param averageAccuracy

* Average accuracy metric for the model. *

* @return A reference to this updated object so that method calls can be * chained together. */ public FlywheelModelEvaluationMetrics withAverageAccuracy(Double averageAccuracy) { this.averageAccuracy = averageAccuracy; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAverageF1Score() != null) sb.append("AverageF1Score: " + getAverageF1Score() + ","); if (getAveragePrecision() != null) sb.append("AveragePrecision: " + getAveragePrecision() + ","); if (getAverageRecall() != null) sb.append("AverageRecall: " + getAverageRecall() + ","); if (getAverageAccuracy() != null) sb.append("AverageAccuracy: " + getAverageAccuracy()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAverageF1Score() == null) ? 0 : getAverageF1Score().hashCode()); hashCode = prime * hashCode + ((getAveragePrecision() == null) ? 0 : getAveragePrecision().hashCode()); hashCode = prime * hashCode + ((getAverageRecall() == null) ? 0 : getAverageRecall().hashCode()); hashCode = prime * hashCode + ((getAverageAccuracy() == null) ? 0 : getAverageAccuracy().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof FlywheelModelEvaluationMetrics == false) return false; FlywheelModelEvaluationMetrics other = (FlywheelModelEvaluationMetrics) obj; if (other.getAverageF1Score() == null ^ this.getAverageF1Score() == null) return false; if (other.getAverageF1Score() != null && other.getAverageF1Score().equals(this.getAverageF1Score()) == false) return false; if (other.getAveragePrecision() == null ^ this.getAveragePrecision() == null) return false; if (other.getAveragePrecision() != null && other.getAveragePrecision().equals(this.getAveragePrecision()) == false) return false; if (other.getAverageRecall() == null ^ this.getAverageRecall() == null) return false; if (other.getAverageRecall() != null && other.getAverageRecall().equals(this.getAverageRecall()) == false) return false; if (other.getAverageAccuracy() == null ^ this.getAverageAccuracy() == null) return false; if (other.getAverageAccuracy() != null && other.getAverageAccuracy().equals(this.getAverageAccuracy()) == false) return false; return true; } }