コード例 #1
0
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as tick
import matplotlib.markers as marker
import matplotlib.axes as axes

from matplotlib.ticker import FormatStrFormatter
from src.util.results2folder import makefolder_name
###############################################################################
# maximum depth of search
###############################################################################

folder_load = os.path.join("results", "maxdepth_results", "summary.csv")
folder_save = "maxdepth_plot"
folder_path = makefolder_name(folder_save)
df = pd.read_csv(folder_load, index_col=False)

datasetsnames = np.unique(df.datasetname)
results2plot = dict()
for datname in datasetsnames:
    results2plot[datname] = dict()
    results2plot[datname]["maxdepth"] = df[df.datasetname ==
                                           datname].maxdepth.to_numpy()
    results2plot[datname]["compression"] = df[df.datasetname ==
                                              datname].length_ratio.to_numpy()
    results2plot[datname]["time"] = df[df.datasetname ==
                                       datname].runtime.to_numpy()
    results2plot[datname]["conditions"] = df[df.datasetname ==
                                             datname].avg_items.to_numpy()
コード例 #2
0
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as tick
import matplotlib.markers as marker
import matplotlib.axes as axes

from matplotlib.ticker import FormatStrFormatter
from src.util.results2folder import makefolder_name

###############################################################################
# runtime plot
###############################################################################

name_save = "plot_runtime"
algorithms = ["SSDpp", "seqcover", "topk"]
folder_path = makefolder_name(name_save)
variable = "runtime"
s = 50
alp = 0.7
fig = plt.figure()
ax = plt.gca()
list_markers = ['s', 'D', 'v', '^', '<', "o", '>']
# load data
results = dict()
for ialg, alg in enumerate(algorithms):
    folder_load = os.path.join("results", alg, "summary.csv")
    results[alg] = pd.read_csv(folder_load, index_col=False)

labelstotal = results["SSDpp"].datasetname.to_numpy()
#ax.axvline(10.5,linewidth =1,linestyle="-.", color =(0,0,0))
for ialg, alg in enumerate(algorithms):
コード例 #3
0
ファイル: runDSSDtopk.py プロジェクト: wsgan001/SSDpp-numeric
    "dee": 8,
    "ele-1": 9,
    "forestFires": 23,
    "concrete": 19,
    "treasury": 31,
    "wizmir": 22,
    "abalone": 25,
    "puma32h": 42,
    "ailerons": 197,
    "elevators": 160,
    "bikesharing": 127,
    "california": 163,
    "house": 280
}

savefile = makefolder_name(algorithmname)
savefile = savefile + "/summary.csv"
#savefile = "./results/"+algorithmname+"a_summary.txt"
print(
    "datasetname,kl_supp,avg_supp,wkl_supp,kl_usg,avg_usg,wkl_usg,wacc_supp,wacc_usg,wkl_sum,jacc_avg,n_rules,avg_items,nrows_train,std_rules,top1_std,runtime,",
    file=open(savefile, "w"))
testpercentage = 0.2
beam_width = 100
depthmax = 5
topkalgorithm = 2000
for datasetname in datasetnames:
    print("dataset name : " + str(datasetname))
    file_data = filedatasets + datasetname + ".csv"
    df = pd.read_csv(file_data, sep=delimiter)
    df.rename(columns={df.columns[-1]: "class"}, inplace=True)
    dfaux = df