craceplot 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- craceplot/__init__.py +60 -0
- craceplot/_containers/__init__.py +0 -0
- craceplot/_containers/_core.py +1602 -0
- craceplot/_containers/_draw.py +104 -0
- craceplot/_inst/examples/acotsp/crace-3240078.stdout +838 -0
- craceplot/_inst/examples/acotsp/crace.stderr +8 -0
- craceplot/_inst/examples/acotsp/crace.test +216 -0
- craceplot/_inst/examples/acotsp/crace.train +622 -0
- craceplot/_inst/examples/cats200/crace-2814581.stdout +1665 -0
- craceplot/_inst/examples/cats200/crace.stderr +10 -0
- craceplot/_inst/examples/cats200/crace.test +1010 -0
- craceplot/_inst/examples/cats200/crace.train +655 -0
- craceplot/_plots/__init__.py +8 -0
- craceplot/_plots/_core.py +80 -0
- craceplot/_plots/parameters.py +1805 -0
- craceplot/_plots/quality.py +1406 -0
- craceplot/_scripts/__init__.py +4 -0
- craceplot/_scripts/_main.py +132 -0
- craceplot/_scripts/_utils.py +66 -0
- craceplot/_scripts/main +3 -0
- craceplot/_scripts/open_guide +12 -0
- craceplot/_settings/_description.py +168 -0
- craceplot/_settings/_options.json +299 -0
- craceplot/_utils/__init__.py +0 -0
- craceplot/_utils/_base.py +196 -0
- craceplot/_utils/_const.py +8 -0
- craceplot/_utils/_crace.py +42 -0
- craceplot/_utils/_format.py +191 -0
- craceplot/_vergit.py +2 -0
- craceplot/_version.py +24 -0
- craceplot/_vignettes/guide.ipynb +18943 -0
- craceplot-0.1.0.dist-info/METADATA +369 -0
- craceplot-0.1.0.dist-info/RECORD +61 -0
- craceplot-0.1.0.dist-info/WHEEL +5 -0
- craceplot-0.1.0.dist-info/entry_points.txt +2 -0
- craceplot-0.1.0.dist-info/licenses/LICENSE.md +21 -0
- craceplot-0.1.0.dist-info/top_level.txt +2 -0
- docs/_config.yml +51 -0
- docs/_static/css/custom.css +168 -0
- docs/_static/js/navbar.js +40 -0
- docs/_toc.yml +5 -0
- docs/index.md +4 -0
- docs/references/404.md +14 -0
- docs/references/authors.md +46 -0
- docs/references/citiation.bib +17 -0
- docs/references/functions/index.md +5 -0
- docs/references/functions/param_boxplot.ipynb +19 -0
- docs/references/index.md +44 -0
- docs/references/license.md +21 -0
- docs/references/others/favicon.ico +0 -0
- docs/references/others/favicon_io/about.txt +6 -0
- docs/references/others/favicon_io/android-chrome-192x192.png +0 -0
- docs/references/others/favicon_io/android-chrome-512x512.png +0 -0
- docs/references/others/favicon_io/apple-touch-icon.png +0 -0
- docs/references/others/favicon_io/favicon-16x16.png +0 -0
- docs/references/others/favicon_io/favicon-32x32.png +0 -0
- docs/references/others/favicon_io/site.webmanifest +1 -0
- docs/references/others/logo.png +0 -0
- docs/references/others/logo1.png +0 -0
- docs/references/plots/acotsp-parallelcoord-all.png +0 -0
- docs/requirements.txt +5 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
|
|
3
|
+
# __all__ = ['bold', 'underline', 'reset', 'register', 'enforce_types', 'add_slice', 'add_ins', 'safe_copy']
|
|
4
|
+
|
|
5
|
+
def init_plot_style(size=1.0):
|
|
6
|
+
import matplotlib as mpl
|
|
7
|
+
import seaborn as sns
|
|
8
|
+
|
|
9
|
+
mpl.rcdefaults()
|
|
10
|
+
sns.set_theme(
|
|
11
|
+
style="white",
|
|
12
|
+
context="paper",
|
|
13
|
+
font_scale=size,
|
|
14
|
+
rc={
|
|
15
|
+
# "font.size": size,
|
|
16
|
+
"axes.grid": True,
|
|
17
|
+
"axes.facecolor": "white",
|
|
18
|
+
"figure.facecolor": "white",
|
|
19
|
+
"savefig.facecolor": "white",
|
|
20
|
+
"axes.edgecolor": "black",
|
|
21
|
+
"xtick.color": "black",
|
|
22
|
+
"ytick.color": "black",
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
def add_elites(data: pd.DataFrame, slice: pd.DataFrame, final: list, select: list=None):
|
|
27
|
+
"""add slice information to selected data"""
|
|
28
|
+
new = pd.DataFrame()
|
|
29
|
+
tmp = []
|
|
30
|
+
|
|
31
|
+
if select is None:
|
|
32
|
+
if 'elites' not in slice.columns.values:
|
|
33
|
+
print("'slice' object has no attribute 'elites'")
|
|
34
|
+
return data
|
|
35
|
+
|
|
36
|
+
for idx, row in enumerate(slice.itertuples(), start=1):
|
|
37
|
+
sel = data[
|
|
38
|
+
data['configuration_id'].isin(row.elites) &
|
|
39
|
+
(data['end_time'] <= row.end_time)
|
|
40
|
+
].copy()
|
|
41
|
+
sel['slice_elites'] = idx
|
|
42
|
+
tmp.append(sel)
|
|
43
|
+
|
|
44
|
+
last_end_time = slice.iloc[-1].end_time
|
|
45
|
+
last_idx = idx + 1
|
|
46
|
+
last = data[
|
|
47
|
+
data['configuration_id'].isin(final) &
|
|
48
|
+
(data['end_time'] > last_end_time)
|
|
49
|
+
].copy()
|
|
50
|
+
last['slice_elites'] = last_idx
|
|
51
|
+
tmp.append(last)
|
|
52
|
+
|
|
53
|
+
else:
|
|
54
|
+
for idx, group in enumerate(select, start=1):
|
|
55
|
+
if isinstance(group, int): group = [group]
|
|
56
|
+
for cid in group:
|
|
57
|
+
sel = data.loc[data['configuration_id'] == cid].copy()
|
|
58
|
+
sel['group'] = idx
|
|
59
|
+
tmp.append(sel)
|
|
60
|
+
|
|
61
|
+
new = pd.concat(tmp, ignore_index=True)
|
|
62
|
+
return new
|
|
63
|
+
|
|
64
|
+
def add_ins(data: pd.DataFrame):
|
|
65
|
+
"""add ins information to selected data"""
|
|
66
|
+
|
|
67
|
+
n_ins = data.groupby(['configuration_id']).size().reset_index(name='n_ins')
|
|
68
|
+
new = data[['configuration_id']].drop_duplicates()
|
|
69
|
+
new = pd.merge(new, n_ins, on=['configuration_id'], how='left')
|
|
70
|
+
|
|
71
|
+
return new
|
|
72
|
+
|
|
73
|
+
def add_best(data: pd.DataFrame):
|
|
74
|
+
"""add minimal quality for each instance based on all configurations"""
|
|
75
|
+
sel_data = data[['configuration_id', 'instance_id', 'quality']].dropna()
|
|
76
|
+
min_qual = sel_data.groupby(['instance_id'], as_index=False).min()
|
|
77
|
+
min_qual['configuration_id']=0
|
|
78
|
+
new = pd.concat([sel_data, min_qual], ignore_index=True)
|
|
79
|
+
|
|
80
|
+
return new
|