Skip to content

Commit

Permalink
update tests that used load_boston
Browse files Browse the repository at this point in the history
  • Loading branch information
oaksharks committed Jan 6, 2023
1 parent 208b935 commit d1f3999
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
python -m pip install --upgrade pip
pip install tensorflow==${{ matrix.tf-version }}
pip install git+https://github.com/DataCanvasIO/Hypernets
pip install -r requirements.txt "protobuf<4.0" "numpy==1.19.5" "featuretools==0.27"
pip install -r requirements.txt "protobuf<4.0" "numpy==1.19.5" "featuretools<=0.27"
pip install pytest-cov==2.4.0 python-coveralls codacy-coverage
pip list
- name: Test with pytest
Expand Down
13 changes: 5 additions & 8 deletions deeptables/tests/models/deeptable_regression_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@
"""
import pandas as pd
from sklearn.datasets import load_boston

from deeptables.models import deeptable
from deeptables.tests.misc import r2_c
from deeptables.utils import consts
from hypernets.tabular import get_tool_box
from hypernets.tabular.datasets.dsutils import load_boston


class Test_DeepTable_Regression:

@staticmethod
def load_data():
print("Loading datasets...")

boston_dataset = load_boston()

df_train = pd.DataFrame(boston_dataset.data)
df_train.columns = boston_dataset.feature_names
target = pd.Series(boston_dataset.target)

df = load_boston()
target = df.pop("target")
df_train = df
# target = pd.Series(boston_dataset.target)
return df_train, target

def setup_class(self):
Expand Down
11 changes: 5 additions & 6 deletions deeptables/tests/models/hyper_dt_regression_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
from hypernets.core.callbacks import SummaryCallback, FileStorageLoggingCallback
from hypernets.core.searcher import OptimizeDirection
from hypernets.searchers import RandomSearcher
from sklearn.datasets import load_boston

from sklearn.model_selection import train_test_split
from hypernets.tabular.datasets.dsutils import load_boston

from .. import homedir

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

def test_boston(self):
print("Loading datasets...")
boston_dataset = load_boston()

df_train = pd.DataFrame(boston_dataset.data)
df_train.columns = boston_dataset.feature_names
self.y = pd.Series(boston_dataset.target)
df = load_boston()
df_train = df
self.y = df.pop('target')
self.X = df_train

self.X_train, \
Expand Down

0 comments on commit d1f3999

Please sign in to comment.