-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnalyzeDataset_time.py
More file actions
66 lines (50 loc) · 1.52 KB
/
AnalyzeDataset_time.py
File metadata and controls
66 lines (50 loc) · 1.52 KB
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
import sys
import time
import pdb
import getpass
import glob
from IPython import embed
import numpy as np
import scipy.io
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
import supervised_learning
plt.ion()
DATASET_NAME = sys.argv[1]
#DATASET_NAME = 'dataset_718885'
ANALYSIS_VISUALIZATION = True
ANALYSIS_CLASSIFICATION = True
TARGET = 0
SCORE_THRESHOLD = 1.2
# load dataset file
dataset = scipy.io.loadmat('./run_data/' + DATASET_NAME + '.mat')
dataset_features = dataset['dataset_features']
dataset_targets = dataset['dataset_targets']
dataset_sessions = dataset['dataset_sessions']
# merge sessions
exp_features = [] # it would be list of [Intensity, Location, Frequency]
exp_targets = []
exp_ids = []
# for each session
for (session_features, session_targets, session_names) in \
zip(dataset_features[0], dataset_targets[0], dataset_sessions[0]):
# for each block
for (block_features, block_targets, block_name) in \
zip(session_features, session_targets, session_names):
if True:#try:
exp_targets.append(block_targets)
exp_features.append(block_features[2:])
exp_ids.append(block_name)
#except:
# continue
exp_features = np.vstack(exp_features)
exp_targets = np.vstack(exp_targets)
exp_ids = np.vstack(exp_ids)
plt.plot(exp_targets[:,:3].max(axis=1))
plt.xticks(10*np.arange(len(exp_ids[::10])), exp_ids[::10],
rotation=90, fontsize=6)
plt.tight_layout()
plt.pause(0.01)
plt.draw()
embed()