Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on:
on:
push: {}
pull_request: {}
workflow_dispatch: {}
Expand All @@ -21,7 +21,7 @@ jobs:
python-version: "3.10"
- name: Install pre-commit
run: |
pip install --upgrade pip
pip install --upgrade pip
pip install pre-commit
- name: Run pre-commit steps
run: |
Expand All @@ -39,7 +39,7 @@ jobs:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade pip
pip install -e .[dev]
- name: Run tests
run: |
Expand All @@ -62,8 +62,8 @@ jobs:
test-packaging:
name: Test packaging
runs-on: ubuntu-latest
steps:

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
Expand All @@ -72,7 +72,7 @@ jobs:
python-version: "3.10"
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade pip
pip install build twine
- name: Build package
run: |
Expand All @@ -84,14 +84,14 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
os:
- ubuntu-latest
- windows-latest
- macos-latest
include:
- experimental: false

name: Test python-${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
Expand All @@ -104,7 +104,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade pip
pip install -e .[dev]
- name: Run tests
run: |
Expand Down
1 change: 0 additions & 1 deletion changelog/100.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/101.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/102.feature.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/108.feature.rst

This file was deleted.

6 changes: 0 additions & 6 deletions changelog/109.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/113.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/114.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/77.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/86.feature.rst

This file was deleted.

28 changes: 28 additions & 0 deletions docs/release_notes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@ Breaking changes may occur between minor versions prior to the v1 release; after

.. towncrier release notes start

0.3.0
------

Features
~~~~~~~~

- Addresses #77 by removing Aequitas and replacing with a great_tables based fairness audit. (`#77 <https://github.com/epic-open-source/seismometer/issues/77>`__)
- Added ExploreBinaryModelMetrics to see plots of individual metrics, including number needed to treat. (`#86 <https://github.com/epic-open-source/seismometer/issues/86>`__)
- Reorganize methods making initial import and public api more standard (`#102 <https://github.com/epic-open-source/seismometer/issues/102>`__)
- Includes confusion matrix rates into Binary Fairness metrics (`#108 <https://github.com/epic-open-source/seismometer/issues/108>`__)
- Renames `Flagged` to `Flag Rate` for clarity (`#108 <https://github.com/epic-open-source/seismometer/issues/108>`__)
- Add function to load example datasets (`#113 <https://github.com/epic-open-source/seismometer/issues/113>`__)


Bugfixes
~~~~~~~~

- Remove remaining references to -1 'invalidation'; validate directly on time comparison when needed (`#100 <https://github.com/epic-open-source/seismometer/issues/100>`__)
- Fixes scaling issue for binary classfier scores that use the range 0-100 rather than 0-1. (`#101 <https://github.com/epic-open-source/seismometer/issues/101>`__)
- Fixes a few minor ux issues. (`#109 <https://github.com/epic-open-source/seismometer/issues/109>`__)

- Disable dropdowns with only one valid option.
- Fix the Sensitivity/Specificity/PPV plot to move the label to the lower right.
- Fix the Legend in the new Fairness Audit table to improve readability.
- Add right border to the count column.
- Remove NotebookHost class that was no longer in use. (`#114 <https://github.com/epic-open-source/seismometer/issues/114>`__)


0.2.2
-----

Expand Down
45 changes: 28 additions & 17 deletions docs/roadmap/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Roadmap
Contributions
=============

As an open-source project, we welcome community contributions to ``seismometer``.
As an open-source project, we welcome community contributions to ``seismometer``.
Ultimately, we want this project to be a community-led effort to codify guidelines
for ensuring the equitable and informed use of machine learning and AI tools in the
healthcare space. Contributions to this project can be as simple as fixing typos or
small bugs, or more complex contributions that, with the support and scrutiny of our
for ensuring the equitable and informed use of machine learning and AI tools in the
healthcare space. Contributions to this project can be as simple as fixing typos or
small bugs, or more complex contributions that, with the support and scrutiny of our
development team, guide the overall direction of the project.

.. seealso::
Expand All @@ -23,20 +23,20 @@ Use Cases
Templates
---------

As of ``v0.1.0``, ``seismometer`` supports evaluating model performance using standardized evaluation
criteria binary classifier models. We plan to add support in the near future for other types of
machine learning models, such as multiple classifier models. Similarly, we plan to add
As of ``v0.1.0``, ``seismometer`` supports evaluating model performance using standardized evaluation
criteria binary classifier models. We plan to add support in the near future for other types of
machine learning models, such as multiple classifier models. Similarly, we plan to add
support for validating generative AI models. These enhancements will include changes to
the underlying ``seismometer`` tooling, as well as adding new templates for validating
generative models.
generative models.

Workflows and Pre-Live Evaluation
---------------------------------

As of ``v0.1.0``, ``seismometer`` has limited support for evaluating model performance pre-live.
We are planning to add support for workflow simulation (e.g., estimating the number of
alerts that would be shown to end-users for a clinical model that predicts an adverse
event, or the amount of time saved per clinician for a generative model that drafts
We are planning to add support for workflow simulation (e.g., estimating the number of
alerts that would be shown to end-users for a clinical model that predicts an adverse
event, or the amount of time saved per clinician for a generative model that drafts
messages to patients) based on particular thresholds. We will also add tools to identify
thresholds for models based on pre-live data and operational goals. These tools are intended
to help identify when a machine learning or artificial intelligence solutions will improve
Expand All @@ -45,8 +45,8 @@ current workflows and also improve efficiency when integrating models into a wor
Comparing to Baselines
----------------------

We plan to add support for comparing model performance to baseline statistics (e.g., statistics
from a model train or from model performance at a separate site). These are intended to verify
We plan to add support for comparing model performance to baseline statistics (e.g., statistics
from a model train or from model performance at a separate site). These are intended to verify
that the model feature or target drift are not adversely affecting the model's performance after
it goes live.

Expand All @@ -56,14 +56,14 @@ Functional changes
Visualizations
--------------

As ``seismometer`` grows, we will add support for new types of visualizations. Our initial focus
is to improve visualizations for interventions and outcomes stratified by sensitive groups, but
As ``seismometer`` grows, we will add support for new types of visualizations. Our initial focus
is to improve visualizations for interventions and outcomes stratified by sensitive groups, but
we plan to extend our model performance visualizations as well.

Data Layer
----------

As of ``v0.1.0``, ``seismometer`` supports reading data from `parquet` files, which contain data
As of ``v0.1.0``, ``seismometer`` supports reading data from `parquet` files, which contain data
type information and performance improvements that standard CSV data does not have. We plan to add
support for more file formats (alongside metadata files that will describe the data types) as well
as support for reading data directly from a database (e.g., through an ODBC connection).
Expand All @@ -77,4 +77,15 @@ which the goal will be to minimize those breaking changes and only release break
a major version bump.

.. seealso::
:ref:`release` for our Release Notes and any breaking changes.
:ref:`release` for our Release Notes and any breaking changes.


Technical Plans
===============

Some changes are known to have potential impact on using the package, such as changing supported python
versions. As these arise, issues will be created using the `label 'compatibility'`_ for ease of discovery. This
is distinct from large functional enhancements using a `request for change process`_.

.. _label 'compatibility': https://github.com/epic-open-source/seismometer/labels/compatibility
.. _request for change process: https://github.com/epic-open-source/seismometer-rfcs
7 changes: 3 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[metadata]
name = seismometer
version = 0.2.2
version = 0.3.0
description = seismometer: Data Science visualization and investigation tools for AI Trust & Assurance
author = Epic
author_email = OpenSourceContributions-Python@epic.com
license_files = LICENSE.txt
license = BSD 3-Clause
classifiers =
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Expand All @@ -25,7 +25,7 @@ packages =
find_namespace:
include_package_data = True
install_requires =
numpy>=1.26,<2 # >1.26 for python 3.12+
numpy>=1.26,<3
ipython>=8.14
ipywidgets>=8.0
jupyterlab>=4.2.5,<5
Expand All @@ -37,7 +37,6 @@ install_requires =
pydantic>=2.6.3,<3
ydata-profiling>=4.8.3,<5
great-tables>=0.11.0,<1
numba<0.59

[options.packages.find]
where = src
Expand Down
4 changes: 2 additions & 2 deletions src/seismometer/data/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@ def notin(cls, column, values) -> "FilterRule":
@classmethod
def isna(cls, column) -> "FilterRule":
"""
FilterRule where the column contains a na value (np.NaN or None).
FilterRule where the column contains a na value (np.nan or None).
"""
return cls(column, "isna")

@classmethod
def notna(cls, column) -> "FilterRule":
"""
FilterRule where the column does not contain a na value (np.NaN or None).
FilterRule where the column does not contain a na value (np.nan or None).
"""
return cls(column, "notna")

Expand Down
2 changes: 1 addition & 1 deletion src/seismometer/data/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __call__(self, dataframe: pd.DataFrame, metric_names: list[str] = None, **kw
raise ValueError(f"Invalid metric names: {set(metric_names) - set(self.metric_names)}")
if len(dataframe) == 0:
# Universal defaults, if no data frame, return NaN
return {name: np.NaN for name in metric_names}
return {name: np.nan for name in metric_names}
full_metrics = self.delegate_call(dataframe, metric_names, **kwargs)
filtered_metrics = {k: v for k, v in full_metrics.items() if k in metric_names}
return filtered_metrics
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def test_generate_metrics_init_correctly(self):
def test_generate_metrics_empty_dataframe(self):
metric = undertest.MetricGenerator(["test_metric"], lambda data, names: {"test_metric": 1})
assert metric.metric_names == ["test_metric"]
assert metric(pd.DataFrame()) == {"test_metric": np.NaN}
assert metric(pd.DataFrame()) == {"test_metric": np.nan}

def test_generate_named_metrics(self):
metric = undertest.MetricGenerator(["metric1", "metric2"], lambda data, names: {name: 1 for name in names})
Expand Down