Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e89ecd8

Browse filesBrowse files
committed
FIX don't rely on Bunch behavior with fetch_covtype
For consistency with new documentation (176c9ce). Still returns Bunch so as not to break third-party scripts.
1 parent 54540ad commit e89ecd8
Copy full SHA for e89ecd8

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed

‎benchmarks/bench_covertype.py

Copy file name to clipboardExpand all lines: benchmarks/bench_covertype.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def load_data(dtype=np.float32, order='F'):
109109
print("Loading dataset...")
110110
data = fetch_covtype(download_if_missing=True, shuffle=True,
111111
random_state=opts.random_seed)
112-
X, y = data.data, data.target
112+
X, y = data['data'], data['target']
113113
if order.lower() == 'f':
114114
X = np.asfortranarray(X)
115115

‎sklearn/datasets/tests/test_covtype.py

Copy file name to clipboardExpand all lines: sklearn/datasets/tests/test_covtype.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ def test_fetch():
2121

2222
data2 = fetch(shuffle=True, random_state=37)
2323

24-
X1, X2 = data1.data, data2.data
24+
X1, X2 = data1['data'], data2['data']
2525
assert_equal((581012, 54), X1.shape)
2626
assert_equal(X1.shape, X2.shape)
2727

2828
assert_equal(X1.sum(), X2.sum())
2929

30-
y1, y2 = data1.target, data2.target
30+
y1, y2 = data1['target'], data2['target']
3131
assert_equal((X1.shape[0],), y1.shape)
3232
assert_equal((X1.shape[0],), y2.shape)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.