From 49910f430c4a1f15eb6b41c0f7b8475e41e695d9 Mon Sep 17 00:00:00 2001 From: newbie Date: Mon, 7 Oct 2024 10:06:20 +0800 Subject: [PATCH] change for Sound --- .../__pycache__/loaData.cpython-312.pyc | Bin 3736 -> 3869 bytes Qfunctions/loaData.py | 6 ++++ main.py | 26 +++++++++--------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Qfunctions/__pycache__/loaData.cpython-312.pyc b/Qfunctions/__pycache__/loaData.cpython-312.pyc index 7439bfbe75754d46a1318cc65a863d3075472b68..da10d4c6657cea5c09e5554dde9fd9622e3345be 100644 GIT binary patch delta 334 zcmbOsJ6DeHG%qg~0}%K+GN-%oY~)+P#@IJ`J6qD^w`}4{DGaSlX-twp=~}iL)*7}d zpi&^o4dk=eu-CHIuul9SGFgXxwkk(5Q#wO3Q!G$HEk_Dh4Mz%76;Ru3hPg}=nR<9w zfO54Qli#q*GjdGk;W)zRGx;J%9V6%D08Ux2Tij`xMa3oYWr;bZskemFQWHx`i&Bf@ z3zAFXlQR7nfo2tR0tp3$gaic;C=vqlisWI0HAumw$&)z^G#&^^P1l{MyMS?# z;R2S6LaGhkH>8ypWM7mv+z@?H%HaZw_yc~W29F1mk8n1#tMWTDu_QB34&)KpoW#Y; z$mR?((PeTecOql(=Ih*B7#R~L_wXKK44&-Irzb7ODDv5Wo6+Wz6f2|f2R;TK@ebWa J_979WCIDNKS$hBg delta 210 zcmbO$H$#^1G%qg~0}vGKWJ>Sg-pIFtjWJ~McDAI+!R+f)*^-&k8IqY|fhua*Qn+f^ zQkbfMYG*UdWtzy;!@~lUt7V(4#v#whHrb8i2&3C%Zq7PJ_Q_qGvT8-@K$XSpKte$w zAwfYwp-2eGE|P~4)*$KClRt7AFy5H#$<@rl!SAHH`2v>;Bby^gjnm{`+=-07n`3yk tFfv9>7UVm`7&!R~pPsY;qsV6!Zbq9=Qml-^ANUw}#5;5w*^5Mgng9@uFqHrR diff --git a/Qfunctions/loaData.py b/Qfunctions/loaData.py index 5d7272e..0646adf 100644 --- a/Qfunctions/loaData.py +++ b/Qfunctions/loaData.py @@ -61,6 +61,12 @@ def load_xlsx(fileName, labelName, max_row_length = 1000, fill_rule = None): # 提取偶数列 features = df.iloc[0:, 1::2] + # 计算变化率 + first_value = features.iloc[0, :] # 获取第一行的数据 + features_pct_change = (features - first_value) / first_value + + features = features_pct_change + features.dropna(inplace=True) features.reset_index(drop=True, inplace=True) diff --git a/main.py b/main.py index bcfdbb2..7f968e5 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,7 @@ def main(): label_names =["Accuracy", "Compress", "Distance", "Loss", "Metal", "Python"] data = dLoader(projet_name, label_names, isDir=False) X_train, X_test, y_train, y_test, encoder = divSet( - data=data, labels=label_names, test_size= 0.5 + data=data, labels=label_names, test_size= 0.2 ) print(y_train) @@ -35,20 +35,20 @@ def main(): - # model = Qmlp( - # X_train=X_train, X_test=X_test, y_train=y_train, y_test= y_test, - # hidden_layers=[32, 32, 32], - # dropout_rate=0 - # ) - # model.fit(100) + model = Qmlp( + X_train=X_train, X_test=X_test, y_train=y_train, y_test= y_test, + hidden_layers=[64, 64], + dropout_rate=0 + ) + model.fit(100) - # cm = model.get_cm() - # epoch_data = model.get_epoch_data() + cm = model.get_cm() + epoch_data = model.get_epoch_data() - # from Qfunctions.saveToxlsx import save_to_xlsx as stx - # stx(project_name=projet_name, file_name="cm", data=cm) - # stx(project_name=projet_name, file_name="acc_and_loss", data=epoch_data) - # print("Done") + from Qfunctions.saveToxlsx import save_to_xlsx as stx + stx(project_name=projet_name, file_name="cm", data=cm) + stx(project_name=projet_name, file_name="acc_and_loss", data=epoch_data) + print("Done") if __name__ == '__main__': main()