Skip to content

Commit

Permalink
Merge pull request scikit-learn#7525 from rickiepark/master
Browse files Browse the repository at this point in the history
[MRG+2] add feature_name to diabetes dataset
  • Loading branch information
GaelVaroquaux authored Oct 7, 2016
2 parents 21a3c19 + 6c8a1b1 commit 3d558fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sklearn/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,9 @@ def load_diabetes(return_X_y=False):
if return_X_y:
return data, target

return Bunch(data=data, target=target)
return Bunch(data=data, target=target,
feature_names=['age', 'sex', 'bmi', 'bp',
's1', 's2', 's3', 's4', 's5', 's6'])


def load_linnerud(return_X_y=False):
Expand Down
1 change: 1 addition & 0 deletions sklearn/datasets/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def test_load_diabetes():
res = load_diabetes()
assert_equal(res.data.shape, (442, 10))
assert_true(res.target.size, 442)
assert_equal(len(res.feature_names), 10)

# test return_X_y option
X_y_tuple = load_diabetes(return_X_y=True)
Expand Down

0 comments on commit 3d558fa

Please sign in to comment.