Skip to content

Commit

Permalink
Added the actual files for test_data....
Browse files Browse the repository at this point in the history
  • Loading branch information
ONordander committed Apr 24, 2017
1 parent 2d9dc70 commit 7ab9d3e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions id3/data/test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
10,2,class_0,class_1
0,1,0
2,3,1
4,5,2
6,7,3
8,9,4
10,11,5
12,13,6
14,15,7
16,17,8
18,19,9
14 changes: 14 additions & 0 deletions id3/tests/test_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from numpy.testing import assert_almost_equal, assert_raises
import numpy as np
from id3.data import load_data
import uuid

X = np.arange(20).reshape(10, 2)
y = np.arange(10).reshape(10, 1)


def test_load_data():
assert_raises(IOError, load_data.load_data, str(uuid.uuid4()))
X_, y_, _ = load_data.load_data("test.csv", nominal=False)
assert_almost_equal(X, X_)
assert_almost_equal(y, y_)

0 comments on commit 7ab9d3e

Please sign in to comment.