Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] Avoid CI fail on deep test by generating at least 2 classes in random data #485

Merged
merged 5 commits into from
Jun 13, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest

from aeon.classification.deep_learning.base import BaseDeepClassifier
from aeon.utils._testing.collection import make_2d_test_data
from aeon.utils.validation._dependencies import _check_soft_dependencies

__author__ = ["achieveordie", "hadifawaz1999"]
Expand Down Expand Up @@ -56,17 +57,17 @@ def _fit(self, X, y):
reason="skip test if required soft dependency not available",
)
def test_dummy_deep_classifier():
import numpy as np

last_file_name = str(time.time_ns())

# create a dummy deep classifier
dummy_deep_clf = _DummyDeepClassifier(last_file_name=last_file_name)

# generate random data

X, y = make_2d_test_data()

# test fit function on random data
dummy_deep_clf.fit(
X=np.random.normal(size=(10, 100)), y=np.random.choice([0, 1], size=(10,))
)
dummy_deep_clf.fit(X=X, y=y)

# test save last model to file than delete it

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest

from aeon.regression.deep_learning.base import BaseDeepRegressor
from aeon.utils._testing.collection import make_2d_test_data
from aeon.utils.validation._dependencies import _check_soft_dependencies

__author__ = ["achieveordie", "hadifawaz1999"]
Expand Down Expand Up @@ -53,17 +54,17 @@ def _fit(self, X, y):
reason="skip test if required soft dependency not available",
)
def test_dummy_deep_regressor():
import numpy as np

last_file_name = str(time.time_ns())

# create a dummy regressor
dummy_deep_rg = _DummyDeepRegressor(last_file_name=last_file_name)

# generate random data

X, y = make_2d_test_data()

# test fit function on random data
dummy_deep_rg.fit(
X=np.random.normal(size=(10, 100)), y=np.random.normal(size=(10,))
)
dummy_deep_rg.fit(X=X, y=y)

# test save last model to file than delete it

Expand Down