Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ ignore:
- "*/tests/.*"
- "setup.cfg"
- "setup.py"
- "pyproject.toml"
- "pyproject.toml"
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ omit =
*/setup.py
*/__init__.py
*/frouros/setup.py
*/frouros/tests/*
*/frouros/tests/*
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ is merged. See https://github.com/blog/1506-closing-issues-via-pull-requests
#### Any other comments?


<!--Thanks for contributing!-->
<!--Thanks for contributing!-->
34 changes: 26 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,21 @@ on:
- "*"

jobs:
python-version:
runs-on: ubuntu-22.04
version:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.9',
'3.10',
'3.11',
'3.12',]
os: [
ubuntu-22.04,
windows-2022,
macos-12,
]
python-version: [
'3.9',
'3.10',
'3.11',
'3.12',
]

steps:
- name: Checkout
Expand All @@ -29,11 +36,22 @@ jobs:
python -m pip install --upgrade pip
python -m pip install setuptools==68.2.2 tox==4.12.0 tox-gh-actions==3.2.0

- name: Optional - Install frouros (only used by linters)
if: matrix.python-version == 3.9
- name: Create virtual environment
run: |
python -m venv .venv

- name: Activate virtual environment (Windows)
if: matrix.os == 'windows-2022'
run: |
.venv\Scripts\activate

- name: Activate virtual environment (Linux/macOS)
if: matrix.os != 'windows-2022'
run: |
source .venv/bin/activate

- name: Install frouros
run: |
pip install "pytest>=7.4.4,<7.5"
pip install -e .

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "frouros"
project-slug: "frouros"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ docs/source/api_reference/*/auto_generated/
docs/source/api_reference/*/*/auto_generated/

# Tests
test-result.xml
test-result.xml
46 changes: 46 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
default_language_version:
python: python3.9
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-docstring-first
- id: check-merge-conflict
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: no-commit-to-branch
args: ["--branch", "main"]
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
types_or: [
python,
pyi,
jupyter,
]
args: [--fix]
- id: ruff-format
types_or: [
python,
pyi,
jupyter,
]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
args: [
--strict,
--ignore-missing-imports,
--disable-error-code=misc,
--disable-error-code=no-any-return,
]
additional_dependencies: [
types-requests<2.32,
types-toml<0.11,
types-tqdm<4.67,
]
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ preferred-citation:
orcid: "https://orcid.org/0000-0002-0013-4602"
journal: "arXiv preprint arXiv:2208.06868"
title: "Frouros: A Python library for drift detection in machine learning systems"
year: 2022
year: 2022
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# CODEOWNERS file

