PCA filteringΒΆ

Filter signals using PCA decomposition (sklearn.decomposition.PCA()) of their fast-fourier transform

  1. Identify outliers in fft-transformed signal with PrepareData.MD_removeOutliers()
  2. Identify clusters in ft-transformed signal with PrepareData.Cluster()
import LoadingData.ReadData as rd
import Preprocessing.PrepareData as pd
in_path = '/Users/ryszardcetnarski/Desktop/Nencki/Badanie_NFB/Dane/fft_treningi/'
filter_list = ['P3_trening_','P4_trening_', 'F3_trening_', 'F4_trening_']
#load averaged fft from trainings
signals_dict = rd.LoadAvg(in_path, filter_list, freq_lim = [15,40])
#label the outliers
labels, signals_colum_major = pd.FilterIndividualAndGroup(signals_dict, plot_on = True, log = True)
#Plot'em
pd.MarkOutliers(labels[labels['mask'] ==1], rd.LoadAvg(in_path, filter_list, freq_lim = [0,50]))
N outliers inside individual: 338, 0.039348 %

For n_clusters = 2 The average silhouette_score is : 0.735854433865

N outliers across group: 539, 0.065317 %
../../_images/output_1_2.png ../../_images/output_1_3.png ../../_images/output_1_4.png ../../_images/output_1_5.png ../../_images/output_1_6.png ../../_images/output_1_7.png ../../_images/output_1_8.png ../../_images/output_1_9.png ../../_images/output_1_10.png ../../_images/output_1_11.png ../../_images/output_1_12.png ../../_images/output_1_13.png ../../_images/output_1_14.png ../../_images/output_1_15.png ../../_images/output_1_16.png ../../_images/output_1_17.png ../../_images/output_1_18.png ../../_images/output_1_19.png ../../_images/output_1_20.png ../../_images/output_1_21.png ../../_images/output_1_22.png ../../_images/output_1_23.png ../../_images/output_1_24.png ../../_images/output_1_25.png ../../_images/output_1_26.png ../../_images/output_1_27.png ../../_images/output_1_28.png ../../_images/output_1_29.png ../../_images/output_1_30.png ../../_images/output_1_31.png ../../_images/output_1_32.png ../../_images/output_1_33.png ../../_images/output_1_34.png ../../_images/output_1_35.png ../../_images/output_1_36.png ../../_images/output_1_37.png ../../_images/output_1_38.png ../../_images/output_1_39.png ../../_images/output_1_40.png ../../_images/output_1_41.png ../../_images/output_1_42.png ../../_images/output_1_43.png ../../_images/output_1_44.png ../../_images/output_1_45.png ../../_images/output_1_46.png ../../_images/output_1_47.png ../../_images/output_1_48.png ../../_images/output_1_49.png ../../_images/output_1_50.png ../../_images/output_1_51.png ../../_images/output_1_52.png ../../_images/output_1_53.png ../../_images/output_1_54.png