예제 #1
0
plt.style.use(['ggplot'])
plt.tight_layout()
plt.gcf().subplots_adjust(bottom=0.13)
plt.gcf().subplots_adjust(left=0.13)
plt.rcParams["figure.figsize"] = (14, 12)
plt.ticklabel_format(style='plain', useOffset=False)

#%%
#data = pd.read_csv('../tommi_test_data.csv', sep=";", header=0)
data = pd.read_csv('../tommi_test_data_more_diff_steps.csv', sep=";", header=0)

data = data.loc[data["Warning_code"] == 0]
data = data.reset_index(drop=True)

tforce_DF = DataHandler.calculateTotalForce(data)
step_t_DF = DataHandler.calculateStepTime(data)

#%% Bagging test

avg_acc, real_label, pred_label = Ensemble.testBagging(step_t_DF)

pred_label_df = pred_label
real_label_df = real_label

pred_label_df = pred_label_df.replace("Normal", 0)
pred_label_df = pred_label_df.replace("Fall", 1)

real_label_df = real_label_df.replace("Normal", 0)
real_label_df = real_label_df.replace("Fall", 1)
from sklearn.metrics import roc_auc_score

plt.style.use(['ggplot'])
plt.tight_layout()
plt.gcf().subplots_adjust(bottom=0.13)
plt.gcf().subplots_adjust(left=0.13)
plt.rcParams["figure.figsize"] = (14, 12)
plt.ticklabel_format(style='plain', useOffset=False)

#%%
data = pd.read_csv('../tommi+diego_test_data.csv', sep=";", header=0)

data = data.loc[data["Warning_code"] == 0]
data = data.reset_index(drop=True)

data = DataHandler.calculateTotalForce(data)
data = DataHandler.calculateStepTime(data)
data = DataHandler.calculateForceValues(data)
data = DataHandler.calculatePhaseForceValues(data)

pd.set_option('display.max_columns', None)
selected_data = data.loc[:, DataColumns.getSelectedCols3andY()]

selected_data

#%% Boosting test

avg_acc, real_label, pred_label = Ensemble.testBoosting(data)

pred_label_df = pred_label
real_label_df = real_label