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
12 changes: 12 additions & 0 deletions docs/source/api_reference/detectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ The {mod}`frouros.detectors` module contains drift detection algorithms.
:template: class.md

CUSUM
CUSUMConfig
GeometricMovingAverage
GeometricMovingAverageConfig
PageHinkley
PageHinkleyConfig
```

### DDM Based
Expand All @@ -54,12 +57,19 @@ The {mod}`frouros.detectors` module contains drift detection algorithms.
:template: class.md

DDM
DDMConfig
ECDDWT
ECDDWTConfig
EDDM
EDDMConfig
HDDMA
HDDMAConfig
HDDMW
HDDMWConfig
RDDM
RDDMConfig
STEPD
STEPDConfig
```

### Window Based
Expand All @@ -76,7 +86,9 @@ The {mod}`frouros.detectors` module contains drift detection algorithms.
:template: class.md

ADWIN
ADWINConfig
KSWIN
KSWINConfig
```

## Data drift
Expand Down
61 changes: 61 additions & 0 deletions docs/source/api_reference/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,64 @@

```{currentmodule} frouros.utils
```

## Data structures

```{eval-rst}
.. automodule:: frouros.utils.data_structures
:no-members:
:no-inherited-members:
```

```{eval-rst}
.. autosummary::
:toctree: auto_generated/
:template: class.md

EmptyQueueError
CircularQueue
AccuracyQueue
```

## Decorators

```{eval-rst}
.. automodule:: frouros.utils.decorators
:no-members:
:no-inherited-members:
```

```{eval-rst}
.. autosummary::
:toctree: auto_generated/
:template: function.md

check_func_parameters
```

## Stats

```{eval-rst}
.. automodule:: frouros.utils.stats
:no-members:
:no-inherited-members:
```

```{eval-rst}
.. autosummary::
:toctree: auto_generated/
:template: class.md

Stat
IncrementalStat
Mean
EWMA
```

```{eval-rst}
.. autosummary::
:toctree: auto_generated/
:template: function.md

