forked from UNN/2026-rff_mp
сделан анализ данных
This commit is contained in:
parent
cb970daadf
commit
ec3d83df97
|
|
@ -1,4 +1,7 @@
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
import glob
|
||||||
|
import re
|
||||||
|
import os
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
from matplotlib.ticker import AutoMinorLocator
|
from matplotlib.ticker import AutoMinorLocator
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
@ -7,17 +10,42 @@ from scipy.optimize import curve_fit
|
||||||
from numpy.polynomial import Polynomial
|
from numpy.polynomial import Polynomial
|
||||||
|
|
||||||
|
|
||||||
df = pd.read_csv("timedata_500.csv")
|
folder_path = 'results'
|
||||||
print(df)
|
|
||||||
|
# 2. Список размеров (500, 1000, 2000, 5000, 10000)
|
||||||
|
sizes = ['500', '1000', '2000', '5000', '10000']
|
||||||
|
|
||||||
|
for size in sizes:
|
||||||
|
files = glob.glob(os.path.join(folder_path, f'timedata_{size}_epochs_*.csv'))
|
||||||
|
|
||||||
|
if not files:
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Читаем файлы
|
||||||
|
dfs = [pd.read_csv(f) for f in files]
|
||||||
|
|
||||||
|
# 1. Определяем, какие колонки текстовые (не числовые)
|
||||||
|
# Предполагаем, что во всех файлах они одинаковые
|
||||||
|
text_cols = dfs[0].select_dtypes(exclude=['number']).columns.tolist()
|
||||||
|
|
||||||
|
# 2. Объединяем и считаем среднее
|
||||||
|
# Группируем по текстовым колонкам, чтобы они остались в результате
|
||||||
|
if text_cols:
|
||||||
|
combined = pd.concat(dfs)
|
||||||
|
mean_df = combined.groupby(text_cols).mean().reset_index()
|
||||||
|
else:
|
||||||
|
# Если текста нет, просто среднее по строкам
|
||||||
|
mean_df = pd.concat(dfs).groupby(level=0).mean()
|
||||||
|
|
||||||
|
|
||||||
|
output_name = f'average_timedata_{size}.csv'
|
||||||
|
mean_df.to_csv(os.path.join(folder_path, output_name), index=False)
|
||||||
|
print(f"Файл {output_name} успешно создан")
|
||||||
|
|
||||||
# построение графика
|
# построение графика
|
||||||
# fig, ax = plt.subplots(figsize=(8, 5))
|
# fig, ax = plt.subplots(figsize=(8, 5))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ax.set_title("График зависимости фазы от частоты(сх5)")
|
# ax.set_title("График зависимости фазы от частоты(сх5)")
|
||||||
# ax.set_xlabel("v, Hz")
|
# ax.set_xlabel("v, Hz")
|
||||||
# ax.set_ylabel("phi, rad")
|
# ax.set_ylabel("phi, rad")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
Структура,Режим,Операция,Время (сек)
|
||||||
|
bintree,shuffled,delete,7.1253333317145e-05
|
||||||
|
bintree,shuffled,find,0.00013709333328122667
|
||||||
|
bintree,shuffled,insert,0.00207977333326802
|
||||||
|
bintree,sorted,delete,0.004027406666697627
|
||||||
|
bintree,sorted,find,0.008272293333326707
|
||||||
|
bintree,sorted,insert,0.12546639333337828
|
||||||
|
hashtable,shuffled,delete,0.00012531333333446666
|
||||||
|
hashtable,shuffled,find,0.00018659333342529335
|
||||||
|
hashtable,shuffled,insert,0.0021367066666243334
|
||||||
|
hashtable,sorted,delete,0.00012610666664531332
|
||||||
|
hashtable,sorted,find,0.00017989333330958
|
||||||
|
hashtable,sorted,insert,0.0020845666666142264
|
||||||
|
linklist,shuffled,delete,0.0014374400000330134
|
||||||
|
linklist,shuffled,find,0.0026490666666783135
|
||||||
|
linklist,shuffled,insert,0.027241586666680903
|
||||||
|
linklist,sorted,delete,0.0016270466666658602
|
||||||
|
linklist,sorted,find,0.0025114866666474866
|
||||||
|
linklist,sorted,insert,0.02720876666670236
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
Структура,Режим,Операция,Время (сек)
|
||||||
|
bintree,shuffled,delete,9.902666667279779e-05
|
||||||
|
bintree,shuffled,find,0.0001944666667137333
|
||||||
|
bintree,shuffled,insert,0.03110178666661335
|
||||||
|
bintree,sorted,delete,0.04493390000003876
|
||||||
|
bintree,sorted,find,0.08307538000003656
|
||||||
|
bintree,sorted,insert,13.248167193333348
|
||||||
|
hashtable,shuffled,delete,0.0009765399999347067
|
||||||
|
hashtable,shuffled,find,0.0015001800000693933
|
||||||
|
hashtable,shuffled,insert,0.1658438800000264
|
||||||
|
hashtable,sorted,delete,0.00089762666668012
|
||||||
|
hashtable,sorted,find,0.0014446866666578669
|
||||||
|
hashtable,sorted,insert,0.16466330666664053
|
||||||
|
linklist,shuffled,delete,0.016608193333286114
|
||||||
|
linklist,shuffled,find,0.028897673333312873
|
||||||
|
linklist,shuffled,insert,2.859923846666667
|
||||||
|
linklist,sorted,delete,0.0175646400000611
|
||||||
|
linklist,sorted,find,0.031122179999980872
|
||||||
|
linklist,sorted,insert,3.049302733333343
|
||||||
|
Gitea Version: 1.22.0 |
