diff --git a/docs/api/index.rst b/docs/api/index.rst index c94cc889..62072079 100644 --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -16,19 +16,22 @@ capymoa. .. autosummary:: :toctree: modules + :caption: Types :recursive: capymoa.base capymoa.type_alias capymoa.instance -Datastreams ------------ +Data Streams +------------ -These modules provide classes for handling datastreams. +These modules provide classes for loading, and simulating data streams. It also +includes utilities for simulating concept drifts. .. autosummary:: :toctree: modules + :caption: Data Streams :recursive: capymoa.datasets @@ -42,6 +45,7 @@ and semi-supervised learning. .. autosummary:: :toctree: modules + :caption: Learners :recursive: capymoa.classifier @@ -49,6 +53,18 @@ and semi-supervised learning. capymoa.anomaly capymoa.ssl +Drift Detection +--------------- + +These modules provide classes for detecting concept drifts. + +.. autosummary:: + :toctree: modules + :caption: Drift Detection + :recursive: + + capymoa.drift + Evaluation ---------- @@ -56,6 +72,7 @@ These modules provide classes for evaluating learners. .. autosummary:: :toctree: modules + :caption: Evaluation :recursive: capymoa.splitcriteria @@ -69,6 +86,7 @@ These modules provide miscellaneous utilities. .. autosummary:: :toctree: modules + :caption: Miscellaneous :recursive: capymoa.misc diff --git a/docs/conf.py b/docs/conf.py index 69376cca..b6c8b66b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,14 +37,15 @@ ] nitpick_ignore_regex = [ - ("py:class", r"sklearn\..*"), - ("py:class", r"numpy\..*"), - ("py:class", r"pathlib\..*"), ("py:class", r"abc\..*"), - ("py:class", r"moa\..*"), ("py:class", r"com\..*"), ("py:class", r"java\..*"), + ("py:class", r"moa\..*"), + ("py:class", r"numpy\..*"), ("py:class", r"org\..*"), + ("py:class", r"pandas\..*"), + ("py:class", r"pathlib\..*"), + ("py:class", r"sklearn\..*"), ("py:class", r"torch\..*"), ] toc_object_entries_show_parents = "hide" diff --git a/src/capymoa/drift/detectors/ddm.py b/src/capymoa/drift/detectors/ddm.py index e3ac857c..984d0879 100644 --- a/src/capymoa/drift/detectors/ddm.py +++ b/src/capymoa/drift/detectors/ddm.py @@ -9,7 +9,7 @@ class DDM(MOADriftDetector): """Drift-Detection-Method (DDM) Drift Detector Example: - ------- + -------- >>> import numpy as np >>> from capymoa.drift.detectors import DDM diff --git a/src/capymoa/drift/detectors/page_hinkley.py b/src/capymoa/drift/detectors/page_hinkley.py index 0db05044..09318ade 100644 --- a/src/capymoa/drift/detectors/page_hinkley.py +++ b/src/capymoa/drift/detectors/page_hinkley.py @@ -31,7 +31,7 @@ class PageHinkley(MOADriftDetector): Reference: ---------- - Page. 1954. Continuous Inspection Schemes. Biometrika 41, 1/2 (1954), + Page. 1954. Continuous Inspection Schemes. Biometrika 41, 1/2 (1954), 100-115. """ diff --git a/src/capymoa/drift/eval_detector.py b/src/capymoa/drift/eval_detector.py index de9ed61d..55587863 100644 --- a/src/capymoa/drift/eval_detector.py +++ b/src/capymoa/drift/eval_detector.py @@ -50,7 +50,7 @@ def __init__(self, max_delay: int): """ :param max_delay: Maximum number of instances to wait for a detection - [after which the drift becomes obvious and the detector is considered to have missed the change] + [after which the drift becomes obvious and the detector is considered to have missed the change] """ self.max_delay = max_delay @@ -71,8 +71,7 @@ def calc_performance(self, preds: ArrayLike, trues: ArrayLike) -> pd.Series: :param preds: (array): detection location (index) values :param trues: (array): actual location (index) of drift. For drifts based on an interval (e.g gradual drifts), - the current approach is to define it using the starting location and the max_delay parameter - + the current approach is to define it using the starting location and the max_delay parameter :return: pd.Series with a performance summary """ diff --git a/src/capymoa/stream/preprocessing/transformer.py b/src/capymoa/stream/preprocessing/transformer.py index 4117c6c3..8524d7b2 100644 --- a/src/capymoa/stream/preprocessing/transformer.py +++ b/src/capymoa/stream/preprocessing/transformer.py @@ -5,7 +5,7 @@ from capymoa.stream import Schema, Stream from capymoa.instance import Instance from moa.streams import FilteredQueueStream -from moa.streams.filters import StreamFilter +import moa.streams.filters class Transformer(ABC): @@ -23,7 +23,13 @@ def restart(self): class MOATransformer(Transformer): - def __init__(self, schema=None, moa_filter: StreamFilter | None = None, CLI=None): + + def __init__( + self, + schema=None, + moa_filter: moa.streams.filters.StreamFilter | None = None, + CLI=None, + ): self.schema = schema self.CLI = CLI self.moa_filter = moa_filter