-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_checking.py
72 lines (56 loc) · 2.12 KB
/
data_checking.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
61
62
63
64
65
66
67
68
69
70
71
72
import numpy as np
import pandas as pd
import sklearn.metrics as skm
print("Loading the data : ")
train_data = np.load('./data/cullpdb+profile_6133_filtered.npy')
test_data = np.load('./data/cb513+profile_split1.npy')
flag = 0
print("Printing data shape : ")
print(train_data.shape)
if(train_data.shape != (5534, 39900)):
flag = 1
print ("Input Train data shape is not matching with (5534, 39900)")
print(test_data.shape)
if(test_data.shape != (514, 39900)):
flag = 1
print ("Input Test data shape is not matching with (514, 39900)")
train_data = np.reshape(train_data, [-1, 700, 57])
test_data = np.reshape(test_data, [-1, 700, 57])
print("Printing data shape : ")
print(train_data.shape)
if(train_data.shape != (5534, 700, 57)):
flag = 1
print ("Resized Train data shape is not matching with (5534, 700, 57)")
print(test_data.shape)
if(test_data.shape != (514, 700, 57)):
flag = 1
print ("Input Test data shape is not matching with (514, 700, 57)")
train_data_input = train_data[:, :, np.r_[0:21, 36:57]]
train_data_otput = train_data[:, :, 22:30]
test_data_input = test_data[:, :, np.r_[0:21, 36:57]]
test_data_otput = test_data[:, :, 22:30]
print("Printing partitioned data")
print(train_data_input.shape)
if(train_data_input.shape != (5534, 700, 42)):
flag = 1
print ("Resized train_data_input shape is not matching with (5534, 700, 42)")
print(train_data_otput.shape)
if(train_data_otput.shape != (5534, 700, 8)):
flag = 1
print ("Resized train_data_input shape is not matching with (5534, 700, 8)")
print(test_data_input.shape)
if(test_data_input.shape != (514, 700, 42)):
flag = 1
print ("Resized train_data_input shape is not matching with (514, 700, 42)")
print(test_data_otput.shape)
if(test_data_otput.shape != (514, 700, 8)):
flag = 1
print ("Resized train_data_input shape is not matching with (514, 700, 8)")
train_data_otput = np.reshape(train_data_otput, [-1, 8])
test_data_otput = np.reshape(test_data_otput, [-1, 8])
# print(pd.DataFrame(test_data_otput).mean(axis = 1))
# print(pd.DataFrame(train_data_otput).mean(axis = 1))
if(flag==0):
print("All checks passed successfully")
else:
print("Input data is incorrect!")