Skip to content

Commit d1f3999

Browse files
committed
update tests that used load_boston
1 parent 208b935 commit d1f3999

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

.github/workflows/python-pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
python -m pip install --upgrade pip
4242
pip install tensorflow==${{ matrix.tf-version }}
4343
pip install git+https://github.com/DataCanvasIO/Hypernets
44-
pip install -r requirements.txt "protobuf<4.0" "numpy==1.19.5" "featuretools==0.27"
44+
pip install -r requirements.txt "protobuf<4.0" "numpy==1.19.5" "featuretools<=0.27"
4545
pip install pytest-cov==2.4.0 python-coveralls codacy-coverage
4646
pip list
4747
- name: Test with pytest

deeptables/tests/models/deeptable_regression_test.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,23 @@
44
55
"""
66
import pandas as pd
7-
from sklearn.datasets import load_boston
87

98
from deeptables.models import deeptable
109
from deeptables.tests.misc import r2_c
1110
from deeptables.utils import consts
1211
from hypernets.tabular import get_tool_box
12+
from hypernets.tabular.datasets.dsutils import load_boston
1313

1414

1515
class Test_DeepTable_Regression:
1616

1717
@staticmethod
1818
def load_data():
1919
print("Loading datasets...")
20-
21-
boston_dataset = load_boston()
22-
23-
df_train = pd.DataFrame(boston_dataset.data)
24-
df_train.columns = boston_dataset.feature_names
25-
target = pd.Series(boston_dataset.target)
26-
20+
df = load_boston()
21+
target = df.pop("target")
22+
df_train = df
23+
# target = pd.Series(boston_dataset.target)
2724
return df_train, target
2825

2926
def setup_class(self):

deeptables/tests/models/hyper_dt_regression_test.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
from hypernets.core.callbacks import SummaryCallback, FileStorageLoggingCallback
1010
from hypernets.core.searcher import OptimizeDirection
1111
from hypernets.searchers import RandomSearcher
12-
from sklearn.datasets import load_boston
12+
1313
from sklearn.model_selection import train_test_split
14+
from hypernets.tabular.datasets.dsutils import load_boston
1415

1516
from .. import homedir
1617

@@ -19,11 +20,9 @@ class Test_HyperDT_Regression():
1920

2021
def test_boston(self):
2122
print("Loading datasets...")
22-
boston_dataset = load_boston()
23-
24-
df_train = pd.DataFrame(boston_dataset.data)
25-
df_train.columns = boston_dataset.feature_names
26-
self.y = pd.Series(boston_dataset.target)
23+
df = load_boston()
24+
df_train = df
25+
self.y = df.pop('target')
2726
self.X = df_train
2827

2928
self.X_train, \

0 commit comments

Comments
 (0)