From 44caba1a7340f30453dc5754aa6fd4be027b01b3 Mon Sep 17 00:00:00 2001 From: Kajanan Selvanesan Date: Sun, 12 May 2024 16:25:24 +0530 Subject: [PATCH 1/2] refactor: Rename src to ibat --- examples/concept_drift_detector/adwin.py | 4 ++-- examples/concept_drift_detector/ddm.py | 4 ++-- examples/concept_drift_detector/page_hinkley.py | 4 ++-- examples/pipeline.py | 6 +++--- {src => ibat}/__init__.py | 0 {src => ibat}/_pipeline.py | 6 +++--- {src => ibat}/concept_drift_detector/__init__.py | 0 .../concept_drift_detector/concept_drift_detector.py | 4 ++-- {src => ibat}/concept_drift_detector/strategies/__init__.py | 0 {src => ibat}/concept_drift_detector/strategies/adwin.py | 2 +- {src => ibat}/concept_drift_detector/strategies/ddm.py | 4 ++-- .../concept_drift_detector/strategies/istrategy.py | 2 +- .../concept_drift_detector/strategies/page_hinkley.py | 2 +- {src => ibat}/datasets/__init__.py | 0 {src => ibat}/datasets/_datasets/bus_dwell_times_654.csv | 0 {src => ibat}/datasets/_datasets/bus_running_times_654.csv | 0 .../_datasets/bus_running_times_feature_added_all.csv | 0 .../datasets/_datasets/bus_stop_times_feature_added_all.csv | 0 .../_datasets/bus_stop_times_feature_encoded_all.csv | 0 {src => ibat}/datasets/datasets.py | 0 {src => ibat}/log_handler.py | 0 {src => ibat}/models/__init__.py | 0 {src => ibat}/models/base_models/__init__.py | 0 {src => ibat}/models/base_models/base_models.py | 2 +- {src => ibat}/models/base_models/ensemble/__init__.py | 0 {src => ibat}/models/base_models/ensemble/adaboost.py | 2 +- {src => ibat}/models/base_models/ensemble/decision_tree.py | 2 +- {src => ibat}/models/base_models/ensemble/hoeffding_tree.py | 2 +- {src => ibat}/models/base_models/ensemble/random_forest.py | 2 +- {src => ibat}/models/base_models/ensemble/sgt.py | 2 +- .../models/base_models/ensemble/streaming_random_patches.py | 2 +- {src => ibat}/models/base_models/ensemble/xgboost.py | 2 +- {src => ibat}/models/base_models/ibase_model.py | 0 {src => ibat}/models/base_models/linear_model/__init__.py | 0 .../models/base_models/linear_model/linear_river_many.py | 2 +- .../models/base_models/linear_model/passive_aggressive.py | 2 +- {src => ibat}/models/base_models/linear_model/perceptron.py | 2 +- {src => ibat}/models/base_models/linear_model/sgd.py | 2 +- {src => ibat}/models/base_models/naive_bayes/__init__.py | 0 {src => ibat}/models/base_models/naive_bayes/naive_bayes.py | 2 +- .../models/base_models/naive_bayes/naive_bayes_river.py | 2 +- {src => ibat}/models/base_models/nn/__init__.py | 0 {src => ibat}/models/base_models/nn/convlstm.py | 0 {src => ibat}/models/base_models/nn/mlp.py | 2 +- {src => ibat}/models/base_models/nn/mlp_river.py | 2 +- {src => ibat}/models/use_cases/__init__.py | 0 {src => ibat}/models/use_cases/arrival_time/__init__.py | 0 {src => ibat}/models/use_cases/arrival_time/bus/__init__.py | 0 {src => ibat}/models/use_cases/arrival_time/bus/mme4bat.py | 6 +++--- {src => ibat}/models/use_cases/dwell_time/__init__.py | 0 {src => ibat}/models/use_cases/dwell_time/bus/__init__.py | 0 {src => ibat}/models/use_cases/dwell_time/bus/mme4bdt.py | 6 +++--- {src => ibat}/pipeline.py | 4 ++-- setup.py | 6 ++---- 54 files changed, 45 insertions(+), 47 deletions(-) rename {src => ibat}/__init__.py (100%) rename {src => ibat}/_pipeline.py (99%) rename {src => ibat}/concept_drift_detector/__init__.py (100%) rename {src => ibat}/concept_drift_detector/concept_drift_detector.py (81%) rename {src => ibat}/concept_drift_detector/strategies/__init__.py (100%) rename {src => ibat}/concept_drift_detector/strategies/adwin.py (94%) rename {src => ibat}/concept_drift_detector/strategies/ddm.py (96%) rename {src => ibat}/concept_drift_detector/strategies/istrategy.py (85%) rename {src => ibat}/concept_drift_detector/strategies/page_hinkley.py (94%) rename {src => ibat}/datasets/__init__.py (100%) rename {src => ibat}/datasets/_datasets/bus_dwell_times_654.csv (100%) rename {src => ibat}/datasets/_datasets/bus_running_times_654.csv (100%) rename {src => ibat}/datasets/_datasets/bus_running_times_feature_added_all.csv (100%) rename {src => ibat}/datasets/_datasets/bus_stop_times_feature_added_all.csv (100%) rename {src => ibat}/datasets/_datasets/bus_stop_times_feature_encoded_all.csv (100%) rename {src => ibat}/datasets/datasets.py (100%) rename {src => ibat}/log_handler.py (100%) rename {src => ibat}/models/__init__.py (100%) rename {src => ibat}/models/base_models/__init__.py (100%) rename {src => ibat}/models/base_models/base_models.py (98%) rename {src => ibat}/models/base_models/ensemble/__init__.py (100%) rename {src => ibat}/models/base_models/ensemble/adaboost.py (87%) rename {src => ibat}/models/base_models/ensemble/decision_tree.py (86%) rename {src => ibat}/models/base_models/ensemble/hoeffding_tree.py (95%) rename {src => ibat}/models/base_models/ensemble/random_forest.py (93%) rename {src => ibat}/models/base_models/ensemble/sgt.py (87%) rename {src => ibat}/models/base_models/ensemble/streaming_random_patches.py (91%) rename {src => ibat}/models/base_models/ensemble/xgboost.py (94%) rename {src => ibat}/models/base_models/ibase_model.py (100%) rename {src => ibat}/models/base_models/linear_model/__init__.py (100%) rename {src => ibat}/models/base_models/linear_model/linear_river_many.py (91%) rename {src => ibat}/models/base_models/linear_model/passive_aggressive.py (92%) rename {src => ibat}/models/base_models/linear_model/perceptron.py (85%) rename {src => ibat}/models/base_models/linear_model/sgd.py (91%) rename {src => ibat}/models/base_models/naive_bayes/__init__.py (100%) rename {src => ibat}/models/base_models/naive_bayes/naive_bayes.py (90%) rename {src => ibat}/models/base_models/naive_bayes/naive_bayes_river.py (91%) rename {src => ibat}/models/base_models/nn/__init__.py (100%) rename {src => ibat}/models/base_models/nn/convlstm.py (100%) rename {src => ibat}/models/base_models/nn/mlp.py (92%) rename {src => ibat}/models/base_models/nn/mlp_river.py (88%) rename {src => ibat}/models/use_cases/__init__.py (100%) rename {src => ibat}/models/use_cases/arrival_time/__init__.py (100%) rename {src => ibat}/models/use_cases/arrival_time/bus/__init__.py (100%) rename {src => ibat}/models/use_cases/arrival_time/bus/mme4bat.py (93%) rename {src => ibat}/models/use_cases/dwell_time/__init__.py (100%) rename {src => ibat}/models/use_cases/dwell_time/bus/__init__.py (100%) rename {src => ibat}/models/use_cases/dwell_time/bus/mme4bdt.py (93%) rename {src => ibat}/pipeline.py (99%) diff --git a/examples/concept_drift_detector/adwin.py b/examples/concept_drift_detector/adwin.py index b44aedb..baa74d6 100644 --- a/examples/concept_drift_detector/adwin.py +++ b/examples/concept_drift_detector/adwin.py @@ -1,7 +1,7 @@ import numpy as np import pandas as pd -from src.concept_drift_detector import CDD -from src.concept_drift_detector.strategies import ADWIN +from ibat.concept_drift_detector import CDD +from ibat.concept_drift_detector.strategies import ADWIN sorted_mean_arrival_time = pd.read_csv("../../asserts/datasets/input.csv") diff --git a/examples/concept_drift_detector/ddm.py b/examples/concept_drift_detector/ddm.py index 163247d..63db256 100644 --- a/examples/concept_drift_detector/ddm.py +++ b/examples/concept_drift_detector/ddm.py @@ -1,8 +1,8 @@ import pandas as pd from xgboost import XGBRegressor from sklearn.pipeline import Pipeline -from src.concept_drift_detector import CDD -from src.concept_drift_detector.strategies import DDM +from ibat.concept_drift_detector import CDD +from ibat.concept_drift_detector.strategies import DDM def split_train_test(split_date, df): diff --git a/examples/concept_drift_detector/page_hinkley.py b/examples/concept_drift_detector/page_hinkley.py index 0e1ef6f..27f3f9b 100644 --- a/examples/concept_drift_detector/page_hinkley.py +++ b/examples/concept_drift_detector/page_hinkley.py @@ -1,7 +1,7 @@ import numpy as np import pandas as pd -from src.concept_drift_detector import CDD -from src.concept_drift_detector.strategies import PageHinkley +from ibat.concept_drift_detector import CDD +from ibat.concept_drift_detector.strategies import PageHinkley sorted_mean_arrival_time = pd.read_csv("../../asserts/datasets/input.csv") diff --git a/examples/pipeline.py b/examples/pipeline.py index 3fa1079..96f7648 100644 --- a/examples/pipeline.py +++ b/examples/pipeline.py @@ -1,8 +1,8 @@ from datetime import datetime -from src.concept_drift_detector.strategies import DDM -from src.datasets import BUS_654_FEATURES_ENCODED_DWELL_TIMES -from src.pipeline import run_dt_exp +from ibat.concept_drift_detector.strategies import DDM +from ibat.datasets import BUS_654_FEATURES_ENCODED_DWELL_TIMES +from ibat.pipeline import run_dt_exp def datetime_from_string(datetime_string: str) -> datetime: diff --git a/src/__init__.py b/ibat/__init__.py similarity index 100% rename from src/__init__.py rename to ibat/__init__.py diff --git a/src/_pipeline.py b/ibat/_pipeline.py similarity index 99% rename from src/_pipeline.py rename to ibat/_pipeline.py index 4b2a2fd..e59f712 100644 --- a/src/_pipeline.py +++ b/ibat/_pipeline.py @@ -13,12 +13,12 @@ mean_absolute_percentage_error, root_mean_squared_error, ) -from src.concept_drift_detector.strategies import IStrategy -from src.datasets import ( +from ibat.concept_drift_detector.strategies import IStrategy +from ibat.datasets import ( BUS_654_FEATURES_ADDED_RUNNING_TIMES, BUS_654_FEATURES_ENCODED_DWELL_TIMES, ) -from src.models.use_cases.arrival_time.bus import MME4BAT +from ibat.models.use_cases.arrival_time.bus import MME4BAT def run_exp( diff --git a/src/concept_drift_detector/__init__.py b/ibat/concept_drift_detector/__init__.py similarity index 100% rename from src/concept_drift_detector/__init__.py rename to ibat/concept_drift_detector/__init__.py diff --git a/src/concept_drift_detector/concept_drift_detector.py b/ibat/concept_drift_detector/concept_drift_detector.py similarity index 81% rename from src/concept_drift_detector/concept_drift_detector.py rename to ibat/concept_drift_detector/concept_drift_detector.py index 84893da..c062c6d 100644 --- a/src/concept_drift_detector/concept_drift_detector.py +++ b/ibat/concept_drift_detector/concept_drift_detector.py @@ -1,7 +1,7 @@ from pandas import DataFrame -from src.concept_drift_detector.strategies.istrategy import IStrategy +from ibat.concept_drift_detector.strategies.istrategy import IStrategy -# from src.models.base_models import BaseModel +# from ibat.models.base_models import BaseModel class CDD: diff --git a/src/concept_drift_detector/strategies/__init__.py b/ibat/concept_drift_detector/strategies/__init__.py similarity index 100% rename from src/concept_drift_detector/strategies/__init__.py rename to ibat/concept_drift_detector/strategies/__init__.py diff --git a/src/concept_drift_detector/strategies/adwin.py b/ibat/concept_drift_detector/strategies/adwin.py similarity index 94% rename from src/concept_drift_detector/strategies/adwin.py rename to ibat/concept_drift_detector/strategies/adwin.py index 1630c9a..68d8a9f 100644 --- a/src/concept_drift_detector/strategies/adwin.py +++ b/ibat/concept_drift_detector/strategies/adwin.py @@ -2,7 +2,7 @@ from river.drift import ADWIN as rADWIN from matplotlib import gridspec, pyplot as plt -from src.concept_drift_detector.strategies.istrategy import IStrategy +from ibat.concept_drift_detector.strategies.istrategy import IStrategy class ADWIN(IStrategy): diff --git a/src/concept_drift_detector/strategies/ddm.py b/ibat/concept_drift_detector/strategies/ddm.py similarity index 96% rename from src/concept_drift_detector/strategies/ddm.py rename to ibat/concept_drift_detector/strategies/ddm.py index c700b0f..ff2feba 100644 --- a/src/concept_drift_detector/strategies/ddm.py +++ b/ibat/concept_drift_detector/strategies/ddm.py @@ -4,9 +4,9 @@ from sklearn.metrics import accuracy_score, mean_absolute_percentage_error, r2_score from frouros.detectors.concept_drift import DDM as fDDM, DDMConfig from frouros.metrics import PrequentialError -from src.concept_drift_detector.strategies.istrategy import IStrategy +from ibat.concept_drift_detector.strategies.istrategy import IStrategy -# from src.models.base_models import BaseModel +# from ibat.models.base_models import BaseModel class DDM(IStrategy): diff --git a/src/concept_drift_detector/strategies/istrategy.py b/ibat/concept_drift_detector/strategies/istrategy.py similarity index 85% rename from src/concept_drift_detector/strategies/istrategy.py rename to ibat/concept_drift_detector/strategies/istrategy.py index 3e03b42..72c6902 100644 --- a/src/concept_drift_detector/strategies/istrategy.py +++ b/ibat/concept_drift_detector/strategies/istrategy.py @@ -3,7 +3,7 @@ from pandas import DataFrame -# from src.models.base_models.base_models import BaseModel +# from ibat.models.base_models.base_models import BaseModel class IStrategy: diff --git a/src/concept_drift_detector/strategies/page_hinkley.py b/ibat/concept_drift_detector/strategies/page_hinkley.py similarity index 94% rename from src/concept_drift_detector/strategies/page_hinkley.py rename to ibat/concept_drift_detector/strategies/page_hinkley.py index 6452435..bbb661f 100644 --- a/src/concept_drift_detector/strategies/page_hinkley.py +++ b/ibat/concept_drift_detector/strategies/page_hinkley.py @@ -2,7 +2,7 @@ from river.drift import PageHinkley as rPageHinkley from matplotlib import gridspec, pyplot as plt -from src.concept_drift_detector.strategies.istrategy import IStrategy +from ibat.concept_drift_detector.strategies.istrategy import IStrategy class PageHinkley(IStrategy): diff --git a/src/datasets/__init__.py b/ibat/datasets/__init__.py similarity index 100% rename from src/datasets/__init__.py rename to ibat/datasets/__init__.py diff --git a/src/datasets/_datasets/bus_dwell_times_654.csv b/ibat/datasets/_datasets/bus_dwell_times_654.csv similarity index 100% rename from src/datasets/_datasets/bus_dwell_times_654.csv rename to ibat/datasets/_datasets/bus_dwell_times_654.csv diff --git a/src/datasets/_datasets/bus_running_times_654.csv b/ibat/datasets/_datasets/bus_running_times_654.csv similarity index 100% rename from src/datasets/_datasets/bus_running_times_654.csv rename to ibat/datasets/_datasets/bus_running_times_654.csv diff --git a/src/datasets/_datasets/bus_running_times_feature_added_all.csv b/ibat/datasets/_datasets/bus_running_times_feature_added_all.csv similarity index 100% rename from src/datasets/_datasets/bus_running_times_feature_added_all.csv rename to ibat/datasets/_datasets/bus_running_times_feature_added_all.csv diff --git a/src/datasets/_datasets/bus_stop_times_feature_added_all.csv b/ibat/datasets/_datasets/bus_stop_times_feature_added_all.csv similarity index 100% rename from src/datasets/_datasets/bus_stop_times_feature_added_all.csv rename to ibat/datasets/_datasets/bus_stop_times_feature_added_all.csv diff --git a/src/datasets/_datasets/bus_stop_times_feature_encoded_all.csv b/ibat/datasets/_datasets/bus_stop_times_feature_encoded_all.csv similarity index 100% rename from src/datasets/_datasets/bus_stop_times_feature_encoded_all.csv rename to ibat/datasets/_datasets/bus_stop_times_feature_encoded_all.csv diff --git a/src/datasets/datasets.py b/ibat/datasets/datasets.py similarity index 100% rename from src/datasets/datasets.py rename to ibat/datasets/datasets.py diff --git a/src/log_handler.py b/ibat/log_handler.py similarity index 100% rename from src/log_handler.py rename to ibat/log_handler.py diff --git a/src/models/__init__.py b/ibat/models/__init__.py similarity index 100% rename from src/models/__init__.py rename to ibat/models/__init__.py diff --git a/src/models/base_models/__init__.py b/ibat/models/base_models/__init__.py similarity index 100% rename from src/models/base_models/__init__.py rename to ibat/models/base_models/__init__.py diff --git a/src/models/base_models/base_models.py b/ibat/models/base_models/base_models.py similarity index 98% rename from src/models/base_models/base_models.py rename to ibat/models/base_models/base_models.py index ac5bffc..bda7e48 100644 --- a/src/models/base_models/base_models.py +++ b/ibat/models/base_models/base_models.py @@ -5,7 +5,7 @@ from pandas import concat, DataFrame, Series from xgboost import Booster, DMatrix, train from river.stream import iter_pandas -from src.models.base_models.ibase_model import IBaseModel +from ibat.models.base_models.ibase_model import IBaseModel class BaseModel(IBaseModel, ABC): diff --git a/src/models/base_models/ensemble/__init__.py b/ibat/models/base_models/ensemble/__init__.py similarity index 100% rename from src/models/base_models/ensemble/__init__.py rename to ibat/models/base_models/ensemble/__init__.py diff --git a/src/models/base_models/ensemble/adaboost.py b/ibat/models/base_models/ensemble/adaboost.py similarity index 87% rename from src/models/base_models/ensemble/adaboost.py rename to ibat/models/base_models/ensemble/adaboost.py index fec6481..bed5432 100644 --- a/src/models/base_models/ensemble/adaboost.py +++ b/ibat/models/base_models/ensemble/adaboost.py @@ -1,6 +1,6 @@ from river.tree import HoeffdingTreeClassifier from river.ensemble import AdaBoostClassifier as ExAdaBoostClassifier -from src.models.base_models.base_models import RiverStreamBaseModel +from ibat.models.base_models.base_models import RiverStreamBaseModel class AdaBoostClassifier(RiverStreamBaseModel): diff --git a/src/models/base_models/ensemble/decision_tree.py b/ibat/models/base_models/ensemble/decision_tree.py similarity index 86% rename from src/models/base_models/ensemble/decision_tree.py rename to ibat/models/base_models/ensemble/decision_tree.py index 931b8fd..96ebe0c 100644 --- a/src/models/base_models/ensemble/decision_tree.py +++ b/ibat/models/base_models/ensemble/decision_tree.py @@ -1,5 +1,5 @@ from river.tree import ExtremelyFastDecisionTreeClassifier -from src.models.base_models.base_models import RiverStreamBaseModel +from ibat.models.base_models.base_models import RiverStreamBaseModel class DecisionTreeClassifier(RiverStreamBaseModel): diff --git a/src/models/base_models/ensemble/hoeffding_tree.py b/ibat/models/base_models/ensemble/hoeffding_tree.py similarity index 95% rename from src/models/base_models/ensemble/hoeffding_tree.py rename to ibat/models/base_models/ensemble/hoeffding_tree.py index 250378a..ca51c52 100644 --- a/src/models/base_models/ensemble/hoeffding_tree.py +++ b/ibat/models/base_models/ensemble/hoeffding_tree.py @@ -4,7 +4,7 @@ HoeffdingTreeClassifier as ExHoeffdingTreeClassifier, HoeffdingTreeRegressor as ExHoeffdingTreeRegressor, ) -from src.models.base_models.base_models import RiverStreamBaseModel +from ibat.models.base_models.base_models import RiverStreamBaseModel """ Tree-based models are popular due to their interpretability. Hoeffding Tree uses a tree data structure to model diff --git a/src/models/base_models/ensemble/random_forest.py b/ibat/models/base_models/ensemble/random_forest.py similarity index 93% rename from src/models/base_models/ensemble/random_forest.py rename to ibat/models/base_models/ensemble/random_forest.py index a2a6b40..c90a6bc 100644 --- a/src/models/base_models/ensemble/random_forest.py +++ b/ibat/models/base_models/ensemble/random_forest.py @@ -1,6 +1,6 @@ # from river.forest import (ARFClassifier as ExARFClassifier, ARFRegressor as ExARFRegressor) # from river.preprocessing import StandardScaler -# from src.models.base_models.base_models import RiverStreamBaseModel +# from ibat.models.base_models.base_models import RiverStreamBaseModel # # """ # The 3 most important aspects of ARF are: diff --git a/src/models/base_models/ensemble/sgt.py b/ibat/models/base_models/ensemble/sgt.py similarity index 87% rename from src/models/base_models/ensemble/sgt.py rename to ibat/models/base_models/ensemble/sgt.py index 7c7ff2f..db7381a 100644 --- a/src/models/base_models/ensemble/sgt.py +++ b/ibat/models/base_models/ensemble/sgt.py @@ -1,6 +1,6 @@ from river.tree import SGTRegressor as ExSGTRegressor from river.tree.splitter import DynamicQuantizer -from src.models.base_models.base_models import RiverStreamBaseModel +from ibat.models.base_models.base_models import RiverStreamBaseModel class SGTRegressor(RiverStreamBaseModel): diff --git a/src/models/base_models/ensemble/streaming_random_patches.py b/ibat/models/base_models/ensemble/streaming_random_patches.py similarity index 91% rename from src/models/base_models/ensemble/streaming_random_patches.py rename to ibat/models/base_models/ensemble/streaming_random_patches.py index 6ae001a..b828881 100644 --- a/src/models/base_models/ensemble/streaming_random_patches.py +++ b/ibat/models/base_models/ensemble/streaming_random_patches.py @@ -1,6 +1,6 @@ from river.ensemble import SRPClassifier as ExSRPClassifier from river.tree import HoeffdingTreeClassifier -from src.models.base_models.base_models import RiverStreamBaseModel +from ibat.models.base_models.base_models import RiverStreamBaseModel """ SRP is an ensemble method that simulates bagging or random subspaces. diff --git a/src/models/base_models/ensemble/xgboost.py b/ibat/models/base_models/ensemble/xgboost.py similarity index 94% rename from src/models/base_models/ensemble/xgboost.py rename to ibat/models/base_models/ensemble/xgboost.py index 18c923e..c41ddea 100644 --- a/src/models/base_models/ensemble/xgboost.py +++ b/ibat/models/base_models/ensemble/xgboost.py @@ -1,4 +1,4 @@ -from src.models.base_models.base_models import XGBoost +from ibat.models.base_models.base_models import XGBoost class XGBClassifier(XGBoost): diff --git a/src/models/base_models/ibase_model.py b/ibat/models/base_models/ibase_model.py similarity index 100% rename from src/models/base_models/ibase_model.py rename to ibat/models/base_models/ibase_model.py diff --git a/src/models/base_models/linear_model/__init__.py b/ibat/models/base_models/linear_model/__init__.py similarity index 100% rename from src/models/base_models/linear_model/__init__.py rename to ibat/models/base_models/linear_model/__init__.py diff --git a/src/models/base_models/linear_model/linear_river_many.py b/ibat/models/base_models/linear_model/linear_river_many.py similarity index 91% rename from src/models/base_models/linear_model/linear_river_many.py rename to ibat/models/base_models/linear_model/linear_river_many.py index 738aa8f..d1d7409 100644 --- a/src/models/base_models/linear_model/linear_river_many.py +++ b/ibat/models/base_models/linear_model/linear_river_many.py @@ -4,7 +4,7 @@ ) from river.optim import SGD from river.preprocessing import StandardScaler -from src.models.base_models.base_models import RiverBatchBaseModel +from ibat.models.base_models.base_models import RiverBatchBaseModel class LinearRegression(RiverBatchBaseModel): diff --git a/src/models/base_models/linear_model/passive_aggressive.py b/ibat/models/base_models/linear_model/passive_aggressive.py similarity index 92% rename from src/models/base_models/linear_model/passive_aggressive.py rename to ibat/models/base_models/linear_model/passive_aggressive.py index e5af09a..2b2a28b 100644 --- a/src/models/base_models/linear_model/passive_aggressive.py +++ b/ibat/models/base_models/linear_model/passive_aggressive.py @@ -2,7 +2,7 @@ PassiveAggressiveClassifier as ExPassiveAggressiveClassifier, PassiveAggressiveRegressor as ExPassiveAggressiveRegressor, ) -from src.models.base_models.base_models import SKLearnBaseModel +from ibat.models.base_models.base_models import SKLearnBaseModel class PassiveAggressiveClassifier(SKLearnBaseModel): diff --git a/src/models/base_models/linear_model/perceptron.py b/ibat/models/base_models/linear_model/perceptron.py similarity index 85% rename from src/models/base_models/linear_model/perceptron.py rename to ibat/models/base_models/linear_model/perceptron.py index d753f5a..9a73226 100644 --- a/src/models/base_models/linear_model/perceptron.py +++ b/ibat/models/base_models/linear_model/perceptron.py @@ -1,5 +1,5 @@ from sklearn.linear_model import Perceptron -from src.models.base_models.base_models import SKLearnBaseModel +from ibat.models.base_models.base_models import SKLearnBaseModel class PerceptronClassifier(SKLearnBaseModel): diff --git a/src/models/base_models/linear_model/sgd.py b/ibat/models/base_models/linear_model/sgd.py similarity index 91% rename from src/models/base_models/linear_model/sgd.py rename to ibat/models/base_models/linear_model/sgd.py index b950e5f..a5572ff 100644 --- a/src/models/base_models/linear_model/sgd.py +++ b/ibat/models/base_models/linear_model/sgd.py @@ -2,7 +2,7 @@ SGDClassifier as ExSGDClassifier, SGDRegressor as ExSGDRegressor, ) -from src.models.base_models.base_models import SKLearnBaseModel +from ibat.models.base_models.base_models import SKLearnBaseModel class SGDClassifier(SKLearnBaseModel): diff --git a/src/models/base_models/naive_bayes/__init__.py b/ibat/models/base_models/naive_bayes/__init__.py similarity index 100% rename from src/models/base_models/naive_bayes/__init__.py rename to ibat/models/base_models/naive_bayes/__init__.py diff --git a/src/models/base_models/naive_bayes/naive_bayes.py b/ibat/models/base_models/naive_bayes/naive_bayes.py similarity index 90% rename from src/models/base_models/naive_bayes/naive_bayes.py rename to ibat/models/base_models/naive_bayes/naive_bayes.py index 412cd7c..6b060e2 100644 --- a/src/models/base_models/naive_bayes/naive_bayes.py +++ b/ibat/models/base_models/naive_bayes/naive_bayes.py @@ -2,7 +2,7 @@ BernoulliNB as ExBernoulliNB, MultinomialNB as ExMultinomialNB, ) -from src.models.base_models.base_models import SKLearnBaseModel +from ibat.models.base_models.base_models import SKLearnBaseModel class BernoulliNB(SKLearnBaseModel): diff --git a/src/models/base_models/naive_bayes/naive_bayes_river.py b/ibat/models/base_models/naive_bayes/naive_bayes_river.py similarity index 91% rename from src/models/base_models/naive_bayes/naive_bayes_river.py rename to ibat/models/base_models/naive_bayes/naive_bayes_river.py index ecfd079..4c14a8a 100644 --- a/src/models/base_models/naive_bayes/naive_bayes_river.py +++ b/ibat/models/base_models/naive_bayes/naive_bayes_river.py @@ -3,7 +3,7 @@ BernoulliNB as ExBernoulliNB, MultinomialNB as ExMultinomialNB, ) -from src.models.base_models.base_models import RiverBatchBaseModel +from ibat.models.base_models.base_models import RiverBatchBaseModel class BernoulliNB(RiverBatchBaseModel): diff --git a/src/models/base_models/nn/__init__.py b/ibat/models/base_models/nn/__init__.py similarity index 100% rename from src/models/base_models/nn/__init__.py rename to ibat/models/base_models/nn/__init__.py diff --git a/src/models/base_models/nn/convlstm.py b/ibat/models/base_models/nn/convlstm.py similarity index 100% rename from src/models/base_models/nn/convlstm.py rename to ibat/models/base_models/nn/convlstm.py diff --git a/src/models/base_models/nn/mlp.py b/ibat/models/base_models/nn/mlp.py similarity index 92% rename from src/models/base_models/nn/mlp.py rename to ibat/models/base_models/nn/mlp.py index 17b86b0..c93e464 100644 --- a/src/models/base_models/nn/mlp.py +++ b/ibat/models/base_models/nn/mlp.py @@ -2,7 +2,7 @@ MLPClassifier as ExMLPClassifier, MLPRegressor as ExMLPRegressor, ) -from src.models.base_models.base_models import SKLearnBaseModel +from ibat.models.base_models.base_models import SKLearnBaseModel class MLPClassifier(SKLearnBaseModel): diff --git a/src/models/base_models/nn/mlp_river.py b/ibat/models/base_models/nn/mlp_river.py similarity index 88% rename from src/models/base_models/nn/mlp_river.py rename to ibat/models/base_models/nn/mlp_river.py index f08f7d7..935a845 100644 --- a/src/models/base_models/nn/mlp_river.py +++ b/ibat/models/base_models/nn/mlp_river.py @@ -2,7 +2,7 @@ from river.neural_net.activations import ReLU from river.optim import SGD from river.preprocessing import StandardScaler -from src.models.base_models.base_models import RiverBatchBaseModel +from ibat.models.base_models.base_models import RiverBatchBaseModel class MLPRegressor(RiverBatchBaseModel): diff --git a/src/models/use_cases/__init__.py b/ibat/models/use_cases/__init__.py similarity index 100% rename from src/models/use_cases/__init__.py rename to ibat/models/use_cases/__init__.py diff --git a/src/models/use_cases/arrival_time/__init__.py b/ibat/models/use_cases/arrival_time/__init__.py similarity index 100% rename from src/models/use_cases/arrival_time/__init__.py rename to ibat/models/use_cases/arrival_time/__init__.py diff --git a/src/models/use_cases/arrival_time/bus/__init__.py b/ibat/models/use_cases/arrival_time/bus/__init__.py similarity index 100% rename from src/models/use_cases/arrival_time/bus/__init__.py rename to ibat/models/use_cases/arrival_time/bus/__init__.py diff --git a/src/models/use_cases/arrival_time/bus/mme4bat.py b/ibat/models/use_cases/arrival_time/bus/mme4bat.py similarity index 93% rename from src/models/use_cases/arrival_time/bus/mme4bat.py rename to ibat/models/use_cases/arrival_time/bus/mme4bat.py index 44cd678..4114e43 100644 --- a/src/models/use_cases/arrival_time/bus/mme4bat.py +++ b/ibat/models/use_cases/arrival_time/bus/mme4bat.py @@ -1,9 +1,9 @@ from copy import deepcopy from typing import Optional -from src.concept_drift_detector import CDD -from src.concept_drift_detector.strategies import IStrategy -from src.models.base_models.ensemble.xgboost import XGBClassifier, XGBRegressor +from ibat.concept_drift_detector import CDD +from ibat.concept_drift_detector.strategies import IStrategy +from ibat.models.base_models.ensemble.xgboost import XGBClassifier, XGBRegressor class MME4BAT: diff --git a/src/models/use_cases/dwell_time/__init__.py b/ibat/models/use_cases/dwell_time/__init__.py similarity index 100% rename from src/models/use_cases/dwell_time/__init__.py rename to ibat/models/use_cases/dwell_time/__init__.py diff --git a/src/models/use_cases/dwell_time/bus/__init__.py b/ibat/models/use_cases/dwell_time/bus/__init__.py similarity index 100% rename from src/models/use_cases/dwell_time/bus/__init__.py rename to ibat/models/use_cases/dwell_time/bus/__init__.py diff --git a/src/models/use_cases/dwell_time/bus/mme4bdt.py b/ibat/models/use_cases/dwell_time/bus/mme4bdt.py similarity index 93% rename from src/models/use_cases/dwell_time/bus/mme4bdt.py rename to ibat/models/use_cases/dwell_time/bus/mme4bdt.py index c089636..cfe32d0 100644 --- a/src/models/use_cases/dwell_time/bus/mme4bdt.py +++ b/ibat/models/use_cases/dwell_time/bus/mme4bdt.py @@ -1,9 +1,9 @@ from copy import deepcopy from typing import Optional -from src.concept_drift_detector import CDD -from src.concept_drift_detector.strategies import IStrategy -from src.models.base_models.ensemble.xgboost import XGBClassifier, XGBRegressor +from ibat.concept_drift_detector import CDD +from ibat.concept_drift_detector.strategies import IStrategy +from ibat.models.base_models.ensemble.xgboost import XGBClassifier, XGBRegressor class MME4BDT: diff --git a/src/pipeline.py b/ibat/pipeline.py similarity index 99% rename from src/pipeline.py rename to ibat/pipeline.py index 7a1a1a0..ae1a696 100644 --- a/src/pipeline.py +++ b/ibat/pipeline.py @@ -11,8 +11,8 @@ mean_absolute_error, root_mean_squared_error, ) -from src.concept_drift_detector.strategies import IStrategy -from src.models.use_cases.dwell_time.bus import MME4BDT +from ibat.concept_drift_detector.strategies import IStrategy +from ibat.models.use_cases.dwell_time.bus import MME4BDT def run_dt_exp( diff --git a/setup.py b/setup.py index 6757d90..2ac554a 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup, find_packages +from setuptools import find_packages, setup from codecs import open from os import path @@ -44,12 +44,10 @@ license="MIT", python_requires=">=3.9", classifiers=classifiers, - packages=find_packages(where="src"), - package_dir={"": "src"}, + packages=find_packages(exclude=["tests", "tests.*"]), include_package_data=True, install_requires=requirements, project_urls={ - "Homepage": "https://github.com/aaivu/ibat", "Source Code": "https://github.com/aaivu/ibat", "Download": "https://github.com/aaivu/ibat/releases", "Documentation": "https://github.com/aaivu/ibat/blob/master/README.md", From 4277ae4591d7fb0e1dc8980a98a5746f6f58fbc7 Mon Sep 17 00:00:00 2001 From: Kajanan Selvanesan Date: Sun, 12 May 2024 16:27:44 +0530 Subject: [PATCH 2/2] refactor: Rename src to ibat --- Makefile | 4 ++-- setup.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 6d0ef6d..c38110d 100644 --- a/Makefile +++ b/Makefile @@ -12,12 +12,12 @@ setup-conda-env: .PHONY: format format: - ./venv/bin/black ./src + ./venv/bin/black ./ibat ./venv/bin/black ./examples .PHONY: lint lint: - ./venv/bin/flake8 ./src + ./venv/bin/flake8 ./ibat .PHONY: clean clean: diff --git a/setup.py b/setup.py index 2ac554a..1a7e0c8 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,10 @@ HERE = path.abspath(path.dirname(__file__)) -with open(path.join(HERE, "README.md"), "r", encoding='utf-8') as f: +with open(path.join(HERE, "README.md"), "r", encoding="utf-8") as f: long_description = f.read() -with open(path.join(HERE, "requirements.txt"), "r", encoding='utf-8') as f: +with open(path.join(HERE, "requirements.txt"), "r", encoding="utf-8") as f: requirements = f.read().splitlines() classifiers = [ @@ -40,7 +40,7 @@ "Incremental learning", ], author="Aaivu", - author_email='helloaaivu@gmail.com', + author_email="helloaaivu@gmail.com", license="MIT", python_requires=">=3.9", classifiers=classifiers, @@ -52,5 +52,5 @@ "Download": "https://github.com/aaivu/ibat/releases", "Documentation": "https://github.com/aaivu/ibat/blob/master/README.md", "Bug Tracker": "https://github.com/aaivu/ibat/issues", - } + }, )