{"id":13738408,"url":"https://github.com/ing-bank/popmon","last_synced_at":"2025-04-13T01:55:29.666Z","repository":{"id":37469061,"uuid":"258180016","full_name":"ing-bank/popmon","owner":"ing-bank","description":"Monitor the stability of a Pandas or Spark dataframe ⚙︎","archived":false,"fork":false,"pushed_at":"2025-01-24T15:49:15.000Z","size":6076,"stargazers_count":500,"open_issues_count":16,"forks_count":36,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-13T01:55:14.071Z","etag":null,"topics":["covariate-shift","data-analysis","data-distributions","data-profiling","data-science","dataset-shifts","drift-detection","hacktoberfest","ing-bank","ipython","jupyter","mlops","monitoring","pandas","population-monitoring","python","spark","statistical-process-control","statistical-tests","statistics"],"latest_commit_sha":null,"homepage":"https://popmon.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ing-bank.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-23T11:21:14.000Z","updated_at":"2025-04-06T02:37:48.000Z","dependencies_parsed_at":"2024-01-12T18:32:40.569Z","dependency_job_id":"93838c73-c12b-4b32-937b-a0f5ae6a7e22","html_url":"https://github.com/ing-bank/popmon","commit_stats":{"total_commits":411,"total_committers":17,"mean_commits":"24.176470588235293","dds":0.4841849148418491,"last_synced_commit":"4a53e85011cc6b645a79d75791461338715871f6"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-bank%2Fpopmon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-bank%2Fpopmon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-bank%2Fpopmon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ing-bank%2Fpopmon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ing-bank","download_url":"https://codeload.github.com/ing-bank/popmon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654050,"owners_count":21140235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["covariate-shift","data-analysis","data-distributions","data-profiling","data-science","dataset-shifts","drift-detection","hacktoberfest","ing-bank","ipython","jupyter","mlops","monitoring","pandas","population-monitoring","python","spark","statistical-process-control","statistical-tests","statistics"],"created_at":"2024-08-03T03:02:21.558Z","updated_at":"2025-04-13T01:55:29.642Z","avatar_url":"https://github.com/ing-bank.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"===========================\nPopulation Shift Monitoring\n===========================\n\n|build| |docs| |release| |release_date| |downloads| |ruff|\n\n|logo|\n\n`popmon` is a package that allows one to check the stability of a dataset.\n`popmon` works with both **pandas** and **spark datasets**.\n\n`popmon` creates histograms of features binned in time-slices,\nand compares the stability of the profiles_ and distributions of\nthose histograms using `statistical tests \u003chttps://popmon.readthedocs.io/en/latest/comparisons.html\u003e`_, both over time and with respect to a reference.\nIt works with numerical, ordinal, categorical features, and the histograms can be higher-dimensional, e.g. it can also track correlations between any two features.\n`popmon` can **automatically flag** and alert on **changes observed over time**, such\nas trends, shifts, peaks, outliers, anomalies, changing correlations, etc,\nusing monitoring business rules.\n\n|example|\n\n|histograms|\n\nAnnouncements\n=============\n\nSpark 3.0\n---------\n\nWith Spark 3.0, based on Scala 2.12, make sure to pick up the correct `histogrammar` jar files:\n\n.. code-block:: python\n\n  spark = SparkSession.builder.config(\n      \"spark.jars.packages\",\n      \"io.github.histogrammar:histogrammar_2.12:1.0.20,io.github.histogrammar:histogrammar-sparksql_2.12:1.0.20\",\n  ).getOrCreate()\n\nFor Spark 2.X compiled against scala 2.11, in the string above simply replace 2.12 with 2.11.\n\nExamples\n========\n\n- `Flight Delays and Cancellations Kaggle data \u003chttps://crclz.com/popmon/reports/flight_delays_report.html\u003e`_\n- `Synthetic data (code example below) \u003chttps://crclz.com/popmon/reports/test_data_report.html\u003e`_\n\nDocumentation\n=============\n\nThe entire `popmon` documentation including tutorials can be found at `read-the-docs \u003chttps://popmon.readthedocs.io\u003e`_.\n\n\nNotebooks\n=========\n\n.. list-table::\n   :widths: 80 20\n   :header-rows: 1\n\n   * - Tutorial\n     - Colab link\n   * - `Basic tutorial \u003chttps://nbviewer.jupyter.org/github/ing-bank/popmon/blob/master/popmon/notebooks/popmon_tutorial_basic.ipynb\u003e`_\n     - |notebook_basic_colab|\n   * - `Detailed example (featuring configuration, Apache Spark and more) \u003chttps://nbviewer.jupyter.org/github/ing-bank/popmon/blob/master/popmon/notebooks/popmon_tutorial_advanced.ipynb\u003e`_\n     - |notebook_advanced_colab|\n   * - `Incremental datasets (online analysis) \u003chttps://nbviewer.jupyter.org/github/ing-bank/popmon/blob/master/popmon/notebooks/popmon_tutorial_incremental_data.ipynb\u003e`_\n     - |notebook_incremental_data_colab|\n   * - `Report interpretation (step-by-step guide) \u003chttps://nbviewer.jupyter.org/github/ing-bank/popmon/blob/master/popmon/notebooks/popmon_tutorial_reports.ipynb\u003e`_\n     - |notebook_reports_colab|\n\nCheck it out\n============\n\nThe `popmon` library requires Python 3.6+ and is pip friendly. To get started, simply do:\n\n.. code-block:: bash\n\n  $ pip install popmon\n\nor check out the code from our GitHub repository:\n\n.. code-block:: bash\n\n  $ git clone https://github.com/ing-bank/popmon.git\n  $ pip install -e popmon\n\nwhere in this example the code is installed in edit mode (option -e).\n\nYou can now use the package in Python with:\n\n.. code-block:: python\n\n  import popmon\n\n**Congratulations, you are now ready to use the popmon library!**\n\nQuick run\n=========\n\nAs a quick example, you can do:\n\n.. code-block:: python\n\n  import pandas as pd\n  import popmon\n  from popmon import resources\n\n  # open synthetic data\n  df = pd.read_csv(resources.data(\"test.csv.gz\"), parse_dates=[\"date\"])\n  df.head()\n\n  # generate stability report using automatic binning of all encountered features\n  # (importing popmon automatically adds this functionality to a dataframe)\n  report = df.pm_stability_report(time_axis=\"date\", features=[\"date:age\", \"date:gender\"])\n\n  # to show the output of the report in a Jupyter notebook you can simply run:\n  report\n\n  # or save the report to file\n  report.to_file(\"monitoring_report.html\")\n\nTo specify your own binning specifications and features you want to report on, you do:\n\n.. code-block:: python\n\n  # time-axis specifications alone; all other features are auto-binned.\n  report = df.pm_stability_report(\n      time_axis=\"date\", time_width=\"1w\", time_offset=\"2020-1-6\"\n  )\n\n  # histogram selections. Here 'date' is the first axis of each histogram.\n  features = [\n      \"date:isActive\",\n      \"date:age\",\n      \"date:eyeColor\",\n      \"date:gender\",\n      \"date:latitude\",\n      \"date:longitude\",\n      \"date:isActive:age\",\n  ]\n\n  # Specify your own binning specifications for individual features or combinations thereof.\n  # This bin specification uses open-ended (\"sparse\") histograms; unspecified features get\n  # auto-binned. The time-axis binning, when specified here, needs to be in nanoseconds.\n  bin_specs = {\n      \"longitude\": {\"bin_width\": 5.0, \"bin_offset\": 0.0},\n      \"latitude\": {\"bin_width\": 5.0, \"bin_offset\": 0.0},\n      \"age\": {\"bin_width\": 10.0, \"bin_offset\": 0.0},\n      \"date\": {\n          \"bin_width\": pd.Timedelta(\"4w\").value,\n          \"bin_offset\": pd.Timestamp(\"2015-1-1\").value,\n      },\n  }\n\n  # generate stability report\n  report = df.pm_stability_report(features=features, bin_specs=bin_specs, time_axis=True)\n\nThese examples also work with spark dataframes.\nYou can see the output of such example notebook code `here \u003chttps://crclz.com/popmon/reports/test_data_report.html\u003e`_.\nFor all available examples, please see the `tutorials \u003chttps://popmon.readthedocs.io/en/latest/tutorials.html\u003e`_ at read-the-docs.\n\nPipelines for monitoring dataset shift\n======================================\nAdvanced users can leverage popmon's modular data pipeline to customize their workflow.\nVisualization of the pipeline can be useful when debugging, or for didactic purposes.\nThere is a `script \u003chttps://github.com/ing-bank/popmon/tree/master/tools/\u003e`_ included with the package that you can use.\nThe plotting is configurable, and depending on the options you will obtain a result that can be used for understanding the data flow, the high-level components and the (re)use of datasets.\n\n|pipeline|\n\n*Example pipeline visualization (click to enlarge)*\n\nReports and integrations\n========================\nThe data shift computations that popmon performs, are by default displayed in a self-contained HTML report.\nThis format is favourable in many real-world environments, where access may be restricted.\nMoreover, reports can be easily shared with others.\n\nAccess to the datastore means that its possible to integrate popmon in almost any workflow.\nTo give an example, one could store the histogram data in a PostgreSQL database and load that from Grafana and benefit from their visualisation and alert handling features (e.g. send an email or slack message upon alert).\nThis may be interesting to teams that are already invested in particular choice of dashboarding tool.\n\nPossible integrations are:\n\n+----------------+---------------+\n| |grafana_logo| | |kibana_logo| |\n+----------------+---------------+\n| Grafana        | Kibana        |\n+----------------+---------------+\n\nResources on how to integrate popmon are available in the `examples directory \u003chttps://github.com/ing-bank/popmon/tree/master/examples/integrations\u003e`_.\nContributions of additional or improved integrations are welcome!\n\n.. |grafana_logo| image:: https://upload.wikimedia.org/wikipedia/commons/a/a1/Grafana_logo.svg\n    :alt: Grafana logo\n    :height: 120\n    :target: https://github.com/grafana/grafana\n\n.. |kibana_logo| image:: https://miro.medium.com/max/1400/1*HW_x9ZvIbUkyaqHstsB1ig.png\n    :alt: Kibana logo\n    :height: 120\n    :target: https://github.com/elastic/kibana\n\nComparison and profile extensions\n---------------------------------\n\nExternal libraries or custom functionality can be easily added to Profiles_ and Comparisons_.\nIf you developed an extension that could be generically used, then please consider contributing it to the package.\n\nPopmon currently integrates:\n\n* `Diptest \u003chttps://github.com/RUrlus/diptest\u003e`_\n\nA Python/C++ implementation of Hartigan \u0026 Hartigan's dip test for unimodality.\nThe dip test tests for multimodality in a sample by taking the maximum difference, over all sample points, between the empirical distribution function, and the unimodal distribution function that minimizes that maximum difference.\nOther than unimodality, it makes no further assumptions about the form of the null distribution.\n\nTo enable this extension install diptest using ``pip install diptest`` or ``pip install popmon[diptest]``.\n\nResources\n=========\n\nPresentations\n-------------\n\n+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------+-------------------------+\n| Title                                                                                          | Host                                                                                             | Date              | Speaker                 |\n+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------+-------------------------+\n| popmon: Analysis Package for Dataset Shift Detection                                           | `SciPy Conference 2022 \u003chttps://www.scipy2022.scipy.org/\u003e`_                                      | July 13, 2022     | Simon Brugman           |\n+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------+-------------------------+\n| Popmon - population monitoring made easy                                                       | `Big Data Technology Warsaw Summit 2021 \u003chttps://bigdatatechwarsaw.eu/\u003e`_                        | February 25, 2021 | Simon Brugman           |\n+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------+-------------------------+\n| Popmon - population monitoring made easy                                                       | `Data Lunch @ Eneco \u003chttps://www.eneco.nl/\u003e`_                                                    | October 29, 2020  | Max Baak, Simon Brugman |\n+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------+-------------------------+\n| Popmon - population monitoring made easy                                                       | `Data Science Summit 2020 \u003chttps://dssconf.pl/en/\u003e`_                                             | October 16, 2020  | Max Baak                |\n+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------+-------------------------+\n| `Population Shift Monitoring Made Easy: the popmon package \u003chttps://youtu.be/PgaQpxzT_0g\u003e`_    | `Online Data Science Meetup @ ING WBAA \u003chttps://www.meetup.com/nl-NL/Tech-Meetups-ING/events/\u003e`_ | July 8 2020       | Tomas Sostak            |\n+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------+-------------------------+\n| `Popmon: Population Shift Monitoring Made Easy \u003chttps://www.youtube.com/watch?v=HE-3YeVYqPY\u003e`_ | `PyData Fest Amsterdam 2020 \u003chttps://amsterdam.pydata.org/\u003e`_                                    | June 16, 2020     | Tomas Sostak            |\n+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------+-------------------------+\n| Popmon: Population Shift Monitoring Made Easy                                                  | `Amundsen Community Meetup \u003chttps://github.com/amundsen-io/amundsen\u003e`_                           | June 4, 2020      | Max Baak                |\n+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+-------------------+-------------------------+\n\n\nArticles\n--------\n\n+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------------------------------------+\n| Title                                                                                                                                                                                             | Date             | Author                                      |\n+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------------------------------------+\n|`POPMON v1.0.0: The Dataset-Shift Pokémon \u003chttps://medium.com/wbaa/popmon-v1-0-0-the-dataset-shift-pok%C3%A9mon-7dea9cb49a71\u003e`_                                                                    | Aug 3, 2022      | Pradyot Patil                               |\n+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------------------------------------+\n|`Monitoring Model Drift with Python \u003chttps://medium.com/broadhorizon-cmotions/monitoring-model-drift-with-python-b9e15ca16b18\u003e`_                                                                   | April 16, 2022   | Jeanine Schoonemann                         |\n+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------------------------------------+\n|`The Statistics Underlying the Popmon Hood \u003chttps://www.theanalyticslab.nl/the-statistics-underlying-the-popmon-hood/\u003e`_                                                                           | April 15, 2022   | Jurriaan Nagelkerke and Jeanine Schoonemann |\n+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------------------------------------+\n|`popmon: code breakfast session \u003chttps://simonbrugman.nl/2021/11/09/popmon-code-breakfast.html\u003e`_                                                                                                  | November 9, 2022 | Simon Brugman                               |       \n+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------------------------------------+\n| `Population Shift Analysis: Monitoring Data Quality with Popmon \u003chttps://www.codemotion.com/magazine/dev-hub/big-data-analyst/popmon-data-quality-monitoring/\u003e`_                                  | May 21, 2021     | Vito Gentile                                |\n+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------------------------------------+\n| `Popmon Open Source Package — Population Shift Monitoring Made Easy \u003chttps://medium.com/wbaa/population-monitoring-open-source-1ce3139d8c3a\u003e`_                                                    | May 20, 2020     | Nicole Mpozika                              |\n+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+---------------------------------------------+\n\n\nSoftware\n--------\n\n- `Kedro-popmon \u003chttps://github.com/stephanecollot/kedro-popmon\u003e`_ is a plugin to integrate popmon reporting with kedro. This plugin allows you to automate the process of popmon feature and output stability monitoring. Package created by `Marian Dabrowski \u003chttps://www.linkedin.com/in/marian-dabrowski/\u003e`_ and `Stephane Collot \u003chttps://github.com/stephanecollot/\u003e`_.\n\nProject contributors\n====================\n\nThis package was authored by ING Analytics Wholesale Banking (INGA WB).\nSpecial thanks to the following people who have contributed to the development of this package: `Ahmet Erdem \u003chttps://github.com/aerdem4\u003e`_, `Fabian Jansen \u003chttps://github.com/faab5\u003e`_, `Nanne Aben \u003chttps://github.com/nanne-aben\u003e`_, Mathieu Grimal.\n\n\nCiting popmon\n=============\nIf ``popmon`` has been relevant in your work, and you would like to acknowledge the project in your publication, we suggest citing the following paper:\n\n* Brugman, S., Sostak, T., Patil, P., Baak, M. *popmon: Analysis Package for Dataset Shift Detection*. Proceedings of the 21st Python in Science Conference. 161-168 (2022). (`link \u003chttps://conference.scipy.org/proceedings/scipy2022/popmon.html\u003e`_)\n\n*In BibTeX format:*\n\n.. code-block:: bibtex\n\n    @InProceedings{ popmon-proc-scipy-2022,\n      author    = { {S}imon {B}rugman and {T}omas {S}ostak and {P}radyot {P}atil and {M}ax {B}aak },\n      title     = { popmon: {A}nalysis {P}ackage for {D}ataset {S}hift {D}etection },\n      booktitle = { {P}roceedings of the 21st {P}ython in {S}cience {C}onference },\n      pages     = { 161 - 168 },\n      year      = { 2022 },\n      editor    = { {M}eghann {A}garwal and {C}hris {C}alloway and {D}illon {N}iederhut and {D}avid {S}hupe },\n    }\n\n\n\nContact and support\n===================\n\n* Issues \u0026 Ideas \u0026 Support: https://github.com/ing-bank/popmon/issues\n\nPlease note that INGA WB provides support only on a best-effort basis.\n\nLicense\n=======\nCopyright INGA WB. `popmon` is completely free, open-source and licensed under the `MIT license \u003chttps://en.wikipedia.org/wiki/MIT_License\u003e`_.\n\n.. |logo| image:: https://raw.githubusercontent.com/ing-bank/popmon/master/docs/source/assets/popmon-logo.png\n    :alt: POPMON logo\n    :target: https://github.com/ing-bank/popmon\n.. |example| image:: https://raw.githubusercontent.com/ing-bank/popmon/master/docs/source/assets/report_overview.png\n    :alt: Traffic Light Overview\n.. |histograms| image:: https://raw.githubusercontent.com/ing-bank/popmon/master/docs/source/assets/histogram_inspector.png\n    :alt: Histogram inspector\n.. |pipeline| image:: https://raw.githubusercontent.com/ing-bank/popmon/master/docs/source/assets/pipeline.png\n    :alt: Pipeline Visualization\n    :target: https://github.com/ing-bank/popmon/files/7417124/pipeline_amazingpipeline_subgraphs_unversioned.pdf\n.. |build| image:: https://github.com/ing-bank/popmon/workflows/build/badge.svg\n    :alt: Build status\n.. |ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json\n    :alt: Ruff\n    :target: https://github.com/charliermarsh/ruff\n.. |docs| image:: https://readthedocs.org/projects/popmon/badge/?version=latest\n    :alt: Package docs status\n    :target: https://popmon.readthedocs.io\n.. |release| image:: https://img.shields.io/github/v/release/ing-bank/popmon\n    :alt: Latest GitHub release\n    :target: https://github.com/ing-bank/popmon/releases\n.. |release_date| image:: https://img.shields.io/github/release-date/ing-bank/popmon\n    :alt: GitHub Release Date\n    :target: https://github.com/ing-bank/popmon/releases\n\n.. |notebook_basic_colab| image:: https://colab.research.google.com/assets/colab-badge.svg\n    :alt: Open in Colab\n    :target: https://colab.research.google.com/github/ing-bank/popmon/blob/master/popmon/notebooks/popmon_tutorial_basic.ipynb\n.. |notebook_advanced_colab| image:: https://colab.research.google.com/assets/colab-badge.svg\n    :alt: Open in Colab\n    :target: https://colab.research.google.com/github/ing-bank/popmon/blob/master/popmon/notebooks/popmon_tutorial_advanced.ipynb\n.. |notebook_incremental_data_colab| image:: https://colab.research.google.com/assets/colab-badge.svg\n    :alt: Open in Colab\n    :target: https://colab.research.google.com/github/ing-bank/popmon/blob/master/popmon/notebooks/popmon_tutorial_incremental_data.ipynb\n.. |notebook_reports_colab| image:: https://colab.research.google.com/assets/colab-badge.svg\n    :alt: Open in Colab\n    :target: https://colab.research.google.com/github/ing-bank/popmon/blob/master/popmon/notebooks/popmon_tutorial_reports.ipynb\n.. |downloads| image:: https://pepy.tech/badge/popmon\n    :alt: PyPi downloads\n    :target: https://pepy.tech/project/popmon\n\n.. _profiles: https://popmon.readthedocs.io/en/latest/profiles.html\n.. _comparisons: https://popmon.readthedocs.io/en/latest/comparisons.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fing-bank%2Fpopmon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fing-bank%2Fpopmon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fing-bank%2Fpopmon/lists"}