Available Metrics
The following pixel-wise metrics are available:
Categorical Metrics:
Metric |
Description |
|---|---|
|
Confusion Matrix |
|
Positive Predictive Value (Precision) |
|
True Positive Rate (Recall) |
|
Harmonic Mean of Precision and Recall (F1 Score) |
|
Overall Accuracy |
|
Critical Success Index (CSI) |
|
False Alarm Ratio (FAR) |
|
Probability of Detection (POD) |
|
Gilbert Skill Score (GSS), also known as Equitable Threat Score (ETS) |
|
Heidke Skill Score (HSS) |
|
Peirce Skill Score (PSS) |
|
Symmetric Extremal Dependence Index (SEDI) |
Continuous Metrics:
Metric |
Description |
|---|---|
|
Mean Absolute Error (MAE) |
|
Mean Squared Error (MSE) |
|
Root Mean Squared Error (RMSE) |
|
Frequency Bias |
|
Debiased Root Mean Squared Error (DRMSE) |
|
Pearson Correlation Coefficient (Correlation) |
Example Usage
Below are examples of how to calculate pixel-wise metrics using the provided functions:
from duplexity.pixelwise import calculate_pixelwise_metrics
import numpy as np
# Generate some random data to simulate observed and model output
observed_data = np.random.rand(100, 100)
model_output = np.random.rand(100, 100)
# Calculate pixel-wise metrics
results = calculate_pixelwise_metrics(observed_data, model_output, metrics=["mae", "rmse"])
print(results)
# Output:
# {'mae': 0.123, 'rmse': 0.345}
The calculate_pixelwise_metrics function allows you to compute multiple metrics at once by specifying them in the metrics argument.