Giter Club home page Giter Club logo

fmskill's Introduction

FMskill: Compare MIKE FM results with observations.

Python version Python package PyPI version

FMskill is a python package for scoring MIKE FM models.

Read more about the vision and scope. Contribute with new ideas in the discussion, report an issue or browse the API documentation.

Use cases

FMskill would like to be your companion during the different phases of a MIKE FM modelling workflow.

  • Model setup - exploratory phase
  • Model calibration
  • Model validation and reporting - communicate your final results

Installation

From pypi:

> pip install fmskill

Or the development version:

> pip install https://github.com/DHI/fmskill/archive/main.zip

Example notebooks

Workflow

  1. Define ModelResults
  2. Define Observations
  3. Connect Observations and ModelResults
  4. Extract ModelResults at Observation positions
  5. Do plotting, statistics, reporting using a Comparer

Read more about the workflow in the getting started guide.

Example of use

Start by defining model results and observations:

>>> from fmskill.model import ModelResult
>>> from fmskill.observation import PointObservation, TrackObservation
>>> mr = ModelResult("HKZN_local_2017_DutchCoast.dfsu", name="HKZN_local", item=0)
>>> HKNA = PointObservation("HKNA_Hm0.dfs0", item=0, x=4.2420, y=52.6887, name="HKNA")
>>> EPL = PointObservation("eur_Hm0.dfs0", item=0, x=3.2760, y=51.9990, name="EPL")
>>> c2 = TrackObservation("Alti_c2_Dutch.dfs0", item=3, name="c2")

Then, connect observations and model results, and extract data at observation points:

>>> from fmskill import Connector
>>> con = Connector([HKNA, EPL, c2], mr)
>>> comparer = con.extract()

With the comparer, all sorts of skill assessments and plots can be made:

>>> comparer.skill().round(2)
               n  bias  rmse  urmse   mae    cc    si    r2
observation                                                
HKNA         385 -0.20  0.35   0.29  0.25  0.97  0.09  0.99
EPL           66 -0.08  0.22   0.20  0.18  0.97  0.07  0.99
c2           113 -0.00  0.35   0.35  0.29  0.97  0.12  0.99

Overview of observation locations

con.plot_observation_positions(figsize=(7,7))

map

Scatter plot

comparer.scatter()

scatter

Timeseries plot

Timeseries plots can either be static and report-friendly (matplotlib) or interactive with zoom functionality (plotly).

comparer["HKNA"].plot_timeseries(width=1000, backend="plotly")

timeseries

Automated reporting

With a few lines of code, it will be possible to generate an automated report.

from fmskill.report import Reporter

rep = Reporter(mr)
rep.to_markdown()

Very basic first example report

fmskill's People

Contributors

ecomodeller avatar hendrik1987 avatar jsmariegaard avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.