Skip to content

Commit

Permalink
fix merge issues
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Hoffman <hoffman.sc@gmail.com>
  • Loading branch information
hoffmansc committed Jul 20, 2022
1 parent 3506698 commit 9d5a8dd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up R
uses: r-lib/actions/setup-r@v1

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
Expand Down
24 changes: 0 additions & 24 deletions tests/sklearn/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,6 @@ def test_multilabel_basic():
assert multilabel.y.shape == (3, 2)
assert multilabel.X.shape == (3, 2)

def test_series_input_basic():
prot_attr = pd.Series(['c', 'b', 'a'], name='Z2')
custom = basic(prot_attr=prot_attr)
assert (custom.X.index.droplevel() == prot_attr).all()

custom2 = basic(prot_attr=[prot_attr, 'Z'])
ix = pd.DataFrame([['c', 'a'], ['b', 'b'], ['a', 'c']], columns=['Z2', 'Z'])
assert (custom2.X.index.droplevel().to_frame() == ix.to_numpy()).all(None)

with pytest.raises(TypeError):
basic(prot_attr=[prot_attr.to_numpy()]) # list of arrays is not allowed

with pytest.raises(KeyError):
basic(prot_attr=prot_attr.to_numpy()) # ['c', 'b', 'a'] are not labels

def test_series_target_basic():
target = pd.Series([3, 4, 5], name='y2')
custom = basic(target=target)
assert (custom.y.to_numpy() == target).all()

Y = pd.DataFrame([[3, 3], [4, 7], [5, 11]], columns=['y2', 'y'])
custom2 = basic(target=[target, 'y'])
assert (custom2.y.to_numpy() == Y).all(None)

def test_sample_weight_basic():
"""Tests returning sample_weight on a toy example."""
with_weights = basic(sample_weight='X2')
Expand Down

0 comments on commit 9d5a8dd

Please sign in to comment.