forked from UNN/2026-rff_mp
сделан анализ данных
This commit is contained in:
parent
cb970daadf
commit
ec3d83df97
|
|
@ -1,4 +1,7 @@
|
|||
import pandas as pd
|
||||
import glob
|
||||
import re
|
||||
import os
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.ticker import AutoMinorLocator
|
||||
import numpy as np
|
||||
|
|
@ -7,17 +10,42 @@ from scipy.optimize import curve_fit
|
|||
from numpy.polynomial import Polynomial
|
||||
|
||||
|
||||
df = pd.read_csv("timedata_500.csv")
|
||||
print(df)
|
||||
folder_path = 'results'
|
||||
|
||||
# 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))
|
||||
|
||||
|
||||
|
||||
|
||||
# ax.set_title("График зависимости фазы от частоты(сх5)")
|
||||
# ax.set_xlabel("v, Hz")
|
||||
# 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
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
Структура,Режим,Операция,Время (сек)
|
||||
bintree,shuffled,delete,7.961999998163568e-05
|
||||
bintree,shuffled,find,0.00015218000001667332
|
||||
bintree,shuffled,insert,0.004734453333367086
|
||||
bintree,sorted,delete,0.010308359999983873
|
||||
bintree,sorted,find,0.017580106666673534
|
||||
bintree,sorted,insert,0.5280084666667032
|
||||
hashtable,shuffled,delete,0.00021999999999016667
|
||||
hashtable,shuffled,find,0.0003197000000605867
|
||||
hashtable,shuffled,insert,0.008171780000050827
|
||||
hashtable,sorted,delete,0.0002543066666324133
|
||||
hashtable,sorted,find,0.00033898666671720667
|
||||
hashtable,sorted,insert,0.007970166666685407
|
||||
linklist,shuffled,delete,0.00390317333329518
|
||||
linklist,shuffled,find,0.005606206666592033
|
||||
linklist,shuffled,insert,0.12853828666672293
|
||||
linklist,sorted,delete,0.0035950133332031467
|
||||
linklist,sorted,find,0.005634519999997127
|
||||
linklist,sorted,insert,0.12352181333332432
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
Структура,Режим,Операция,Время (сек)
|
||||
bintree,shuffled,delete,6.57066667372419e-05
|
||||
bintree,shuffled,find,0.00012748666666384
|
||||
bintree,shuffled,insert,0.0009562066666603
|
||||
bintree,sorted,delete,0.00166193333337402
|
||||
bintree,sorted,find,0.0037453066667088
|
||||
bintree,sorted,insert,0.029374266666703334
|
||||
hashtable,shuffled,delete,8.520000007289733e-05
|
||||
hashtable,shuffled,find,0.00013166666661460668
|
||||
hashtable,shuffled,insert,0.00078531333329006
|
||||
hashtable,sorted,delete,8.037333329108757e-05
|
||||
hashtable,sorted,find,0.00012728666670224
|
||||
hashtable,sorted,insert,0.0007655800000368666
|
||||
linklist,shuffled,delete,0.0008863733333024334
|
||||
linklist,shuffled,find,0.0013728799999322267
|
||||
linklist,shuffled,insert,0.007485353333383146
|
||||
linklist,sorted,delete,0.0008199399999587467
|
||||
linklist,sorted,find,0.0014155133332829932
|
||||
linklist,sorted,insert,0.007525053333286713
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
Структура,Режим,Операция,Время (сек)
|
||||
bintree,shuffled,delete,9.706666670959447e-05
|
||||
bintree,shuffled,find,0.00018228666672253334
|
||||
bintree,shuffled,insert,0.014378579999978032
|
||||
bintree,sorted,delete,0.02119935999999135
|
||||
bintree,sorted,find,0.04120988666665347
|
||||
bintree,sorted,insert,3.347595473333331
|
||||
hashtable,shuffled,delete,0.0006554933332760068
|
||||
hashtable,shuffled,find,0.0008644266666578467
|
||||
hashtable,shuffled,insert,0.05348072666658173
|
||||
hashtable,sorted,delete,0.0005832733334348267
|
||||
hashtable,sorted,find,0.0008229933333495334
|
||||
hashtable,sorted,insert,0.05131764000000957
|
||||
linklist,shuffled,delete,0.01178926666664964
|
||||
linklist,shuffled,find,0.01607516666657218
|
||||
linklist,shuffled,insert,0.8780199133334008
|
||||
linklist,sorted,delete,0.010545446666689353
|
||||
linklist,sorted,find,0.01625823333327687
|
||||
linklist,sorted,insert,0.8802596533333296
|
||||
|
Loading…
Reference in New Issue
Block a user