diff --git a/analysis.py b/analysis.py index 276fa36..470a567 100644 --- a/analysis.py +++ b/analysis.py @@ -93,14 +93,18 @@ scores["C"] = scores.loc[:, "C01":"C08"].sum(axis=1) # C群 scores["Total"] = scores.loc[:, "A":"C"].sum(axis=1) # 総合スコア target = df.loc[df_index, "Target"] # ターゲットスコア + # target = 'Total' threshold = scores[target].median() # 中央値を閾値とする + # print(f'Threshold for {target}: {threshold}') - # scores['Total'].plot.hist(bins=20, edgecolor='black') # ヒストグラムを描画 + # scores[target].plot.hist(bins=20, edgecolor='black') # ヒストグラムを描画 # import matplotlib.pyplot as plt - # plt.title('Total Score Distribution') - # plt.xlabel('Total Score') + # plt.title(f'{target} Score Distribution') + # plt.xlabel(f'{target} Score') # plt.ylabel('Frequency') # plt.show() # ヒストグラムを表示 + # exit() + scores["label"] = 0 scores.loc[scores[target] >= threshold, "label"] = 1 # ラベル付け # print(scores.head(3)) diff --git a/make_data.py b/make_data.py index 4bdf2db..34d2c58 100644 --- a/make_data.py +++ b/make_data.py @@ -2,7 +2,7 @@ data_dir = r"D:\sync\working\StressFiles" + "\\" target_list = ["SmTIAS_WebApp","HandyTCC_WebApp","SmTIAS_PhoneApp","HandyTCC_PhoneApp"] -survey = pd.read_csv(data_dir + 'survey_data_add.csv') +survey = pd.read_csv(data_dir + 'survey_data_error_removed.csv') def make_data(target): type = target.split('_')[1]