diff options
author | 20001LastOrder <boqi.chen@mail.mcgill.ca> | 2019-07-31 14:45:06 -0400 |
---|---|---|
committer | 20001LastOrder <boqi.chen@mail.mcgill.ca> | 2019-07-31 14:45:06 -0400 |
commit | 5e8b8c3a817dd9f7ae46338b6dbd3684dfb885fe (patch) | |
tree | 61b473589e5e43a58481ea28b7bbeeaf0860dcdb /Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison | |
parent | consider node types during generation (diff) | |
download | VIATRA-Generator-5e8b8c3a817dd9f7ae46338b6dbd3684dfb885fe.tar.gz VIATRA-Generator-5e8b8c3a817dd9f7ae46338b6dbd3684dfb885fe.tar.zst VIATRA-Generator-5e8b8c3a817dd9f7ae46338b6dbd3684dfb885fe.zip |
Further development of realistic solver, create generation config for ecore models
Diffstat (limited to 'Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison')
-rw-r--r-- | Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/representative_selector .ipynb | 88 |
1 files changed, 60 insertions, 28 deletions
diff --git a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/representative_selector .ipynb b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/representative_selector .ipynb index 329a46f6..543b0ab7 100644 --- a/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/representative_selector .ipynb +++ b/Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison/src/representative_selector .ipynb | |||
@@ -16,7 +16,7 @@ | |||
16 | }, | 16 | }, |
17 | { | 17 | { |
18 | "cell_type": "code", | 18 | "cell_type": "code", |
19 | "execution_count": 11, | 19 | "execution_count": 1, |
20 | "metadata": {}, | 20 | "metadata": {}, |
21 | "outputs": [], | 21 | "outputs": [], |
22 | "source": [ | 22 | "source": [ |
@@ -70,7 +70,7 @@ | |||
70 | { | 70 | { |
71 | "data": { | 71 | "data": { |
72 | "text/plain": [ | 72 | "text/plain": [ |
73 | "304" | 73 | "231" |
74 | ] | 74 | ] |
75 | }, | 75 | }, |
76 | "execution_count": 3, | 76 | "execution_count": 3, |
@@ -90,8 +90,7 @@ | |||
90 | " orientation='horizontal'\n", | 90 | " orientation='horizontal'\n", |
91 | ")\n", | 91 | ")\n", |
92 | "\n", | 92 | "\n", |
93 | "\n", | 93 | "humanFiles = reader.readmultiplefiles('../input/human_models_75/', 1300, False)\n", |
94 | "humanFiles = reader.readmultiplefiles('../input/human_output_100/', 1300, False)\n", | ||
95 | "modelToFileName = {}\n", | 94 | "modelToFileName = {}\n", |
96 | "for name in humanFiles:\n", | 95 | "for name in humanFiles:\n", |
97 | " modelToFileName[GraphStat(name)] = name\n", | 96 | " modelToFileName[GraphStat(name)] = name\n", |
@@ -138,20 +137,29 @@ | |||
138 | "cell_type": "markdown", | 137 | "cell_type": "markdown", |
139 | "metadata": {}, | 138 | "metadata": {}, |
140 | "source": [ | 139 | "source": [ |
141 | "### Find representative for out degree" | 140 | "## Find representative for out degree" |
142 | ] | 141 | ] |
143 | }, | 142 | }, |
144 | { | 143 | { |
145 | "cell_type": "markdown", | 144 | "cell_type": "markdown", |
146 | "metadata": {}, | 145 | "metadata": {}, |
147 | "source": [ | 146 | "source": [ |
147 | "### For Yakindumm\n", | ||
148 | "#### For all human models\n", | 148 | "#### For all human models\n", |
149 | "* the rep found is ../input/humanOutput\\R_20158_run_1.csv\n", | 149 | "* the rep found is ../input/humanOutput\\R_20158_run_1.csv\n", |
150 | "* the average distance between it and others is 0.05515988287586802\n", | 150 | "* the average distance between it and others is 0.05515988287586802\n", |
151 | "\n", | 151 | "\n", |
152 | "#### For human models with $100 \\pm 10$ nodes\n", | 152 | "#### For human models with $100 \\pm 10$ nodes\n", |
153 | "* the rep found is ../input/human_output_100\\R_2015225_run_1.csv\n", | 153 | "* the rep found is ../input/human_output_100\\R_2015225_run_1.csv\n", |
154 | "* the average distance between it and others is $0.046150929558524685$" | 154 | "* the average distance between it and others is $0.046150929558524685$\n", |
155 | "\n", | ||
156 | "#### for human model with $100 \\pm 10$ nodes and new metric\n", | ||
157 | "* the rep found is ../input/human_output_100\\R_2015248_run_1.csv\n", | ||
158 | "* average distance: 0.052753778714861366\n", | ||
159 | "* median: 0.0468131868131868\n", | ||
160 | "* std: 0.0246917800149673\n", | ||
161 | "* max: 0.15993907083015996\n", | ||
162 | "* min: 0.0" | ||
155 | ] | 163 | ] |
156 | }, | 164 | }, |
157 | { | 165 | { |
@@ -163,8 +171,8 @@ | |||
163 | "name": "stdout", | 171 | "name": "stdout", |
164 | "output_type": "stream", | 172 | "output_type": "stream", |
165 | "text": [ | 173 | "text": [ |
166 | "../input/human_output_100\\R_2015225_run_1.csv\n", | 174 | "../input/human_models_75\\146.csv\n", |
167 | "../input/human_output_100\\R_2015225_run_1.csv\n" | 175 | "../input/human_models_75\\146.csv\n" |
168 | ] | 176 | ] |
169 | } | 177 | } |
170 | ], | 178 | ], |
@@ -177,16 +185,17 @@ | |||
177 | }, | 185 | }, |
178 | { | 186 | { |
179 | "cell_type": "code", | 187 | "cell_type": "code", |
180 | "execution_count": 15, | 188 | "execution_count": 6, |
181 | "metadata": {}, | 189 | "metadata": {}, |
182 | "outputs": [ | 190 | "outputs": [ |
183 | { | 191 | { |
184 | "name": "stdout", | 192 | "name": "stdout", |
185 | "output_type": "stream", | 193 | "output_type": "stream", |
186 | "text": [ | 194 | "text": [ |
187 | "average distance: 0.04615092955852465\n", | 195 | "average distance: 0.14846721554626746\n", |
188 | "std: 0.017305709419913242\n", | 196 | "median: 0.11344781014856264\n", |
189 | "max: 0.1411706837186424\n", | 197 | "std: 0.0839789139821567\n", |
198 | "max: 0.40999194198227235\n", | ||
190 | "min: 0.0\n" | 199 | "min: 0.0\n" |
191 | ] | 200 | ] |
192 | } | 201 | } |
@@ -196,6 +205,7 @@ | |||
196 | "for model in models:\n", | 205 | "for model in models:\n", |
197 | " distances.append(ks_value(od_rep_model.out_d, model.out_d))\n", | 206 | " distances.append(ks_value(od_rep_model.out_d, model.out_d))\n", |
198 | "print('average distance: ', np.mean(distances))\n", | 207 | "print('average distance: ', np.mean(distances))\n", |
208 | "print('median: ', np.median(distances))\n", | ||
199 | "print('std: ', np.std(distances))\n", | 209 | "print('std: ', np.std(distances))\n", |
200 | "print('max:', max(distances))\n", | 210 | "print('max:', max(distances))\n", |
201 | "print('min:', min(distances))" | 211 | "print('min:', min(distances))" |
@@ -205,20 +215,29 @@ | |||
205 | "cell_type": "markdown", | 215 | "cell_type": "markdown", |
206 | "metadata": {}, | 216 | "metadata": {}, |
207 | "source": [ | 217 | "source": [ |
208 | "### Find Representative for node activities" | 218 | "## Find Representative for node activities" |
209 | ] | 219 | ] |
210 | }, | 220 | }, |
211 | { | 221 | { |
212 | "cell_type": "markdown", | 222 | "cell_type": "markdown", |
213 | "metadata": {}, | 223 | "metadata": {}, |
214 | "source": [ | 224 | "source": [ |
225 | "### For Yakindumm\n", | ||
215 | "#### For all human models\n", | 226 | "#### For all human models\n", |
216 | "* the rep found is ../input/humanOutput\\R_2016176_run_1.csv\n", | 227 | "* the rep found is ../input/humanOutput\\R_2016176_run_1.csv\n", |
217 | "* the average distance between it and others is 0.05275267434589047\n", | 228 | "* the average distance between it and others is 0.05275267434589047\n", |
218 | "\n", | 229 | "\n", |
219 | "#### For human models with $100 \\pm 10$ nodes\n", | 230 | "#### For human models with $100 \\pm 10$ nodes\n", |
220 | "* the rep found is ../input/human_output_100\\R_2017419_run_1.csv\n", | 231 | "* the rep found is ../input/human_output_100\\R_2017419_run_1.csv\n", |
221 | "* the average distance between it and others is $0.04679429311806747$" | 232 | "* the average distance between it and others is $0.04679429311806747$\n", |
233 | "\n", | ||
234 | "#### for human model with $100 \\pm 10$ nodes and new metric\n", | ||
235 | "* the rep found is ../input/human_output_100\\R_2017131_run_1.csv\n", | ||
236 | "* average distance: 0.024629205820449567\n", | ||
237 | "* median: 0.023787888564682946\n", | ||
238 | "* std: 0.013845547883198073\n", | ||
239 | "* max: 0.09044674910251294\n", | ||
240 | "* min: 0.0" | ||
222 | ] | 241 | ] |
223 | }, | 242 | }, |
224 | { | 243 | { |
@@ -230,8 +249,8 @@ | |||
230 | "name": "stdout", | 249 | "name": "stdout", |
231 | "output_type": "stream", | 250 | "output_type": "stream", |
232 | "text": [ | 251 | "text": [ |
233 | "../input/human_output_100\\R_2017419_run_1.csv\n", | 252 | "../input/human_models_75\\97.csv\n", |
234 | "../input/human_output_100\\R_2017419_run_1.csv\n" | 253 | "../input/human_models_75\\97.csv\n" |
235 | ] | 254 | ] |
236 | } | 255 | } |
237 | ], | 256 | ], |
@@ -244,16 +263,17 @@ | |||
244 | }, | 263 | }, |
245 | { | 264 | { |
246 | "cell_type": "code", | 265 | "cell_type": "code", |
247 | "execution_count": 14, | 266 | "execution_count": 8, |
248 | "metadata": {}, | 267 | "metadata": {}, |
249 | "outputs": [ | 268 | "outputs": [ |
250 | { | 269 | { |
251 | "name": "stdout", | 270 | "name": "stdout", |
252 | "output_type": "stream", | 271 | "output_type": "stream", |
253 | "text": [ | 272 | "text": [ |
254 | "average distance: 0.046794293118067494\n", | 273 | "average distance: 0.16296252607812808\n", |
255 | "std: 0.02880119213919405\n", | 274 | "median: 0.11606886657101867\n", |
256 | "max: 0.18702970297029703\n", | 275 | "std: 0.1196590575339798\n", |
276 | "max: 0.49411764705882355\n", | ||
257 | "min: 0.0\n" | 277 | "min: 0.0\n" |
258 | ] | 278 | ] |
259 | } | 279 | } |
@@ -263,6 +283,7 @@ | |||
263 | "for model in models:\n", | 283 | "for model in models:\n", |
264 | " distances.append(ks_value(na_rep_model.na, model.na))\n", | 284 | " distances.append(ks_value(na_rep_model.na, model.na))\n", |
265 | "print('average distance: ', np.mean(distances))\n", | 285 | "print('average distance: ', np.mean(distances))\n", |
286 | "print('median: ', np.median(distances))\n", | ||
266 | "print('std: ', np.std(distances))\n", | 287 | "print('std: ', np.std(distances))\n", |
267 | "print('max:', max(distances))\n", | 288 | "print('max:', max(distances))\n", |
268 | "print('min:', min(distances))" | 289 | "print('min:', min(distances))" |
@@ -272,20 +293,29 @@ | |||
272 | "cell_type": "markdown", | 293 | "cell_type": "markdown", |
273 | "metadata": {}, | 294 | "metadata": {}, |
274 | "source": [ | 295 | "source": [ |
275 | "### Find Representative for MPC" | 296 | "## Find Representative for MPC" |
276 | ] | 297 | ] |
277 | }, | 298 | }, |
278 | { | 299 | { |
279 | "cell_type": "markdown", | 300 | "cell_type": "markdown", |
280 | "metadata": {}, | 301 | "metadata": {}, |
281 | "source": [ | 302 | "source": [ |
303 | "### For Yakindumm\n", | ||
304 | "\n", | ||
282 | "#### For all human models\n", | 305 | "#### For all human models\n", |
283 | "* the rep found is ../input/humanOutput\\R_2015246_run_1.csv\n", | 306 | "* the rep found is ../input/humanOutput\\R_2015246_run_1.csv\n", |
284 | "* the average distance between it and others is 0.08556632702185384\n", | 307 | "* the average distance between it and others is 0.08556632702185384\n", |
285 | "\n", | 308 | "\n", |
286 | "#### For human models with $100 \\pm 10$ nodes\n", | 309 | "#### For human models with $100 \\pm 10$ nodes\n", |
287 | "* the rep found is ../input/human_output_100\\R_2016324_run_1.csv\n", | 310 | "* the rep found is ../input/human_output_100\\R_2016324_run_1.csv\n", |
288 | "* the average distance between it and others is $0.07028909225833631$" | 311 | "* the average distance between it and others is $0.07028909225833631$\n", |
312 | "\n", | ||
313 | "#### for human model with $100 \\pm 10$ nodes and new metric\n", | ||
314 | "* average distance: 0.054782550772603904\n", | ||
315 | "* median: 0.048330503678551184\n", | ||
316 | "* std: 0.028208257424907526\n", | ||
317 | "* max: 0.21181525241675614\n", | ||
318 | "* min: 0.0" | ||
289 | ] | 319 | ] |
290 | }, | 320 | }, |
291 | { | 321 | { |
@@ -297,8 +327,8 @@ | |||
297 | "name": "stdout", | 327 | "name": "stdout", |
298 | "output_type": "stream", | 328 | "output_type": "stream", |
299 | "text": [ | 329 | "text": [ |
300 | "../input/human_output_100\\R_2016324_run_1.csv\n", | 330 | "../input/human_models_75\\151.csv\n", |
301 | "../input/human_output_100\\R_2016324_run_1.csv\n" | 331 | "../input/human_models_75\\151.csv\n" |
302 | ] | 332 | ] |
303 | } | 333 | } |
304 | ], | 334 | ], |
@@ -311,16 +341,17 @@ | |||
311 | }, | 341 | }, |
312 | { | 342 | { |
313 | "cell_type": "code", | 343 | "cell_type": "code", |
314 | "execution_count": 16, | 344 | "execution_count": 10, |
315 | "metadata": {}, | 345 | "metadata": {}, |
316 | "outputs": [ | 346 | "outputs": [ |
317 | { | 347 | { |
318 | "name": "stdout", | 348 | "name": "stdout", |
319 | "output_type": "stream", | 349 | "output_type": "stream", |
320 | "text": [ | 350 | "text": [ |
321 | "average distance: 0.07028909225833632\n", | 351 | "average distance: 0.18751521685526348\n", |
322 | "std: 0.03728189051222417\n", | 352 | "median: 0.13400833829660508\n", |
323 | "max: 0.21961550993809065\n", | 353 | "std: 0.13829078925748192\n", |
354 | "max: 0.5745366639806608\n", | ||
324 | "min: 0.0\n" | 355 | "min: 0.0\n" |
325 | ] | 356 | ] |
326 | } | 357 | } |
@@ -330,6 +361,7 @@ | |||
330 | "for model in models:\n", | 361 | "for model in models:\n", |
331 | " distances.append(ks_value(mpc_rep_model.mpc, model.mpc))\n", | 362 | " distances.append(ks_value(mpc_rep_model.mpc, model.mpc))\n", |
332 | "print('average distance: ', np.mean(distances))\n", | 363 | "print('average distance: ', np.mean(distances))\n", |
364 | "print('median: ', np.median(distances))\n", | ||
333 | "print('std: ', np.std(distances))\n", | 365 | "print('std: ', np.std(distances))\n", |
334 | "print('max:', max(distances))\n", | 366 | "print('max:', max(distances))\n", |
335 | "print('min:', min(distances))" | 367 | "print('min:', min(distances))" |