feature visualization#
generate siganls#
[8]:
data1 = np.empty((50, 5, 100))
for epoch in range(50):
for ch in range(5):
data1[epoch, ch] = np.linspace(ch, ch + epoch + 1, 100) + np.sin(np.linspace(-np.pi, np.pi, 100))
data2 = np.empty((50, 5, 100))
for epoch in range(50):
for ch in range(5):
data2[epoch, ch] = np.linspace(ch, ch + epoch + 1, 100) + np.random.randint(-100, 100) * 0.01 + np.sin(
np.linspace(-np.pi, np.pi, 100)) + 5
if ch == 3:
data2[epoch, ch] = np.zeros(100)
all feature visualization#
[13]:
# calculate all feature
fea1 = Feature(data1, selected_funcs = Feature.funcs_subset_no_spect_slope).reorder().fix_missing()
fea2 = Feature(data2, selected_funcs = Feature.funcs_subset_no_spect_slope).reorder().fix_missing()
## boxplot
Feature.plot_feature_sns(fea1, fea2, ['ch1', 'ch2', 'ch3', 'ch4', 'ch5'])
plt.show()
[14]:
## p value and heatmap
_, p = Feature.ttest_feature(fea1, fea2, ['ch1', 'ch2', 'ch3', 'ch4', 'ch5'])
plt.show()