Skip to content

Plot prediction-area (P-A) curves

plot_prediction_area_curves(true_positive_rate_values, proportion_of_area_values, threshold_values)

Plot prediction-area (P-A) plot.

Plots prediction area plot that can be used to evaluate mineral prospectivity maps and evidential layers. See e.g., Yousefi and Carranza (2015).

The inputs needed for this tool can be obtained with calculate_base_metrics() tool.

Parameters:

Name Type Description Default
true_positive_rate_values Union[ndarray, Series]

True positive rate values.

required
proportion_of_area_values Union[ndarray, Series]

Proportion of area values.

required
threshold_values Union[ndarray, Series]

Threshold values.

required

Returns:

Type Description
Figure

P-A plot figure object.

Raises:

Type Description
InvalidParameterValueException

true_positive_rate_values or proportion_of_area_values values are out of bounds.

References

Yousefi, Mahyar, and Emmanuel John M. Carranza. "Fuzzification of continuous-value spatial evidence for mineral prospectivity mapping." Computers & Geosciences 74 (2015): 97-109.

Source code in eis_toolkit/evaluation/plot_prediction_area_curves.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@beartype
def plot_prediction_area_curves(
    true_positive_rate_values: Union[np.ndarray, pd.Series],
    proportion_of_area_values: Union[np.ndarray, pd.Series],
    threshold_values: Union[np.ndarray, pd.Series],
) -> matplotlib.figure.Figure:
    """Plot prediction-area (P-A) plot.

    Plots prediction area plot that can be used to evaluate mineral prospectivity maps and evidential layers. See e.g.,
    Yousefi and Carranza (2015).

    The inputs needed for this tool can be obtained with calculate_base_metrics() tool.

    Args:
        true_positive_rate_values: True positive rate values.
        proportion_of_area_values: Proportion of area values.
        threshold_values: Threshold values.

    Returns:
        P-A plot figure object.

    Raises:
        InvalidParameterValueException: true_positive_rate_values or proportion_of_area_values values are out of bounds.

    References:
        Yousefi, Mahyar, and Emmanuel John M. Carranza. "Fuzzification of continuous-value spatial evidence for mineral
        prospectivity mapping." Computers & Geosciences 74 (2015): 97-109.
    """
    if true_positive_rate_values.max() > 1 or true_positive_rate_values.min() < 0:
        raise InvalidParameterValueException("true_positive_rate values should be within range 0-1")

    if proportion_of_area_values.max() > 1 or proportion_of_area_values.min() < 0:
        raise InvalidParameterValueException("proportion_of_area values should be within range 0-1")

    fig = _plot_prediction_area_curves(
        true_positive_rate_values=true_positive_rate_values,
        proportion_of_area_values=proportion_of_area_values,
        threshold_values=threshold_values,
    )
    return fig