* @jaime-cespedes-sisniega
* @jaime-cespedes-sisniega
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,16 @@ Recommended steps for first time contributors:
git pull
pip install -e .
```
4. After adding and committing your fix or feature, ensure that code coverage is at least 90% (otherwise the PR will be rejected) and that linting is successfully executed using the following command:
4. (Optional but recommended) Install pre-commit hooks:
```bash
pip install pre-commit
pre-commit install
```
5. After adding and committing your fix or feature, ensure that code coverage is at least 90% (otherwise the PR will be rejected) and that linting is successfully executed using the following command:
```bash
tox
```
5. Create pull request to the original repository.
6. Create a pull request to the original repository.

## Reporting a bug

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include LICENSE
include LICENSE
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<a href="https://pepy.tech/project/frouros">
<img src="https://static.pepy.tech/badge/frouros" alt="downloads"/>
</a>
<!-- Platform -->
<a href="https://github.com/IFCA-Advanced-Computing/frouros">
<img src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-blue.svg" alt="downloads"/>
</a>
<!-- PyPI -->
<a href="https://pypi.org/project/frouros">
<img src="https://img.shields.io/pypi/v/frouros.svg?label=release&color=blue" alt="pypi">
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api_reference/callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ The {mod}`frouros.callbacks` module contains callbacks.

callbacks/batch
callbacks/streaming
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/callbacks/streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ The {mod}`frouros.callbacks.streaming` module contains streaming callbacks.
:template: class.md

HistoryConceptDrift
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ The {mod}`frouros.datasets` module contains datasets.

datasets/real
datasets/synthetic
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/detectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ The {mod}`frouros.detectors` module contains detection algorithms.

detectors/concept_drift
detectors/data_drift
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/detectors/concept_drift.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ The {mod}`frouros.detectors.concept_drift` module contains concept drift detecti
:maxdepth: 2

concept_drift/streaming
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ The {mod}`frouros.detectors.concept_drift.streaming` module contains streaming c
KSWINConfig
STEPD
STEPDConfig
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/detectors/data_drift.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ The {mod}`frouros.detectors.batch` module contains data drift detection algorith

data_drift/batch
data_drift/streaming
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/detectors/data_drift/batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ The {mod}`frouros.detectors.data_drift.batch` module contains batch data drift d
KuiperTest
MannWhitneyUTest
WelchTTest
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ The {mod}`frouros.detectors.data_drift.streaming` module contains streaming data
:template: class.md

IncrementalKSTest
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ utils/data_structures
utils/kernels
utils/persistence
utils/stats
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/utils/checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ The {mod}`frouros.utils.checks` module contains auxiliary checks functions.
.. automodule:: frouros.utils.checks
:members:
:no-inherited-members:
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/utils/data_structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ The {mod}`frouros.utils.data_structures` module contains auxiliary data structur
.. automodule:: frouros.utils.data_structures
:members:
:no-inherited-members:
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/utils/kernels.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ The {mod}`frouros.utils.kernels` module contains auxiliary kernel functions.
.. automodule:: frouros.utils.kernels
:members:
:no-inherited-members:
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/utils/persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ The {mod}`frouros.utils.persistence` module contains auxiliary functions to pers
.. automodule:: frouros.utils.persistence
:members:
:no-inherited-members:
```
```
2 changes: 1 addition & 1 deletion docs/source/api_reference/utils/stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ The {mod}`frouros.utils.stats` module contains auxiliary stats classes or except
.. automodule:: frouros.utils.stats
:members:
:no-inherited-members:
```
```
6 changes: 3 additions & 3 deletions docs/source/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ for detecting *dataset shift* using only the feature/covariate distributions.

Therefore, the problem statement can be defined as follows:

Given a time period ${[0, t]}$, a set of sample-pairs ${D=\{(X_{0}, y_{0}),...,(X_{t}, y_{t})\}}$, where ${X_{i} \in \mathbb{R}^{m}}$ is the ${m}$-dimensional feature vector and ${y_{i} \in \mathbb{R}^{k}}$ is the ${k}$-class vector (using *one-hot encoding*) if we are dealing with a classification problem or ${y_{i} \in \mathbb{R}}$ is a scalar if it is a regression problem, ${D}$ is used to fit ${\hat{f} \colon X \to Y}$ (known as model) to be as close as possible to the unknown ${{f} \colon X \to Y}$. *Machine learning* algorithms are typically used for this fitting procedure.
Given a time period ${[0, t]}$, a set of sample-pairs ${D=\{(X_{0}, y_{0}),...,(X_{t}, y_{t})\}}$, where ${X_{i} \in \mathbb{R}^{m}}$ is the ${m}$-dimensional feature vector and ${y_{i} \in \mathbb{R}^{k}}$ is the ${k}$-class vector (using *one-hot encoding*) if we are dealing with a classification problem or ${y_{i} \in \mathbb{R}}$ is a scalar if it is a regression problem, ${D}$ is used to fit ${\hat{f} \colon X \to Y}$ (known as model) to be as close as possible to the unknown ${{f} \colon X \to Y}$. *Machine learning* algorithms are typically used for this fitting procedure.
${(X_{i}, y_{i}) \notin D}$ samples obtained in ${[t+1, \infty)}$ and used by ${\hat{f}}$ may start to differ with respect to ${D}$ pairs from a statistical point of view. It is also possible that some changes occur in terms of concept of the problem (change in ${f}$).

Since ${P(y, X) = P(y|X) P(X)}$ {cite}`moreno2012unifying`, a change in the joint distribution between two different times that can produce some performance degradation can be described as follows:
Expand Down Expand Up @@ -41,9 +41,9 @@ Drift detection methods can be classified according to the type of drift they ca

### Concept drift

Their main objective is to **detect concept drift**. They are closely related to data stream mining, online and incremental learning.
Their main objective is to **detect concept drift**. They are closely related to data stream mining, online and incremental learning.

At the time of writing this, Frouros only implements *concept drift* detectors that work in a {doc}`streaming </api_reference/detectors/concept_drift/streaming>` manner. This means that the detector can only be updated with a single sample each time.
At the time of writing this, Frouros only implements *concept drift* detectors that work in a {doc}`streaming </api_reference/detectors/concept_drift/streaming>` manner. This means that the detector can only be updated with a single sample each time.

### Data drift

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
author = "Spanish National Research Council (CSIC)"

# The full version, including alpha/beta/rc tags
CURRENT_VERSION = f'v{frouros.__version__}'
CURRENT_VERSION = f"v{frouros.__version__}"

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/source/contribute.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
```{include} ../../CONTRIBUTING.md
```
```
2 changes: 1 addition & 1 deletion docs/source/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
examples/concept_drift
examples/data_drift
examples/utils
```
```
2 changes: 1 addition & 1 deletion docs/source/examples/concept_drift.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

concept_drift/DDM_simple
concept_drift/DDM_advance
```
```
Loading