#variance f11 = float(np.var(col1, ddof=1)) f12 = float(np.var(col2, ddof=1)) f13 = float(np.var(col3, ddof=1)) f14 = float(np.var(col4, ddof=1)) #max_freq b1 = 1000 * myfeat.max_freq(col1) b2 = 1000 * myfeat.max_freq(col2) b3 = 1000 * myfeat.max_freq(col3) b4 = 1000 * myfeat.max_freq(col4) #RMS f31 = myfeat.rms(col1) f32 = myfeat.rms(col2) f33 = myfeat.rms(col3) f34 = myfeat.rms(col4) #mean f41 = np.mean(col1) f42 = np.mean(col2) f43 = np.mean(col3) f44 = np.mean(col4) #sum_peaks f51 = sum(myfeat.peaks(col1, 2, 10)) f52 = sum(myfeat.peaks(col2, 2, 10))
my_feat[26] = std_m1 my_feat[27] = std_m2 #sum sum_p1 = np.sum(arr_p1) sum_p2 = np.sum(arr_p2) sum_m1 = np.sum(arr_m1) sum_m2 = np.sum(arr_m2) my_feat[28] = sum_p1 my_feat[29] = sum_p2 my_feat[30] = sum_m1 my_feat[31] = sum_m2 #rms rms_p1 = myfeat.rms(arr_p1) rms_p2 = myfeat.rms(arr_p2) rms_m1 = myfeat.rms(arr_m1) rms_m2 = myfeat.rms(arr_m2) my_feat[32] = rms_p1 my_feat[33] = rms_p2 my_feat[34] = rms_m1 my_feat[35] = rms_m2 result = model.predict(my_feat.T) print(result) print(h) h = h + 1
#variance feat_data[4] = float(np.var(col1, ddof=1)) feat_data[5] = float(np.var(col2, ddof=1)) feat_data[6] = float(np.var(col3, ddof=1)) feat_data[7] = float(np.var(col4, ddof=1)) #max_freq feat_data[0] = 1000 * myfeat.max_freq(col1) feat_data[1] = 1000 * myfeat.max_freq(col2) feat_data[2] = 1000 * myfeat.max_freq(col3) feat_data[3] = 1000 * myfeat.max_freq(col4) #RMS feat_data[8] = myfeat.rms(col1) feat_data[9] = myfeat.rms(col2) feat_data[10] = myfeat.rms(col3) feat_data[11] = myfeat.rms(col4) #mean feat_data[17] = np.mean(col1) feat_data[18] = np.mean(col2) feat_data[19] = np.mean(col3) feat_data[20] = np.mean(col4) #sum_peaks feat_data[21] = sum(myfeat.peaks(col1, 2, 10)) feat_data[22] = sum(myfeat.peaks(col2, 2, 10))