Skip to content

Commit b92fc6a

Browse files
some experiments
1 parent 36477e3 commit b92fc6a

7 files changed

+19255
-2204
lines changed
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import pandas as pd\n",
10+
"import os\n",
11+
"\n",
12+
"IGRIDA=True \n",
13+
"if (IGRIDA):\n",
14+
" dirname = os.path.dirname(__file__)\n",
15+
" dataset_size_location = \"../rf-analysis/all_size_withyes.pkl\"\n",
16+
" dataset_size_filename = os.path.join(dirname, dataset_size_location) \n",
17+
" df = pd.read_pickle(dataset_size_filename)\n",
18+
"#else:\n",
19+
"# import tuxml\n",
20+
"# df = tuxml.load_dataset()"
21+
]
22+
},
23+
{
24+
"cell_type": "code",
25+
"execution_count": null,
26+
"metadata": {},
27+
"outputs": [],
28+
"source": [
29+
"size_methods = [\"vmlinux\", \"GZIP-bzImage\", \"GZIP-vmlinux\", \"GZIP\", \"BZIP2-bzImage\", \n",
30+
" \"BZIP2-vmlinux\", \"BZIP2\", \"LZMA-bzImage\", \"LZMA-vmlinux\", \"LZMA\", \"XZ-bzImage\", \"XZ-vmlinux\", \"XZ\", \n",
31+
" \"LZO-bzImage\", \"LZO-vmlinux\", \"LZO\", \"LZ4-bzImage\", \"LZ4-vmlinux\", \"LZ4\"]\n"
32+
]
33+
},
34+
{
35+
"cell_type": "code",
36+
"execution_count": null,
37+
"metadata": {},
38+
"outputs": [],
39+
"source": [
40+
"def _filter(df):\n",
41+
" return df.drop(columns=[\"cid\"]).drop(columns=size_methods)\n",
42+
"fdf = _filter(df)\n",
43+
"\n",
44+
"dict_corr = []\n",
45+
"def _samecolumns_after_ithcolumn(fd, i):\n",
46+
" col_i = fd[fd.columns[i]] # the column we want to compare with\n",
47+
" for j in range(i+1, len(fd.columns) - 1):\n",
48+
" if (col_i.equals(fd[fd.columns[j]])):\n",
49+
" dict_corr.append({fd.columns[i] : fd.columns[j]})\n",
50+
"\n",
51+
"# TIME CONSUMING !!\n",
52+
"starting_point = 0\n",
53+
"ending_point = len(fdf)\n",
54+
"for i in range(starting_point, ending_point):\n",
55+
" _samecolumns_after_ithcolumn(fdf, i)\n",
56+
"\n"
57+
]
58+
},
59+
{
60+
"cell_type": "code",
61+
"execution_count": null,
62+
"metadata": {},
63+
"outputs": [],
64+
"source": [
65+
"pd.DataFrame(dict_corr).to_csv('ft-correlations.csv')"
66+
]
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": null,
71+
"metadata": {},
72+
"outputs": [],
73+
"source": [
74+
"def correlated_to(fd, option_name):\n",
75+
" i = fd.columns.get_loc(option_name)\n",
76+
" col_i = fd[fd.columns[i]] # the column we want to compare with\n",
77+
" for j in range(0, len(fd.columns) - 1):\n",
78+
" if (i == j):\n",
79+
" continue\n",
80+
" if (col_i.equals(fd[fd.columns[j]])):\n",
81+
" print(fd.columns[i], \"correlated to\", fd.columns[j])\n",
82+
"\n",
83+
"# correlated_to(fdf, \"CC_OPTIMIZE_FOR_SIZE\")"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": null,
89+
"metadata": {},
90+
"outputs": [],
91+
"source": [
92+
"# TODO: when 'y' value, correlation! \n",
93+
"# interesting to see this effect (ie some options are correlated under some conditions)\n",
94+
"# fdf.query('CC_OPTIMIZE_FOR_SIZE == 1')['CC_OPTIMIZE_FOR_SIZE'].value_counts(), fdf.query('CC_OPTIMIZE_FOR_SIZE == 1')['KMEMCHECK'].value_counts()"
95+
]
96+
},
97+
{
98+
"cell_type": "code",
99+
"execution_count": null,
100+
"metadata": {},
101+
"outputs": [],
102+
"source": []
103+
},
104+
{
105+
"cell_type": "code",
106+
"execution_count": null,
107+
"metadata": {},
108+
"outputs": [],
109+
"source": []
110+
}
111+
],
112+
"metadata": {
113+
"kernelspec": {
114+
"display_name": "Python 3",
115+
"language": "python",
116+
"name": "python3"
117+
},
118+
"language_info": {
119+
"codemirror_mode": {
120+
"name": "ipython",
121+
"version": 3
122+
},
123+
"file_extension": ".py",
124+
"mimetype": "text/x-python",
125+
"name": "python",
126+
"nbconvert_exporter": "python",
127+
"pygments_lexer": "ipython3",
128+
"version": "3.7.3"
129+
}
130+
},
131+
"nbformat": 4,
132+
"nbformat_minor": 2
133+
}

0 commit comments

Comments
 (0)