sensortoolkit.plotting._performance_metrics.performance_metrics
- performance_metrics(stats_df, deploy_dict, param=None, param_averaging=None, font_size=12, path=None, sensor_name=None, write_to_file=True, **kwargs)[source]
Display performance metric results via a set of adjacent subplots corresponding to each metric. Results are displayed as either dots (if the number of sensors is less than four) or via boxplots (number of sensors exceeds 3). Target ranges are indicated by gray shaded regions, and target goals are indicated by dark gray lines.
- Parameters
stats_df (pandas dataframe) – A dataframe containing regression statistics (sensor vs. FRM/FEM reference) at averaging intervals corresponding to the
param_averaging
attribute.deploy_dict (dict) – A dictionary containing descriptive statistics and textual information about the deployment (testing agency, site, time period, etc.), sensors tested, and site conditions during the evaluation.
param (str, optional) – Parameter name to evaluate. Defaults to None.
param_averaging (str, optional) – The measurement averaging intervals commonly utilized for analyzing data corresponding the selected parameter. Defaults to None.
font_size (int, optional) – The font size for text displayed in the figure. Defaults to 12.
path (str, optional) – The full directory path to the
/figures
subfolder housed within the user’s project path. Defaults to None.sensor_name (str, optional) – The make and model of the air sensor for which the performance evaluation figure is being generated. Defaults to None.
write_to_file (bool, optional) – If true, the figure will be written to the /figures/[param] sensor subdirectory (where ‘param’ is the name of the parameter being evaluated). Defaults to True.
Keyword Arguments:
- Parameters
fill_color (Two-element tuple) – Tuple with color hex code(s) for the fill color assigned to 1-hour and 24-hour metric value markers. Defaults to
('#80c5c9', '#4ea1c0')
, which are light and dark teal hues.marker (str) – The shape of the plotting marker for metric values. Matplotlib maintains a list of markers. Defaults to ‘o’ (circle).
marker_size (int or float) – Assign the marker size in points. Defaults to 7.
marker_border_width (int or float) – Set the width of the border surrounding each marker. Defaults to 1.
mean_marker (str) – (# sensors > 4 only) The marker indicating the mean value of metric values. Defaults to
'd'
(diamond marker).figure_width (int or float) – The width of the figure in inches. Defaults to .
figure_height (int or float) – The height of the figure in inches. Defaults to 3.9.
R^2_ylims (Two-element tuple of floats) – The y-limits (ymin, ymax) for the metric subplot 15.7.
Slope_ylims (Two-element tuple of floats) – The y-limits (ymin, ymax) for the metric subplot.
Intercept_ylims (Two-element tuple of floats) – The y-limits (ymin, ymax) for the metric subplot.
CV_ylims (Two-element tuple of floats) – The y-limits (ymin, ymax) for the metric subplot.
RMSE_ylims (Two-element tuple of floats) – The y-limits (ymin, ymax) for the metric subplot.
NRMSE_ylims (Two-element tuple of floats) – The y-limits (ymin, ymax) for the metric subplot.
SD_ylims (Two-element tuple of floats) – The y-limits (ymin, ymax) for the metric subplot.
R^2_hline_dims (Three-element tuple) – Dimensions for the target goal horizontal line. Tuple containing the y-coordinate of the target value, x-min (leftmost) coordinate for drawing horizontal line, and the x-max (rightmost) coordinate for drawing horizontal line).
Slope_hline_dims (Three-element tuple) – Dimensions for the target goal horizontal line. Tuple containing the y-coordinate of the target value, x-min (leftmost) coordinate for drawing horizontal line, and the x-max (rightmost) coordinate for drawing horizontal line).
Intercept_hline_dims (Three-element tuple) – Dimensions for the target goal horizontal line. Tuple containing the y-coordinate of the target value, x-min (leftmost) coordinate for drawing horizontal line, and the x-max (rightmost) coordinate for drawing horizontal line).
CV_hline_dims (Three-element tuple) – Dimensions for the target goal horizontal line. Tuple containing the y-coordinate of the target value, x-min (leftmost) coordinate for drawing horizontal line, and the x-max (rightmost) coordinate for drawing horizontal line).
RMSE_hline_dims (Three-element tuple) – Dimensions for the target goal horizontal line. Tuple containing the y-coordinate of the target value, x-min (leftmost) coordinate for drawing horizontal line, and the x-max (rightmost) coordinate for drawing horizontal line).
NRMSE_hline_dims (Three-element tuple) – Dimensions for the target goal horizontal line. Tuple containing the y-coordinate of the target value, x-min (leftmost) coordinate for drawing horizontal line, and the x-max (rightmost) coordinate for drawing horizontal line).
SD_hline_dims (Three-element tuple) – Dimensions for the target goal horizontal line. Tuple containing the y-coordinate of the target value, x-min (leftmost) coordinate for drawing horizontal line, and the x-max (rightmost) coordinate for drawing horizontal line).
R^2_box_dims (Four-element tuple) – Dimensions for a box indicating the metric target range. Four element tuple containing the x-min (left-most coordinate of the box), y-min (bottom-most coordinate of the target range box), x-range (the height of the box, or the difference between the x-min coordinate position and the x-max coordinate position), and the y-range (the width of the box, or the difference between the y-min coordinate position and the y-max coordinate position).
Slope_box_dims (Four-element tuple) – Dimensions for a box indicating the metric target range. Four element tuple containing the x-min (left-most coordinate of the box), y-min (bottom-most coordinate of the target range box), x-range (the height of the box, or the difference between the x-min coordinate position and the x-max coordinate position), and the y-range (the width of the box, or the difference between the y-min coordinate position and the y-max coordinate position).
Intercept_box_dims (Four-element tuple) – Dimensions for a box indicating the metric target range. Four element tuple containing the x-min (left-most coordinate of the box), y-min (bottom-most coordinate of the target range box), x-range (the height of the box, or the difference between the x-min coordinate position and the x-max coordinate position), and the y-range (the width of the box, or the difference between the y-min coordinate position and the y-max coordinate position).
CV_box_dims (Four-element tuple) – Dimensions for a box indicating the metric target range. Four element tuple containing the x-min (left-most coordinate of the box), y-min (bottom-most coordinate of the target range box), x-range (the height of the box, or the difference between the x-min coordinate position and the x-max coordinate position), and the y-range (the width of the box, or the difference between the y-min coordinate position and the y-max coordinate position).
RMSE_box_dims (Four-element tuple) – Dimensions for a box indicating the metric target range. Four element tuple containing the x-min (left-most coordinate of the box), y-min (bottom-most coordinate of the target range box), x-range (the height of the box, or the difference between the x-min coordinate position and the x-max coordinate position), and the y-range (the width of the box, or the difference between the y-min coordinate position and the y-max coordinate position).
NRMSE_box_dims (Four-element tuple) – Dimensions for a box indicating the metric target range. Four element tuple containing the x-min (left-most coordinate of the box), y-min (bottom-most coordinate of the target range box), x-range (the height of the box, or the difference between the x-min coordinate position and the x-max coordinate position), and the y-range (the width of the box, or the difference between the y-min coordinate position and the y-max coordinate position).
SD_box_dims (Four-element tuple) – Dimensions for a box indicating the metric target range. Four element tuple containing the x-min (left-most coordinate of the box), y-min (bottom-most coordinate of the target range box), x-range (the height of the box, or the difference between the x-min coordinate position and the x-max coordinate position), and the y-range (the width of the box, or the difference between the y-min coordinate position and the y-max coordinate position).
hline_color (str) – Set the color of horizontal lines indicating the target value for metric subplots. Defaults to #8b8b8b (light gray).
box_facecolor (str) – Set the color of boxes indicating the target range for each metric subplot. Defaults to #8b8b8b (light gray).
font_scale (int or str) – Set the size and scale of the font elements in the figure.
fig_wspace (float) – Modify the width of padding between subplots. Passed to
Matplotlib.subplots.subplots_adjust()
'wspace'
argument.fig_hspace (float) – Modify the height of padding between subplots. Passed to
Matplotlib.subplots.subplots_adjust()
'hspace'
argument.fig_left (float) – Modify the left-most bounds of the figure. Passed to
Matplotlib.subplots.subplots_adjust()
'left'
argument.fig_right (float) – Modify the right-most bounds of the figure. Passed to
Matplotlib.subplots.subplots_adjust()
'right'
argument.fig_top (float) – Modify the upper-most bounds of the figure. Passed to
Matplotlib.subplots.subplots_adjust()
'top'
argument.fig_bottom (float) – Modify the lower-most bounds of the figure. Passed to
Matplotlib.subplots.subplots_adjust()
'bottom'
argument.
- Returns
None.