{ "cells": [ { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import csv\n", "import numpy as np\n", "import pandas as pd\n", "\n", "def gerar_metricas(nome_projeto):\n", " list_output_MbR = []\n", " with open(\"metricas_{}_MbR.csv\".format(nome_projeto), \"r\") as arquivo:\n", " arquivo_csv = csv.reader(arquivo)\n", " for i, linha in enumerate(arquivo_csv):\n", " list_output_MbR.append(float(linha[0]))\n", " list_output_NEOSP_SVR = []\n", " with open(\"metricas_{}_NEOSP_SVR.csv\".format(nome_projeto), \"r\") as arquivo:\n", " arquivo_csv = csv.reader(arquivo)\n", " for i, linha in enumerate(arquivo_csv):\n", " list_output_NEOSP_SVR.append(float(linha[0]))\n", " list_output_TFIDF_SVR = []\n", " with open(\"metricas_{}_TFIDF.csv\".format(nome_projeto), \"r\") as arquivo:\n", " arquivo_csv = csv.reader(arquivo)\n", " for i, linha in enumerate(arquivo_csv):\n", " list_output_TFIDF_SVR.append(float(linha[0]))\n", " \n", " list_results = [[\"MbR Regressor\", np.mean(list_output_MbR)], [\"NEOSP-SVR Regressor\", np.mean(list_output_NEOSP_SVR)], [\"TFIDF-SVR Regressor\", np.mean(list_output_TFIDF_SVR)]]\n", " \n", " df = pd.DataFrame(list_results, columns=[\"Model\", \"MAE\"])\n", " \n", " df_list_output_MbR = pd.DataFrame(list_output_MbR, columns=[\"MAE\"])\n", " df_list_output_NEOSP = pd.DataFrame(list_output_NEOSP_SVR, columns=[\"MAE\"])\n", " df_list_output_TFIDF = pd.DataFrame(list_output_TFIDF_SVR, columns=[\"MAE\"])\n", " \n", " \n", " return df_list_output_MbR, df_list_output_NEOSP, df_list_output_TFIDF" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " MAE\n", "0 1.719630\n", "1 1.619240\n", "2 2.035138\n", "3 2.714286\n", "4 1.690284\n", ".. ...\n", "295 1.877688\n", "296 1.825845\n", "297 2.281874\n", "298 1.448541\n", "299 2.011329\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 3.991628\n", "1 5.509540\n", "2 4.276285\n", "3 3.210280\n", "4 4.419198\n", ".. ...\n", "295 4.515966\n", "296 4.156574\n", "297 4.072459\n", "298 3.360661\n", "299 4.133661\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 1.749430\n", "1 1.615589\n", "2 1.891128\n", "3 1.352403\n", "4 2.137931\n", ".. ...\n", "295 1.505617\n", "296 1.497649\n", "297 1.944096\n", "298 1.594697\n", "299 1.889890\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 6.520257\n", "1 7.011882\n", "2 3.508960\n", "3 3.912252\n", "4 6.778048\n", ".. ...\n", "295 5.067004\n", "296 3.978298\n", "297 4.770977\n", "298 3.592259\n", "299 3.753875\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 1.279750\n", "1 1.747535\n", "2 1.429980\n", "3 1.367193\n", "4 1.769231\n", ".. ...\n", "295 1.736029\n", "296 1.297173\n", "297 1.407627\n", "298 1.742932\n", "299 1.625247\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 1.484524\n", "1 0.870833\n", "2 1.362500\n", "3 1.141270\n", "4 1.118586\n", ".. ...\n", "295 1.162477\n", "296 1.446631\n", "297 1.257882\n", "298 2.020915\n", "299 1.351226\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 1.562142\n", "1 1.121421\n", "2 1.011506\n", "3 1.309862\n", "4 1.386479\n", ".. ...\n", "295 1.217656\n", "296 1.166991\n", "297 1.309732\n", "298 1.546553\n", "299 1.458637\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 3.183489\n", "1 3.254141\n", "2 2.820652\n", "3 3.147516\n", "4 3.724896\n", ".. ...\n", "295 3.343784\n", "296 2.467027\n", "297 2.586486\n", "298 2.901351\n", "299 2.793243\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 3.085758\n", "1 2.960811\n", "2 2.402817\n", "3 3.173362\n", "4 3.209479\n", ".. ...\n", "295 2.802939\n", "296 2.611202\n", "297 2.317784\n", "298 3.191521\n", "299 2.972561\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 0.817816\n", "1 1.292632\n", "2 0.798383\n", "3 0.766996\n", "4 0.811808\n", ".. ...\n", "295 0.764333\n", "296 0.871069\n", "297 0.830722\n", "298 1.263252\n", "299 0.915469\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 0.861718\n", "1 1.440051\n", "2 0.793965\n", "3 1.079316\n", "4 0.765291\n", ".. ...\n", "295 1.312637\n", "296 0.746560\n", "297 0.861487\n", "298 0.844606\n", "299 0.893629\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 0.651576\n", "1 0.649636\n", "2 0.624728\n", "3 0.599720\n", "4 0.670485\n", ".. ...\n", "295 0.625787\n", "296 0.620482\n", "297 0.617713\n", "298 0.653711\n", "299 0.671403\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 1.843216\n", "1 1.947581\n", "2 1.326613\n", "3 1.818193\n", "4 1.829548\n", ".. ...\n", "295 1.692674\n", "296 1.968132\n", "297 3.074359\n", "298 1.361050\n", "299 2.180586\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 8.977660\n", "1 13.935714\n", "2 11.211688\n", "3 10.565220\n", "4 10.296718\n", ".. ...\n", "295 12.521110\n", "296 11.826106\n", "297 9.696185\n", "298 11.501992\n", "299 10.755109\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 1.563933\n", "1 1.527785\n", "2 1.514647\n", "3 1.419521\n", "4 1.537474\n", ".. ...\n", "295 1.508380\n", "296 1.713129\n", "297 1.520726\n", "298 1.499336\n", "299 1.515071\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 3.124855\n", "1 2.894180\n", "2 3.055756\n", "3 2.742524\n", "4 2.910823\n", ".. ...\n", "295 2.968017\n", "296 2.876247\n", "297 2.786590\n", "298 2.969128\n", "299 2.820308\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 1.275430\n", "1 0.953375\n", "2 0.943311\n", "3 1.077534\n", "4 0.880661\n", ".. ...\n", "295 0.955650\n", "296 0.951646\n", "297 0.953232\n", "298 0.975788\n", "299 1.029818\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 2.097472\n", "1 1.692843\n", "2 1.335077\n", "3 1.525819\n", "4 1.529649\n", ".. ...\n", "295 1.723645\n", "296 1.577294\n", "297 1.154258\n", "298 1.946014\n", "299 1.708333\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 0.933591\n", "1 0.871815\n", "2 0.946461\n", "3 0.765251\n", "4 0.945946\n", ".. ...\n", "295 0.565508\n", "296 0.833871\n", "297 1.040323\n", "298 1.303763\n", "299 0.954301\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 2.833315\n", "1 2.558738\n", "2 3.003724\n", "3 2.535398\n", "4 2.797720\n", ".. ...\n", "295 2.425558\n", "296 2.596320\n", "297 2.665249\n", "298 2.642077\n", "299 3.175072\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 2.732684\n", "1 2.229971\n", "2 2.475378\n", "3 2.495666\n", "4 2.462650\n", ".. ...\n", "295 2.512257\n", "296 2.619655\n", "297 2.390718\n", "298 2.241314\n", "299 2.395140\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 2.290064\n", "1 2.309586\n", "2 2.167920\n", "3 2.191076\n", "4 2.249119\n", ".. ...\n", "295 2.204164\n", "296 2.246984\n", "297 2.521996\n", "298 2.094582\n", "299 2.248426\n", "\n", "[300 rows x 1 columns]\n", " MAE\n", "0 1.699304\n", "1 1.956807\n", "2 1.673685\n", "3 1.788314\n", "4 1.908642\n", ".. ...\n", "295 1.915542\n", "296 2.274142\n", "297 1.923457\n", "298 1.721884\n", "299 1.901150\n", "\n", "[300 rows x 1 columns]\n" ] } ], "source": [ "LIBRARIES = [\"ALOY\", \"APSTUD\", \"CLI\", \"CLOV\", \"COMPASS\", \"CONFCLOUD\", \"CONFSERVER\", \"DAEMON\", \"DM\", \"DNN\", \"DURACLOUD\", \"EVG\", \"FAB\", \n", " \"MDL\", \"MESOS\" ,\"MULE\", \"NEXUS\", \"SERVER\", \"STL\", \"TIDOC\", \"TIMOB\", \"TISTUD\", \"XD\"]\n", "\n", "for lp in LIBRARIES:\n", " df_list_output_MbR, df_list_output_NEOSP, df_list_output_TFIDF = gerar_metricas(lp)\n", " print(df_list_output_MbR)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.11" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }