From 5e8b8c3a817dd9f7ae46338b6dbd3684dfb885fe Mon Sep 17 00:00:00 2001 From: 20001LastOrder Date: Wed, 31 Jul 2019 14:45:06 -0400 Subject: Further development of realistic solver, create generation config for ecore models --- .../src/representative_selector .ipynb | 88 +++++++++++++++------- 1 file changed, 60 insertions(+), 28 deletions(-) (limited to 'Metrics/Metrics-Calculation/metrics_plot/model_evolve_comparison') 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 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -70,7 +70,7 @@ { "data": { "text/plain": [ - "304" + "231" ] }, "execution_count": 3, @@ -90,8 +90,7 @@ " orientation='horizontal'\n", ")\n", "\n", - "\n", - "humanFiles = reader.readmultiplefiles('../input/human_output_100/', 1300, False)\n", + "humanFiles = reader.readmultiplefiles('../input/human_models_75/', 1300, False)\n", "modelToFileName = {}\n", "for name in humanFiles:\n", " modelToFileName[GraphStat(name)] = name\n", @@ -138,20 +137,29 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Find representative for out degree" + "## Find representative for out degree" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ + "### For Yakindumm\n", "#### For all human models\n", "* the rep found is ../input/humanOutput\\R_20158_run_1.csv\n", "* the average distance between it and others is 0.05515988287586802\n", "\n", "#### For human models with $100 \\pm 10$ nodes\n", "* the rep found is ../input/human_output_100\\R_2015225_run_1.csv\n", - "* the average distance between it and others is $0.046150929558524685$" + "* the average distance between it and others is $0.046150929558524685$\n", + "\n", + "#### for human model with $100 \\pm 10$ nodes and new metric\n", + "* the rep found is ../input/human_output_100\\R_2015248_run_1.csv\n", + "* average distance: 0.052753778714861366\n", + "* median: 0.0468131868131868\n", + "* std: 0.0246917800149673\n", + "* max: 0.15993907083015996\n", + "* min: 0.0" ] }, { @@ -163,8 +171,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "../input/human_output_100\\R_2015225_run_1.csv\n", - "../input/human_output_100\\R_2015225_run_1.csv\n" + "../input/human_models_75\\146.csv\n", + "../input/human_models_75\\146.csv\n" ] } ], @@ -177,16 +185,17 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "average distance: 0.04615092955852465\n", - "std: 0.017305709419913242\n", - "max: 0.1411706837186424\n", + "average distance: 0.14846721554626746\n", + "median: 0.11344781014856264\n", + "std: 0.0839789139821567\n", + "max: 0.40999194198227235\n", "min: 0.0\n" ] } @@ -196,6 +205,7 @@ "for model in models:\n", " distances.append(ks_value(od_rep_model.out_d, model.out_d))\n", "print('average distance: ', np.mean(distances))\n", + "print('median: ', np.median(distances))\n", "print('std: ', np.std(distances))\n", "print('max:', max(distances))\n", "print('min:', min(distances))" @@ -205,20 +215,29 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Find Representative for node activities" + "## Find Representative for node activities" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ + "### For Yakindumm\n", "#### For all human models\n", "* the rep found is ../input/humanOutput\\R_2016176_run_1.csv\n", "* the average distance between it and others is 0.05275267434589047\n", "\n", "#### For human models with $100 \\pm 10$ nodes\n", "* the rep found is ../input/human_output_100\\R_2017419_run_1.csv\n", - "* the average distance between it and others is $0.04679429311806747$" + "* the average distance between it and others is $0.04679429311806747$\n", + "\n", + "#### for human model with $100 \\pm 10$ nodes and new metric\n", + "* the rep found is ../input/human_output_100\\R_2017131_run_1.csv\n", + "* average distance: 0.024629205820449567\n", + "* median: 0.023787888564682946\n", + "* std: 0.013845547883198073\n", + "* max: 0.09044674910251294\n", + "* min: 0.0" ] }, { @@ -230,8 +249,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "../input/human_output_100\\R_2017419_run_1.csv\n", - "../input/human_output_100\\R_2017419_run_1.csv\n" + "../input/human_models_75\\97.csv\n", + "../input/human_models_75\\97.csv\n" ] } ], @@ -244,16 +263,17 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "average distance: 0.046794293118067494\n", - "std: 0.02880119213919405\n", - "max: 0.18702970297029703\n", + "average distance: 0.16296252607812808\n", + "median: 0.11606886657101867\n", + "std: 0.1196590575339798\n", + "max: 0.49411764705882355\n", "min: 0.0\n" ] } @@ -263,6 +283,7 @@ "for model in models:\n", " distances.append(ks_value(na_rep_model.na, model.na))\n", "print('average distance: ', np.mean(distances))\n", + "print('median: ', np.median(distances))\n", "print('std: ', np.std(distances))\n", "print('max:', max(distances))\n", "print('min:', min(distances))" @@ -272,20 +293,29 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Find Representative for MPC" + "## Find Representative for MPC" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ + "### For Yakindumm\n", + "\n", "#### For all human models\n", "* the rep found is ../input/humanOutput\\R_2015246_run_1.csv\n", "* the average distance between it and others is 0.08556632702185384\n", "\n", "#### For human models with $100 \\pm 10$ nodes\n", "* the rep found is ../input/human_output_100\\R_2016324_run_1.csv\n", - "* the average distance between it and others is $0.07028909225833631$" + "* the average distance between it and others is $0.07028909225833631$\n", + "\n", + "#### for human model with $100 \\pm 10$ nodes and new metric\n", + "* average distance: 0.054782550772603904\n", + "* median: 0.048330503678551184\n", + "* std: 0.028208257424907526\n", + "* max: 0.21181525241675614\n", + "* min: 0.0" ] }, { @@ -297,8 +327,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "../input/human_output_100\\R_2016324_run_1.csv\n", - "../input/human_output_100\\R_2016324_run_1.csv\n" + "../input/human_models_75\\151.csv\n", + "../input/human_models_75\\151.csv\n" ] } ], @@ -311,16 +341,17 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "average distance: 0.07028909225833632\n", - "std: 0.03728189051222417\n", - "max: 0.21961550993809065\n", + "average distance: 0.18751521685526348\n", + "median: 0.13400833829660508\n", + "std: 0.13829078925748192\n", + "max: 0.5745366639806608\n", "min: 0.0\n" ] } @@ -330,6 +361,7 @@ "for model in models:\n", " distances.append(ks_value(mpc_rep_model.mpc, model.mpc))\n", "print('average distance: ', np.mean(distances))\n", + "print('median: ', np.median(distances))\n", "print('std: ', np.std(distances))\n", "print('max:', max(distances))\n", "print('min:', min(distances))" -- cgit v1.2.3-54-g00ecf