Skip to content

Commit

Permalink
feat: Update DDM to work for classification & regression (#26)
Browse files Browse the repository at this point in the history
* feat: Implement DDM to work for classification & regression

* feat: Implement DDM to work for classification & regression
  • Loading branch information
kajanan1212 authored Mar 9, 2024
1 parent 42e27ea commit b37d028
Show file tree
Hide file tree
Showing 54 changed files with 290 additions and 426 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions examples/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ def datetime_from_string(datetime_string: str) -> datetime:

if __name__ == "__main__":
historical_data_starting_from = datetime_from_string("2021-10-01")
historical_data_ending_at = datetime_from_string("2021-10-10")
streaming_data_starting_from = datetime_from_string("2021-10-10")
streaming_data_ending_at = datetime_from_string("2021-11-01")
historical_data_ending_at = datetime_from_string("2022-01-01")
streaming_data_starting_from = datetime_from_string("2022-01-01")
streaming_data_ending_at = datetime_from_string("2022-08-01")
time_interval = 60
active_strategy = True
cdd_strategy = DDM(
warning_level=2,
warning_level=0.1,
drift_level=3,
min_num_instances=5,
min_num_instances=2,
)
folder_path_to_save_result = "../experiments"
experiment_label = "m-xgb-s-xgb_model"
experiment_label = "m-xgb-s-xgb_model-d-batch_r2"

run_exp(
hist_start=historical_data_starting_from,
Expand Down
3 changes: 2 additions & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from . import ( # noqa F401
from . import (
concept_drift_detector,
datasets,
log_handler,
models,
Expand Down
9 changes: 8 additions & 1 deletion src/concept_drift_detector/concept_drift_detector.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
from pandas import DataFrame
from src.concept_drift_detector.strategies.istrategy import IStrategy
# from src.models.base_models import BaseModel


class CDD:
def __init__(self, strategy: IStrategy) -> None:
self._strategy = strategy

def is_concept_drift_detected(self, model, ni_x, ni_y) -> bool:
def is_concept_drift_detected(
self,
model,
ni_x: DataFrame,
ni_y: DataFrame,
) -> bool:
return self.strategy.is_concept_drift_detected(model, ni_x, ni_y)

@property
Expand Down
226 changes: 0 additions & 226 deletions src/concept_drift_detector/input.csv

This file was deleted.

Loading

0 comments on commit b37d028

Please sign in to comment.