tf.keras.metrics.concordance_correlation
Stay organized with collections
Save and categorize content based on your preferences.
Computes the Concordance coefficient between labels and predictions.
tf.keras.metrics.concordance_correlation(
y_true, y_pred, axis=-1
)
loss = mean(
2 * (y_true - mean(y_true) * (y_pred - mean(y_pred)) / (
var(y_true) + var(y_pred) + square(mean(y_true) - mean(y_pred))
)
)
Args |
y_true
|
Tensor of true targets.
|
y_pred
|
Tensor of predicted targets.
|
axis
|
Axis along which to determine similarity. Defaults to -1.
|
Returns |
|
Concordance Correlation Coefficient tensor.
|
Example:
y_true = [[0, 1, 0.5], [1, 1, 0.2]]
y_pred = [[0.1, 0.9, 0.5], [1, 0.9, 0.2]]
loss = keras.losses.concordance_correlation(
y_true, y_pred, axis=-1
).numpy()
[0.97560976 0.98765432]
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2026-10-31 UTC.
[null,null,["Last updated 2026-10-31 UTC."],[],[]]