-
Notifications
You must be signed in to change notification settings - Fork 3
/
test_prepare_dataset.py
62 lines (43 loc) · 1.9 KB
/
test_prepare_dataset.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from unittest import TestCase
from prepare_dataset import *
class TestPrepareDataSet(TestCase):
def test_get_outside_train_features(self):
train_data, label, test_data = get_outside_train_features()
print(train_data.shape)
print(test_data.shape)
self.assertEqual(train_data.shape[0], 30000)
self.assertEqual(test_data.shape[0], 15000)
def test_load_ft_features(self):
train_data, label, test_data = load_ft_features()
print(train_data.shape)
print(test_data.shape)
self.assertEqual(train_data.shape[0], 30000)
self.assertEqual(test_data.shape[0], 15000)
def test_load_nn_features(self):
train_data, label, test_data = load_nn_features()
print(train_data.shape)
print(test_data.shape)
self.assertEqual(train_data.shape[0], 30000)
self.assertEqual(test_data.shape[0], 15000)
def test_load_depth_three_features(self):
train_data, label, test_data = load_depth_three_features()
print(train_data.shape)
print(test_data.shape)
self.assertEqual(train_data.shape[0], 30000)
self.assertEqual(test_data.shape[0], 15000)
def test_load_tfidf_features(self):
train_data, label, test_data = load_tfidf_features("")
print(train_data.shape)
print(test_data.shape)
self.assertEqual(train_data.shape[0], 30000)
self.assertEqual(test_data.shape[0], 15000)
train_data, label, test_data = load_tfidf_features("_hkey")
print(train_data.shape)
print(test_data.shape)
self.assertEqual(train_data.shape[0], 21154)
self.assertEqual(test_data.shape[0], 10661)
train_data, label, test_data = load_tfidf_features("_dll")
print(train_data.shape)
print(test_data.shape)
self.assertEqual(train_data.shape[0], 29990)
self.assertEqual(test_data.shape[0], 14989)