permutation
```
11 changes: 5 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@
"sphinx.ext.autosectionlabel",
"sphinx.ext.autosummary",
"sphinx.ext.duration",
"myst_nb",
"sphinxcontrib.bibtex",
"myst_nb",
]

bibtex_bibfiles = ["references.bib"]

# Use bootstrap CSS from theme.
panels_add_bootstrap_css = False

Expand Down Expand Up @@ -95,11 +93,11 @@
autosummary_generate = True

autodoc_default_options = {
"members": True,
"inherited-members": True,
"member-order": "bysource",
"inherited-members": True,
"private-members": False,
}
autoclass_content = 'both'
autoclass_content = "class"

myst_enable_extensions = [
"amsmath",
Expand All @@ -117,4 +115,5 @@
nb_merge_streams = True

# sphinxcontrib-bibtex configuration
bibtex_bibfiles = ["references.bib"]
bibtex_default_style = "plain"
8 changes: 7 additions & 1 deletion frouros/datasets/real.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@


class Elec2(Dataset):
"""Elec2 dataset class."""
"""Elec2 dataset [harries1999splice]_.

:References:

.. [harries1999splice] Harries, Michael.
"Splice-2 comparative evaluation: Electricity pricing." (1999).
"""

def __init__(self, file_path: Optional[str] = None) -> None:
"""Init method.
Expand Down
10 changes: 9 additions & 1 deletion frouros/datasets/synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@


class SEA(Generator):
"""SEA generator class."""
"""SEA generator [street2001streaming]_.

:References:

.. [street2001streaming] Street, W. Nick, and YongSeog Kim.
"A streaming ensemble algorithm (SEA) for large-scale classification."
Proceedings of the seventh ACM SIGKDD international conference on Knowledge
discovery and data mining. 2001.
"""

block_map = {1: 8.0, 2: 9.0, 3: 7.0, 4: 9.5}

Expand Down
18 changes: 16 additions & 2 deletions frouros/detectors/concept_drift/cusum_based/cusum.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@


class CUSUMConfig(CUSUMBaseConfig, DeltaConfig):
"""CUSUM configuration class."""
"""CUSUM [page1954continuous]_ configuration.

:References:

.. [page1954continuous] Page, Ewan S.
"Continuous inspection schemes."
Biometrika 41.1/2 (1954): 100-115.
"""

def __init__(
self,
Expand All @@ -35,7 +42,14 @@ def __init__(


class CUSUM(CUSUMBase):
"""CUSUM algorithm class."""
"""CUSUM [page1954continuous]_ detector.

:References:

.. [page1954continuous] Page, Ewan S.
"Continuous inspection schemes."
Biometrika 41.1/2 (1954): 100-115.
"""

config_type = CUSUMConfig # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@


class GeometricMovingAverageConfig(CUSUMBaseConfig, AlphaConfig):
"""Geometric Moving Average configuration class."""
"""Geometric Moving Average [robertst1959control]_ configuration.

:References:

.. [robertst1959control] Roberts, S. W.
“Control Chart Tests Based on Geometric Moving Averages.”
Technometrics, vol. 1, no. 3, 1959, pp. 239–50.
JSTOR, https://doi.org/10.2307/1266443.
"""

def __init__(
self,
Expand All @@ -33,7 +41,15 @@ def __init__(


class GeometricMovingAverage(CUSUMBase):
"""Geometric Moving Average algorithm class."""
"""Geometric Moving Average [robertst1959control]_ detector.

:References:

.. [robertst1959control] Roberts, S. W.
“Control Chart Tests Based on Geometric Moving Averages.”
Technometrics, vol. 1, no. 3, 1959, pp. 239–50.
JSTOR, https://doi.org/10.2307/1266443.
"""

config_type = GeometricMovingAverageConfig # type: ignore

Expand Down
18 changes: 16 additions & 2 deletions frouros/detectors/concept_drift/cusum_based/page_hinkley.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@


class PageHinkleyConfig(CUSUMBaseConfig, DeltaConfig, AlphaConfig):
"""Page Hinkley configuration class."""
"""Page Hinkley [page1954continuous]_ configuration.

:References:

.. [page1954continuous] Page, Ewan S.
"Continuous inspection schemes."
Biometrika 41.1/2 (1954): 100-115.
"""

def __init__(
self,
Expand Down Expand Up @@ -38,7 +45,14 @@ def __init__(


class PageHinkley(CUSUMBase):
"""Page Hinkley algorithm class."""
"""Page Hinkley [page1954continuous]_ detector.

:References:

.. [page1954continuous] Page, Ewan S.
"Continuous inspection schemes."
Biometrika 41.1/2 (1954): 100-115.
"""

config_type = PageHinkleyConfig # type: ignore

Expand Down
22 changes: 20 additions & 2 deletions frouros/detectors/concept_drift/ddm_based/ddm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,29 @@


class DDMConfig(DDMBaseConfig):
"""DDM (Drift detection method) configuration class."""
"""DDM (Drift detection method) [gama2004learning]_ configuration.

:References:

.. [gama2004learning] Gama, Joao, et al.
"Learning with drift detection."
Advances in Artificial Intelligence–SBIA 2004: 17th Brazilian Symposium on
Artificial Intelligence, Sao Luis, Maranhao, Brazil, September 29-Ocotber 1,
2004. Proceedings 17. Springer Berlin Heidelberg, 2004.
"""


class DDM(DDMErrorBased):
"""DDM (Drift detection method) algorithm class."""
"""DDM (Drift detection method) [gama2004learning]_ detector.

:References:

.. [gama2004learning] Gama, Joao, et al.
"Learning with drift detection."
Advances in Artificial Intelligence–SBIA 2004: 17th Brazilian Symposium on
Artificial Intelligence, Sao Luis, Maranhao, Brazil, September 29-Ocotber 1,
2004. Proceedings 17. Springer Berlin Heidelberg, 2004.
"""

config_type = DDMConfig

Expand Down
18 changes: 16 additions & 2 deletions frouros/detectors/concept_drift/ddm_based/ecdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,25 @@


class ECDDWTConfig(ECDDBaseConfig):
"""ECDD-WT (EWMA for Concept Drift Detection with Warning) configuration class."""
"""ECDDWT (EWMA Concept Drift Detection Warning) [ross2012exponentially]_ configuration.

:References:

.. [ross2012exponentially] Ross, Gordon J., et al.
"Exponentially weighted moving average charts for detecting concept drift."
Pattern recognition letters 33.2 (2012): 191-198.
"""


class ECDDWT(DDMBased):
"""ECDD-WT (EWMA for Concept Drift Detection with Warning) algorithm class."""
"""ECDDWT (EWMA Concept Drift Detection Warning) [ross2012exponentially]_ detector.

:References:

.. [ross2012exponentially] Ross, Gordon J., et al.
"Exponentially weighted moving average charts for detecting concept drift."
Pattern recognition letters 33.2 (2012): 191-198.
"""

config_type = ECDDWTConfig # type: ignore

Expand Down
18 changes: 16 additions & 2 deletions frouros/detectors/concept_drift/ddm_based/eddm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@


class EDDMConfig(DDMBaseConfig):
"""EDDM (Early drift detection method) configuration class."""
"""EDDM (Early drift detection method) [baena2006early]_ configuration.

:References:

.. [baena2006early] Baena-Garcıa, Manuel, et al. "Early drift detection method."
Fourth international workshop on knowledge discovery from data streams.
Vol. 6. 2006.
"""

def __init__(
self,
Expand Down Expand Up @@ -124,7 +131,14 @@ def min_num_misclassified_instances(self, value: int) -> None:


class EDDM(DDMBased):
"""EDDM (Early drift detection method) algorithm class."""
"""EDDM (Early drift detection method) [baena2006early]_ detector.

:References:

.. [baena2006early] Baena-Garcıa, Manuel, et al. "Early drift detection method."
Fourth international workshop on knowledge discovery from data streams.
Vol. 6. 2006.
"""

config_type = EDDMConfig # type: ignore

Expand Down
Loading