<jupyter_start><jupyter_text><jupyter_code>#file_paths = glob.glob(".\\data\\*")
file_paths = glob.glob("./data/*")
#print(file_paths)

category =np.empty((0,1), float)
rssi =np.empty((0,100), float)

for file in file_paths:
    d = np.loadtxt(file, delimiter=',')
    category_tmp, rssi_tmp = np.hsplit(d, [1])
    rssi = np.concatenate([rssi, rssi_tmp], axis=0)
    category = np.concatenate([category, category_tmp], axis=0)

all_data_count = category.shape[0]
seating_data_count = np.count_nonzero(category > 0)
print("all data count : ", all_data_count)

data_pie = [seating_data_count, all_data_count - seating_data_count]
label = ["Seating", "NOT Seating"]
plt.pie(data_pie, labels=label, counterclock=False, startangle=90, autopct="%1.1f%%")
#file_paths = glob.glob(".\\data\\*")
file_paths = glob.glob("./data/*")

all_data = np.empty((0,101), float)

for file in file_paths:
    d = np.loadtxt(file, delimiter=',')
    all_data = np.concatenate([all_data, d], axis=0)
print(all_data.shape)

seating_data = np.empty((0,101), float)
not_seating_data = np.empty((0,101), float)
max_data = []
min_data = []
mean_data = []
median_data = []
std_data = []
diff_data = []
category_data = []
for data in all_data:
    #print(data)
    #if data[0] == 1.0:
    category_data.append(data[0]*10-30)
    data = np.delete(data, 0)
    max_data.append(data.max())
    min_data.append(data.min())
    diff_data.append(data.max() - data.min())
    mean_data.append(data.mean())
    median_data.append(np.median(data))
    std_data.append(np.std(data))

max_data2 = []
min_data2 = []
mean_data2 = []
median_data2 = []
std_data2 = []
category_data2 = []
for i in range(len(std_data)):
    if std_data[i] < 1.0:
        max_data2.append(max_data[i])
        min_data2.append(min_data[i])
        mean_data2.append(mean_data[i])
        median_data2.append(median_data[i])
        category_data2.append(category_data[i])

plt.plot(max_data)
plt.plot(min_data)
plt.plot(mean_data)
plt.plot(category_data)
#plt.title('max rssi')
plt.ylabel('rssi')
plt.xlabel('number')
plt.legend(['max', 'min', 'mean', 'category'], loc='upper left')
plt.show()

plt.plot(mean_data)
plt.plot(median_data)
#plt.plot(category_data)
#plt.title('max rssi')
plt.ylabel('rssi')
plt.xlabel('number')
plt.legend(['mean', 'median'], loc='upper left')
plt.show()

plt.hist(std_data)
plt.show()

plt.plot(max_data2)
plt.plot(min_data2)
plt.plot(mean_data2)
plt.plot(median_data2)
#plt.plot(category_data2)
#plt.title('max rssi')
plt.ylabel('rssi')
plt.xlabel('number')
plt.legend(['max2', 'min2', 'mean2', 'median2', 'category2'], loc='upper left')
plt.show()

plt.plot(diff_data)
#plt.plot(category_data)
#plt.title('max rssi')
plt.ylabel('rssi')
plt.xlabel('number')
plt.legend(['diff', 'category2'], loc='upper left')
plt.show()
file_paths = glob.glob(".\\data2\\*")
print(file_paths)

fig = plt.figure(figsize=(20,10))
GRAPHE_NUM = 4
X_LIM_MAX = -30
X_LIM_MIN = -70
X_TICKS = 9
Y_LIM_MAX = 0.3
Y_LIM_MIN = 0
Y_TICKS = 7

graph_count = 1
for file in file_paths:
    d = np.loadtxt(file, delimiter=',')

    cat, rssi = np.hsplit(d, [1])

    rssi_max = rssi.max()
    rssi_min = rssi.min()
    rssi_mean = rssi.mean()
    rssi_median = np.median(rssi)
    rssi_width = np.abs(rssi.max()-rssi.min())

    ax = fig.add_subplot(GRAPHE_NUM/2, 2, graph_count)
    plt.xlim(X_LIM_MIN, X_LIM_MAX)
    plt.xticks(np.linspace(X_LIM_MIN, X_LIM_MAX, X_TICKS))
    plt.ylim(Y_LIM_MIN, Y_LIM_MAX)
    plt.yticks(np.linspace(Y_LIM_MIN, Y_LIM_MAX, Y_TICKS))
    
    plt.text(X_LIM_MIN, Y_LIM_MIN,\
             'MAX   : ' + '{:.1f}'.format(rssi_max) + '\n'\
             'MIN   : ' + '{:.1f}'.format(rssi_min) + '\n'\
             'MEAN  : ' + '{:.1f}'.format(rssi_mean) + '\n'\
             'MEDIAN : ' + '{:.1f}'.format(rssi_median) + '\n'\
             , fontsize=13)
    
    if graph_count % 2 == 1:
        plt.title('NOT seating hist\n( ' + file + ' )')
        (a_hist3, a_bins3, _) = ax.hist(rssi, bins=int(rssi_width), density=True, color="tab:green")
    else:
        plt.title('seating hist\n( ' + file + ' )')
        (a_hist3, a_bins3, _) = ax.hist(rssi, bins=int(rssi_width), density=True, color="tab:orange")
    
    graph_count += 1

fig.show()<jupyter_output>['.\\data2\\20200402_not_seating.csv', '.\\data2\\20200402_seating.csv', '.\\data2\\20200406_not_seating.csv', '.\\data2\\20200406_seating.csv']
{'fraction_non_alphanumeric': 0.19061784897025172, 'fraction_numerical': 0.029519450800915333, 'mean_word_length': 4.059027777777778, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '584720', 'license': 'MIT', 'n_tokens_mistral': 1952, 'n_tokens_neox': 1818, 'n_words': 279, 'path': 'seating_detection_data_analyze.ipynb', 'repo_name': 'naonaorange/seating_detection_algorithm', 'size': '4370'}