diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1036ba69..21d44e68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8"] + python-version: ["3.8", "3.11"] steps: - uses: actions/checkout@v3 diff --git a/Dockerfile b/Dockerfile index b54d3086..8e679bb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM python:3.10.11 AS alpha-automl-jupyterhub +FROM python:3.11.6 AS alpha-automl-jupyterhub # Install JupyterHub and dependencies RUN pip3 --disable-pip-version-check install --no-cache-dir \ - jupyterhub==3.1.1 \ - notebook==6.5.2 \ - jupyterlab==3.5.3 \ - jupyterlab-server==2.16.0 + jupyterhub==4.0.2 \ + notebook==7.0.6 \ + jupyterlab==4.0.8 \ + jupyterlab-server==2.25.0 # Install AlphaD3M and dependencies ADD . /alpha-automl/ diff --git a/alpha_automl/builtin_primitives/time_series_forecasting.py b/alpha_automl/builtin_primitives/time_series_forecasting.py index 73f9ec57..511e97a4 100644 --- a/alpha_automl/builtin_primitives/time_series_forecasting.py +++ b/alpha_automl/builtin_primitives/time_series_forecasting.py @@ -88,7 +88,7 @@ def __init__(self): "sin_day", "cos_day", "dayofmonth", - "weekofyear", + # weekofyear", ] self.freq = "d" self.prediction_length = 1 @@ -156,7 +156,7 @@ def create_time_features(self, df, date_col=None): df["sin_day"] = np.sin(df["dayofyear"]) df["cos_day"] = np.cos(df["dayofyear"]) df["dayofmonth"] = df["date"].dt.day - df["weekofyear"] = df["date"].dt.weekofyear + # df["weekofyear"] = df["date"].dt.weekofyear # Not available after pandas 1.6 df = df.drop(["date"], axis=1) return df @@ -170,16 +170,16 @@ def standard_scaling(self, df): # NBEATS class NBEATSEstimator(BasePrimitive): - def __init__(self, freq="d", max_epochs=10): + def __init__(self, freq="d", max_steps=10): self.freq = freq - self.max_epochs = max_epochs + self.max_steps = max_steps def fit(self, X, y): horizon = len(y) date_column = X.columns[0] X[date_column] = X[date_column].apply(lambda x: pd.Timestamp(x)) nbeats = [ - NBEATS(input_size=horizon // 2, h=horizon, max_epochs=self.max_epochs) + NBEATS(input_size=horizon // 2, h=horizon, max_steps=self.max_steps) ] self.nbeats_nf = NeuralForecast(models=nbeats, freq=self.freq) @@ -195,15 +195,15 @@ def predict(self, X): # NHITS class NHITSEstimator(BasePrimitive): - def __init__(self, freq="d", max_epochs=10): + def __init__(self, freq="d", max_steps=10): self.freq = freq - self.max_epochs = max_epochs + self.max_steps = max_steps def fit(self, X, y): horizon = len(y) date_column = X.columns[0] X[date_column] = X[date_column].apply(lambda x: pd.Timestamp(x)) - nhits = [NHITS(input_size=horizon // 2, h=horizon, max_epochs=self.max_epochs)] + nhits = [NHITS(input_size=horizon // 2, h=horizon, max_steps=self.max_steps)] self.nhits_nf = NeuralForecast(models=nhits, freq=self.freq) tmp_X = X.copy() diff --git a/extra_requirements.txt b/extra_requirements.txt index 2edb6653..201e684c 100644 --- a/extra_requirements.txt +++ b/extra_requirements.txt @@ -1,9 +1,9 @@ -pandas<2.0.0: timeseries -gluonts==0.12.7: timeseries +pandas: timeseries +gluonts: timeseries numpy==1.23.5: timeseries -neuralforecast==1.5.0: timeseries -mxnet==1.9.1: timeseries -pmdarima==2.0.3: timeseries +neuralforecast: timeseries +mxnet: timeseries +pmdarima: timeseries fasttext-wheel: nlp transformers: nlp, image scikit-image: image diff --git a/requirements.txt b/requirements.txt index e3664694..96fc1e36 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -scipy<=1.9.3 +scipy scikit-learn torch>=1.7 nltk @@ -8,4 +8,4 @@ datamart_profiler feature_engine xgboost lightgbm -numpy<=1.24.3 +numpy diff --git a/tests/test_datetime_encoder.py b/tests/test_datetime_encoder.py index 9706f64a..bfb612aa 100644 --- a/tests/test_datetime_encoder.py +++ b/tests/test_datetime_encoder.py @@ -5,13 +5,16 @@ class TestDatetimeEncoder: """This is the testcases for datetime encoder.""" - - df = pd.DataFrame( - data={ - "col1": ["12/1/2009 23:19", "2022-06-30 18:37:00", "2025-09-24 20:37:00"] - }, - index=[0, 1, 2], - ) + df = None + + def setup_method(self, method): + print("starting execution of tc: {}".format(method.__name__)) + self.df = pd.DataFrame( + data={ + "col1": ["12/1/2009 23:19", "2022-06-30 18:37:00", "2025-09-24 20:37:00"] + }, + index=[0, 1, 2], + ) def test_cyclical_feature(self): encoder = CyclicalFeature() @@ -27,5 +30,4 @@ def test_dummy_encoder(self): encoder = DummyEncoder() encoder.fit(self.df) np_array = encoder.transform(self.df) - print(np_array) - assert np_array.shape == (len(self.df), 4 * len(self.df) + 4) + assert np_array.shape == (len(self.df), 4 * len(self.df))