-
Notifications
You must be signed in to change notification settings - Fork 92
Home
This package contains a collection of functions for calculating the skill of model predictions against observations. It includes metrics such as root-mean-square-error (RMSE) difference, centered root-mean-square (RMS) difference, and skill score (SS), as well as a collection of functions for producing target and Taylor diagrams. The more valuable feature of the toolbox are the plotting functions for target and Taylor diagrams and the ability to easily customize the diagrams.
To install the package simply use the pip3 command:
pip3 install SkillMetrics
If you are upgrading the package then include the upgrade option:
pip3 install SkillMetrics --upgrade
Note that SkillMetrics now only supports Python 3 because Python 2 has been deprecated. Using pip
to install may therefore not work.
The target and Taylor diagrams produced by the several examples posted on this wiki can be viewed by following the links shown below. This is a useful starting point for users looking to identify the best example from which to begin creating a diagram for their specific need by modifying the accompanying Python script.
It is expected that examples will be added over time as the SkillMetrics package continues to evolve. So, revisit this page whenever the need arises to produce new diagrams.
An easy tutorial is provided here in the form of a series of example scripts to illustrate how to produce target and Taylor diagrams in a variety of formats using the Skill Metrics package. For background information on target diagrams the reader is referred to Jolliff et al. (2009) and for Taylor diagrams to the primer. There are 7 examples for target diagrams and 8 examples for Taylor diagrams that successively progress from very simple to more customized figures. These series of examples provide an easy tutorial on how to use the various options of the target_diagram and taylor_diagram functions. They also provide a quick reference in future for how to produce the diagrams with specific features. The diagrams produced by each script are in Portable Network Graphics (PNG) format and have the same file name as the script with a "png" suffix. Examples of the diagrams produced can be found in the Examples folder with the same file name as the script and ending in '_example.png'. For example the diagram produced by target1.m is named target1_example.png. All target diagram examples require the target_data.pkl file while the Taylor examples require the taylor_data.pkl file. Follow the links below to navigate each of the target and Taylor diagram examples.
Examples will be added over time as the SkillMetrics package continues to evolve.
- Target Diagram Options
- Example 1 (target1.py, target1.png, data file: phytoplankton_data.zip)
- Example 2 (target2.py, target2.png, data file: phytoplankton_data.zip)
- Example 3 (target3.py, target3.png, data file: phytoplankton_data.zip)
- Example 4 (target4.py, target4.png, data file: phytoplankton_data.zip)
- Example 5 (target5.py, target5.png, data file: phytoplankton_data.zip)
- Example 6 (target6.py, target6.png, data file: phytoplankton_data.zip)
- Example 7 (target7.py, target7.png, data file: phytoplankton_data.zip)
- Example 8 (target8.py, target8.png, data file: Mekong_Basin_data.pkl)
- Example 9 (target9.py, target9.png)
- Example 10 (target10.py, target10.png, data file: phytoplankton_data.zip)
- Example 11 (target11.py, target11.png, data file: Farmington_River_data.pkl3
- Taylor Diagram Options
- Example 1 (taylor1.py, taylor1.png, data file: phytoplankton_data.zip)
- Example 2 (taylor2.py, taylor2.png, data file: phytoplankton_data.zip)
- Example 3 (taylor3.py, taylor3.png, data file: phytoplankton_data.zip)
- Example 4 (taylor4.py, taylor4.png, data file: phytoplankton_data.zip)
- Example 5 (taylor5.py, taylor5.png, data file: phytoplankton_data.zip)
- Example 6 (taylor6.py, taylor6.png, data file: phytoplankton_data.zip)
- Example 7 (taylor7.py, taylor7.png, data file: phytoplankton_data.zip)
- Example 8 (taylor8.py, taylor8.png, data file: phytoplankton_data.zip)
- Example 9 (taylor9.py, taylor9.png, data file: phytoplankton_data.zip)
- Example 10 (taylor10.py, taylor10.png, data file: Farmington_River_data.pkl)
- Example 11 (taylor11.py, taylor11.png)
- Example 12 (taylor12.py, taylor12.png, data file: Mekong_Basin_data.pkl)
- Example 13 (taylor13.py, taylor13.png, data file: Mekong_Basin_data_interannual.pkl)
- Example 14 (taylor14.py, taylor14.png, data file: phytoplankton_data.zip)
- Example 15 (taylor15.py, taylor15.png, data file: Farmington_River_data.pkl3)
There is also a simple program in the Examples folder (all_stats.py) that provides examples of how to calculate the various skill metrics used or available in the toolbox. All the calculated skill metrics are written to an Excel file for easy viewing and manipulation. The script requires the target_data.pkl file.
- bias : Calculate the bias between two variables
- bias_percent : Calculate the percentage bias between two variables
- brier_score : Calculate Brier score (BS) between two variables
- centered_rms_dev : Calculate centered root-mean-square difference (CRMSD, E') between two variables
- check_taylor_stats : Checks input statistics satisfy Taylor diagram relation to <1%.
- kling_gupta_eff09 : Calculate the Kling-Gupta efficiency from 2009 paper (KGE09) between two variables
- kling_gupta_eff12 : Calculate the Kling-Gupta efficiency from 2012 paper (KGE12) between two variables
- nash_sutcliffe_eff : Calculate Nash-Sutcliffe efficiency between two variables
- rmsd : Calculate the root-mean-square deviation (RMSD) between two variables
- skill_score_brier : Calculate Brier skill score (BSS) between two variables
- skill_score_murphy : Calculate non-dimensional skill score (SS) between two variables
A list of the currently available plotting options for the diagrams can be found by following the links below:
Functions are provided for reading data for which skill metrics and diagrams are desired as a courtesy to users. However, these functions are not included within the skill_metrics module. Refer to the Reading Data Wiki page for the list of available functions and how to use.
For problems encountered using the package refer to the FAQ page of the Wiki.
Peter A. Rochford (2016) SkillMetrics: A Python package for calculating the skill of model predictions against observations, https://github.com/PeterRochford/SkillMetrics
@misc{rochfordskillmetrics,
title={SkillMetrics: A Python package for calculating the skill of model predictions against observations},
author={Peter A. Rochford},
year={2016},
url={https://github.com/PeterRochford/SkillMetrics}
}
- Jolliff, J. K., J. C. Kindle, I. Shulman, B. Penta, M. Friedrichs, R. Helber, and R. Arnone (2009), Skill assessment for coupled biological/physical models of marine systems, J. Mar. Sys., 76(1-2), 64-82, doi:10.1016/j.jmarsys.2008.05.014
- Taylor, K. E. (2001) Summarizing multiple aspects of model performance in a single diagram, J. Geophys. Res., 106(D7), 7183–7192, doi:10.1029/2000JD900719.