Skip to main content

Skill Metrics Project

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 package are the plotting functions for target and Taylor diagrams and the ability to easily customize the diagrams.

Features

  • Statistical metrics such as root-mean-square-error (RMSE) difference, centered root-mean-square (RMS) difference, and skill score (SS)
  • Functions to calculate statistical metrics for target & Taylor diagrams
  • Target Diagrams
  • Taylor Diagrams
  • Options to control plot features such as color of labels and lines, width of lines, choice of markers, etc.
  • Output of graphics to any supported matplotlib format (default PNG).

Installation

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 the SkillMetrics package only supports Python 3. You may have to use pip3 to successfully install the latest version of the package.

Example Scripts

A primer on Taylor diagrams is provided as well as a 6-page description of target and Taylor diagrams as visual tools to aid in the analysis of model predictive skill. The figures used in the latter were generated with the SkillMetrics package. There is also an "Examples" folder that contains a collection of example Python scripts showing how to produce target and Taylor diagrams in a variety of formats on the Wiki Home page. There are multiple examples for target and 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.

There is also a simple program all_stats.py available via the Wiki that provides examples of how to calculate the various skill metrics used or available in the package. All the calculated skill metrics are written to a spreadsheet file for easy viewing and manipulation: Excel for a Windows operating system, Comma Separated Value (CSV) for a Macintosh operating system (MacOS). The Python code is kept to a minimum.

Example Diagrams

The diagrams produced by the example scripts are in Portable Network Graphics (PNG) format and have the same file name as the script with a .png suffix. The PNG files created 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.

Target Diagrams

Taylor Diagrams

Here is a sample of the target and Taylor diagrams you'll find in the above examples:

target diagram Taylor diagram

FAQ

A list of Frequently Asked Questions (FAQ) is maintained on the Wiki. Users are encouraged to look there for solutions to problems they may encounter when using the package.

Available Metrics

Here is a list of currently supported metrics. Examples of how to obtain them can be found in the all_stats.py program. A far more extensive list of statistical metrics can be calculated using the SeqMetrics package.

Metric Description
bias Mean error
BS Brier score
BSS Brier skill score
CRMSD centered root-mean-square error deviation
KGE09 Kling-Gupta efficiency 2009
KGE12 Kling-Gupta efficiency 2012
NSE Nash-Sutcliffe efficiency
r Correlation coefficient
RMSD root-mean-square error deviation
SDEV standard deviation
SS Murphy's skill score

How to cite SkillMetrics

Peter A. Rochford (2016) SkillMetrics: A Python package for calculating the skill of model predictions against observations, http://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={http://github.com/PeterRochford/SkillMetrics}, 

Guidelines to contribute

  1. In the description of your Pull Request (PR) explain clearly what it implements/fixes and your changes. Possibly give an example in the description of the PR.
  2. Give your pull request a helpful title that summarizes what your contribution does.
  3. Write unit tests for your code and make sure the existing backward compatibility tests pass.
  4. Make sure your code is properly commented and documented. Each public method needs to be documented as the existing ones.

Release files for SkillMetrics 1.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SkillMetrics 1.2.5
File Size Uploaded
skillmetrics-1.2.5.tar.gz 59.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SkillMetrics 1.2.5
File Interpreter ABI Platform
skillmetrics-1.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 142.6 kB

Release files / skillmetrics-1.2.5.tar.gz

Download URL skillmetrics-1.2.5.tar.gz
Size 59.4 kB
Tags Source
SHA-256 checksum
How to use checksums
22995d17ffce5d2272e06c540ef30c6cb7cd30dc50fd58cd3fcc071870a9a5cb
BLAKE2b-256 checksum
How to use checksums
9aa511905447c54f0d8e3bc5eaeeba62f075ae6ba732b2e768f0cb40e4940f0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / skillmetrics-1.2.5-py3-none-any.whl

Download URL skillmetrics-1.2.5-py3-none-any.whl
Size 83.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea7a32b12ed24698dc81e323cc22f16eb4d5b9f82e0afa7a291e7a7fef284ab5
BLAKE2b-256 checksum
How to use checksums
f4872cbe033663e8849e801d64255262f82366ec4784bc7a31edb186dc4255ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

1.2.5 This release

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page