Skip to content

Commit

Permalink
Add an hardcoded test
Browse files Browse the repository at this point in the history
  • Loading branch information
arjoly committed Oct 21, 2015
1 parent bc02bd5 commit be21b6a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sklearn/tree/tests/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,14 @@ def test_presort_sparse():
yield check_presort_sparse, est, sparse_matrix(X), y


def test_decision_path_hardcoded():
X = iris.data
y = iris.target
est = DecisionTreeClassifier(random_state=0, max_depth=1).fit(X, y)
node_indicator = est.decision_path(X[:2]).toarray()
assert_array_equal(node_indicator, [[1, 1, 0], [1, 0, 1]])


def check_decision_path(name):
X = iris.data
y = iris.target
Expand Down

0 comments on commit be21b6a

Please sign in to comment.