import pandas as pd
import numpy as np
import xlrd
from pathlib import Path
import matplotlib.pyplot as plt
read_path = Path(r"D:\AOR_experiment\conf_result")
# name_list = ["SWD", "ARWU2020-5bin", "ARWU2020-10bin", "QSR2020-10bin", "QSR2020-5bin", "housing-10bin", "housing-5bin",
# "ERA", "ESL", "LEV", "stock-10bin", "stock-5bin", "car",
# "Obesity", "bank-5bin", "bank-10bin", "computer-5bin", "computer-10bin"]
name_list = ["ARWU2020-5bin"]
sheet_names = ["Acc_mean", "Acc_std", "MAE_mean", "MAE_std", "F1_mean", "F1_std", "Recall_mean",
"Recall_std", "ALC_Acc_list", "ALC_MAE_list", "ALC_F1_list", "ALC_Recall_list",
"ALC_Acc", "ALC_MAE", "ALC_F1", "ALC_Recall"]
for name in name_list:
path = str(read_path.joinpath(name + "-Result.xls"))
book = xlrd.open_workbook(path)
table = book.sheet_by_name("ALC_Acc_list")
n_rows = table.nrows
n_cols = table.ncols - 1
data = np.zeros((n_cols,n_rows))
columns = []
for i in range(n_rows):
columns.append(table.row_values(i)[0])
data[:,i] = table.row_values(i)[1:]
df = pd.DataFrame(data=data,columns=columns)
df.boxplot()
plt.show()
break
import pandas as pd
import numpy as np
import xlrd
from pathlib import Path
import matplotlib.pyplot as plt
read_path = Path(r"D:\AOR_experiment\conf_result")
# name_list = ["SWD", "ARWU2020-5bin", "ARWU2020-10bin", "QSR2020-10bin", "QSR2020-5bin", "housing-10bin", "housing-5bin",
# "ERA", "ESL", "LEV", "stock-10bin", "stock-5bin", "car",
# "Obesity", "bank-5bin", "bank-10bin", "computer-5bin", "computer-10bin"]
name_list = ["ARWU2020-5bin"]
sheet_names = ["Acc_mean", "Acc_std", "MAE_mean", "MAE_std", "F1_mean", "F1_std", "Recall_mean",
"Recall_std", "ALC_Acc_list", "ALC_MAE_list", "ALC_F1_list", "ALC_Recall_list",
"ALC_Acc", "ALC_MAE", "ALC_F1", "ALC_Recall"]
for name in name_list:
path = str(read_path.joinpath(name + "-Result.xls"))
book = xlrd.open_workbook(path)
table = book.sheet_by_name("ALC_Acc_list")
n_rows = table.nrows
n_cols = table.ncols - 1
data = np.zeros((n_cols,n_rows))
columns = []
for i in range(n_rows):
columns.append(table.row_values(i)[0])
data[:,i] = table.row_values(i)[1:]
df = pd.DataFrame(data=data,columns=columns)
fig, axes = plt.subplots()
df.boxplot(ax=axes)
axes.set_ylabel("ALC-Acc")
plt.xticks(rotation=340)
plt.show()
break
箱线图分析:
An ordinal classification approach for CTG categorization