{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Analyzing Benchmark Results for Validation\n", "\n", "So you ran your models against several criticality benchmarks. Nice! How do we analyze the results easily? NucML contains some utilities to help you get started." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:52:46.369373Z", "start_time": "2021-05-07T22:52:46.366374Z" } }, "outputs": [], "source": [ "# Prototype\n", "import sys\n", "# This allows us to import the nucml utilities\n", "sys.path.append(\"..\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:52:50.401278Z", "start_time": "2021-05-07T22:52:46.723568Z" } }, "outputs": [], "source": [ "import pandas as pd\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt\n", "import os\n", "\n", "pd.set_option('display.max_columns', 500)\n", "pd.set_option('display.max_rows', 50)\n", "pd.options.mode.chained_assignment = None # default='warn'\n", "sns.set_style(\"white\")\n", "\n", "import nucml.ace.data_utilities as ace_utils\n", "import nucml.model.utilities as model_utils\n", "import nucml.ace.plot as ace_plots" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:52:50.405280Z", "start_time": "2021-05-07T22:52:50.402779Z" } }, "outputs": [], "source": [ "figure_dir = \"figures/B0/\"" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:52:50.422282Z", "start_time": "2021-05-07T22:52:50.407280Z" } }, "outputs": [], "source": [ "sns.set(font_scale=2.5)\n", "sns.set_style('white')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Gathering Results from Serpent Runs\n", "\n", "You can automatically read all benchmark `.mat` files and format the results easily by simply specifying the directory where the benchmark model information is stored (see previous notebook)." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:53:06.121217Z", "start_time": "2021-05-07T22:52:51.601873Z" } }, "outputs": [], "source": [ "model_results_b0 = ace_utils.gather_benchmark_results(\"ml/DT_B0/\")\n", "model_results_b1 = ace_utils.gather_benchmark_results(\"ml/DT_B1/\")\n", "model_results_b2 = ace_utils.gather_benchmark_results(\"ml/DT_B2/\")\n", "model_results_b3 = ace_utils.gather_benchmark_results(\"ml/DT_B3/\")\n", "model_results_b4 = ace_utils.gather_benchmark_results(\"ml/DT_B4/\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:53:06.139717Z", "start_time": "2021-05-07T22:53:06.122719Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ModelBenchmarkK_eff_anaUnc_anaK_eff_impUnc_impDeviation_AnaDeviation_Imp
0DT100_MSS10_MSL1_none_one_hot_B0_v1U233_MET_FAST_0010.9899270.000440.9900240.000300.0100730.009976
1DT100_MSS10_MSL1_none_one_hot_B0_v1U233_MET_FAST_002_0010.9923320.000420.9922330.000290.0076680.007767
2DT100_MSS10_MSL1_none_one_hot_B0_v1U233_MET_FAST_002_0020.9965570.000440.9966430.000310.0034430.003357
3DT100_MSS10_MSL3_none_one_hot_B0_v1U233_MET_FAST_0010.9930640.000440.9927350.000300.0069360.007265
4DT100_MSS10_MSL3_none_one_hot_B0_v1U233_MET_FAST_002_0010.9945470.000430.9943060.000290.0054530.005694
\n", "
" ], "text/plain": [ " Model Benchmark K_eff_ana \\\n", "0 DT100_MSS10_MSL1_none_one_hot_B0_v1 U233_MET_FAST_001 0.989927 \n", "1 DT100_MSS10_MSL1_none_one_hot_B0_v1 U233_MET_FAST_002_001 0.992332 \n", "2 DT100_MSS10_MSL1_none_one_hot_B0_v1 U233_MET_FAST_002_002 0.996557 \n", "3 DT100_MSS10_MSL3_none_one_hot_B0_v1 U233_MET_FAST_001 0.993064 \n", "4 DT100_MSS10_MSL3_none_one_hot_B0_v1 U233_MET_FAST_002_001 0.994547 \n", "\n", " Unc_ana K_eff_imp Unc_imp Deviation_Ana Deviation_Imp \n", "0 0.00044 0.990024 0.00030 0.010073 0.009976 \n", "1 0.00042 0.992233 0.00029 0.007668 0.007767 \n", "2 0.00044 0.996643 0.00031 0.003443 0.003357 \n", "3 0.00044 0.992735 0.00030 0.006936 0.007265 \n", "4 0.00043 0.994306 0.00029 0.005453 0.005694 " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_results_b0.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Analyzing Decision Tree Results\n", "\n", "That was easy. However, we do not have the training and validation metrics that we had before. We can simply read the results files and join them. First, let us load the results and keep the most basic columns including hyperparameters and performance metrics. " ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:56:45.613359Z", "start_time": "2021-05-07T22:56:45.583861Z" } }, "outputs": [], "source": [ "results_b0 = pd.read_csv(\"../ML_EXFOR_neutrons/2_DT/dt_resultsB0.csv\").sort_values(by=\"max_depth\")\n", "results_b1 = pd.read_csv(\"../ML_EXFOR_neutrons/2_DT/dt_resultsB1.csv\").sort_values(by=\"max_depth\")\n", "results_b2 = pd.read_csv(\"../ML_EXFOR_neutrons/2_DT/dt_resultsB2.csv\").sort_values(by=\"max_depth\")\n", "results_b3 = pd.read_csv(\"../ML_EXFOR_neutrons/2_DT/dt_resultsB3.csv\").sort_values(by=\"max_depth\")\n", "results_b4 = pd.read_csv(\"../ML_EXFOR_neutrons/2_DT/dt_resultsB4.csv\").sort_values(by=\"max_depth\")\n", "\n", "results_b0 = results_b0[results_b0.normalizer == \"none\"]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:56:46.105400Z", "start_time": "2021-05-07T22:56:46.102898Z" } }, "outputs": [], "source": [ "# IGNORE THIS CELL\n", "# results_b0['Model'] = results_b0.model_path.apply(lambda x: os.path.basename(os.path.dirname(x)))\n", "# results_b0['dataset'] = 'b0'\n", "# results_b1['Model'] = results_b1.model_path.apply(lambda x: os.path.basename(os.path.dirname(x)))\n", "# results_b1['dataset'] = 'b1'" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This step is optional, but in this example, we will join the results from different models trained on different datasets. Some models might be named the same but were trained on different dataset versions. Here we add a unique identifier previous to merging the results. " ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:56:47.192845Z", "start_time": "2021-05-07T22:56:47.174843Z" } }, "outputs": [], "source": [ "for df, dataset_tag in zip([results_b0, results_b1, results_b2, results_b3, results_b4], [\"b0\", \"b1\", \"b2\", \"b3\", \"b4\"]):\n", " df['Model'] = df.model_path.apply(lambda x: os.path.basename(os.path.dirname(x)))\n", " df['dataset'] = dataset_tag" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Filtering to obtain most basic features:" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:56:48.352842Z", "start_time": "2021-05-07T22:56:48.342843Z" } }, "outputs": [], "source": [ "results_b0 = results_b0[[\"Model\", \"train_mae\", \"val_mae\", \"test_mae\", \"max_depth\", \"mss\", \"msl\", \"dataset\"]]\n", "results_b1 = results_b1[[\"Model\", \"train_mae\", \"val_mae\", \"test_mae\", \"max_depth\", \"mss\", \"msl\", \"dataset\"]]\n", "results_b2 = results_b2[[\"Model\", \"train_mae\", \"val_mae\", \"test_mae\", \"max_depth\", \"mss\", \"msl\", \"dataset\"]]\n", "results_b3 = results_b3[[\"Model\", \"train_mae\", \"val_mae\", \"test_mae\", \"max_depth\", \"mss\", \"msl\", \"dataset\"]]\n", "results_b4 = results_b4[[\"Model\", \"train_mae\", \"val_mae\", \"test_mae\", \"max_depth\", \"mss\", \"msl\", \"dataset\"]]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Finally, we can merge the results with the gathered benchmark information." ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:58:05.387379Z", "start_time": "2021-05-07T22:58:05.366880Z" } }, "outputs": [], "source": [ "final_b0 = model_results_b0.merge(results_b0, on=\"Model\")\n", "final_b1 = model_results_b1.merge(results_b1, on=\"Model\")\n", "final_b2 = model_results_b2.merge(results_b2, on=\"Model\")\n", "final_b3 = model_results_b3.merge(results_b3, on=\"Model\")\n", "final_b4 = model_results_b4.merge(results_b4, on=\"Model\")" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:58:13.697262Z", "start_time": "2021-05-07T22:58:13.686261Z" } }, "outputs": [], "source": [ "final_set = final_b0.append(final_b1).append(final_b2).append(final_b3).append(final_b4)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T22:58:16.963726Z", "start_time": "2021-05-07T22:58:16.950224Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ModelBenchmarkK_eff_anaUnc_anaK_eff_impUnc_impDeviation_AnaDeviation_Imptrain_maeval_maetest_maemax_depthmssmsldataset
0DT100_MSS10_MSL1_none_one_hot_B0_v1U233_MET_FAST_0010.9899270.000440.9900240.000300.0100730.0099760.0702810.1257240.124429100101b0
1DT100_MSS10_MSL1_none_one_hot_B0_v1U233_MET_FAST_002_0010.9923320.000420.9922330.000290.0076680.0077670.0702810.1257240.124429100101b0
2DT100_MSS10_MSL1_none_one_hot_B0_v1U233_MET_FAST_002_0020.9965570.000440.9966430.000310.0034430.0033570.0702810.1257240.124429100101b0
3DT100_MSS10_MSL3_none_one_hot_B0_v1U233_MET_FAST_0010.9930640.000440.9927350.000300.0069360.0072650.0824640.1223720.121066100103b0
4DT100_MSS10_MSL3_none_one_hot_B0_v1U233_MET_FAST_002_0010.9945470.000430.9943060.000290.0054530.0056940.0824640.1223720.121066100103b0
\n", "
" ], "text/plain": [ " Model Benchmark K_eff_ana \\\n", "0 DT100_MSS10_MSL1_none_one_hot_B0_v1 U233_MET_FAST_001 0.989927 \n", "1 DT100_MSS10_MSL1_none_one_hot_B0_v1 U233_MET_FAST_002_001 0.992332 \n", "2 DT100_MSS10_MSL1_none_one_hot_B0_v1 U233_MET_FAST_002_002 0.996557 \n", "3 DT100_MSS10_MSL3_none_one_hot_B0_v1 U233_MET_FAST_001 0.993064 \n", "4 DT100_MSS10_MSL3_none_one_hot_B0_v1 U233_MET_FAST_002_001 0.994547 \n", "\n", " Unc_ana K_eff_imp Unc_imp Deviation_Ana Deviation_Imp train_mae \\\n", "0 0.00044 0.990024 0.00030 0.010073 0.009976 0.070281 \n", "1 0.00042 0.992233 0.00029 0.007668 0.007767 0.070281 \n", "2 0.00044 0.996643 0.00031 0.003443 0.003357 0.070281 \n", "3 0.00044 0.992735 0.00030 0.006936 0.007265 0.082464 \n", "4 0.00043 0.994306 0.00029 0.005453 0.005694 0.082464 \n", "\n", " val_mae test_mae max_depth mss msl dataset \n", "0 0.125724 0.124429 100 10 1 b0 \n", "1 0.125724 0.124429 100 10 1 b0 \n", "2 0.125724 0.124429 100 10 1 b0 \n", "3 0.122372 0.121066 100 10 3 b0 \n", "4 0.122372 0.121066 100 10 3 b0 " ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "final_set.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Nice. You can then proceed to analyze your results and explor hyperparametres as a function of the multiplication factor and the error. Check the thesis for more information. \n", "\n", "You can, for example, create a DataFrame for each benchmark and analyze what models have good performance in terms of the multiplication factor. " ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T23:01:40.555312Z", "start_time": "2021-05-07T23:01:40.547312Z" } }, "outputs": [], "source": [ "u233_002_001 = final_set[final_set.Benchmark == \"U233_MET_FAST_002_001\"].sort_values(by=\"Deviation_Ana\")\n", "u233_002_002 = final_set[final_set.Benchmark == \"U233_MET_FAST_002_002\"].sort_values(by=\"Deviation_Ana\")\n", "u233_001 = final_set[final_set.Benchmark == \"U233_MET_FAST_001\"].sort_values(by=\"Deviation_Ana\")" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T23:01:50.972101Z", "start_time": "2021-05-07T23:01:50.963603Z" } }, "outputs": [], "source": [ "# converting error to 100% scale\n", "u233_001.Deviation_Ana = u233_001.Deviation_Ana * 100\n", "u233_002_001.Deviation_Ana = u233_002_001.Deviation_Ana * 100\n", "u233_002_002.Deviation_Ana = u233_002_002.Deviation_Ana * 100" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T23:01:56.701499Z", "start_time": "2021-05-07T23:01:56.685499Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ModelBenchmarkK_eff_anaUnc_anaK_eff_impUnc_impDeviation_AnaDeviation_Imptrain_maeval_maetest_maemax_depthmssmsldataset
138DT136_MSS5_MSL3_none_one_hot_B0_v1U233_MET_FAST_0010.9999060.000430.9999790.000290.0000940.0000210.0777290.1234890.12228513653b0
90DT120_MSS5_MSL3_none_one_hot_B0_v1U233_MET_FAST_0010.9996370.000440.9994270.000290.0003630.0005730.0777310.1234920.12225812053b0
30DT100_MSS5_MSL3_none_one_hot_B0_v1U233_MET_FAST_0010.9995440.000410.9997530.000280.0004560.0002470.0777410.1234870.12224810053b0
543DT70_MSS5_MSL3_none_one_hot_B0_v1U233_MET_FAST_0010.9994850.000420.9995190.000280.0005150.0004810.0778260.1234910.1222617053b0
171DT160_MSS2_MSL1_none_one_hot_B0_v1U233_MET_FAST_0011.0005600.000431.0009500.000300.0005600.0009500.0260630.1360770.13488116021b0
\n", "
" ], "text/plain": [ " Model Benchmark K_eff_ana \\\n", "138 DT136_MSS5_MSL3_none_one_hot_B0_v1 U233_MET_FAST_001 0.999906 \n", "90 DT120_MSS5_MSL3_none_one_hot_B0_v1 U233_MET_FAST_001 0.999637 \n", "30 DT100_MSS5_MSL3_none_one_hot_B0_v1 U233_MET_FAST_001 0.999544 \n", "543 DT70_MSS5_MSL3_none_one_hot_B0_v1 U233_MET_FAST_001 0.999485 \n", "171 DT160_MSS2_MSL1_none_one_hot_B0_v1 U233_MET_FAST_001 1.000560 \n", "\n", " Unc_ana K_eff_imp Unc_imp Deviation_Ana Deviation_Imp train_mae \\\n", "138 0.00043 0.999979 0.00029 0.000094 0.000021 0.077729 \n", "90 0.00044 0.999427 0.00029 0.000363 0.000573 0.077731 \n", "30 0.00041 0.999753 0.00028 0.000456 0.000247 0.077741 \n", "543 0.00042 0.999519 0.00028 0.000515 0.000481 0.077826 \n", "171 0.00043 1.000950 0.00030 0.000560 0.000950 0.026063 \n", "\n", " val_mae test_mae max_depth mss msl dataset \n", "138 0.123489 0.122285 136 5 3 b0 \n", "90 0.123492 0.122258 120 5 3 b0 \n", "30 0.123487 0.122248 100 5 3 b0 \n", "543 0.123491 0.122261 70 5 3 b0 \n", "171 0.136077 0.134881 160 2 1 b0 " ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "final_b0[final_b0.Benchmark == \"U233_MET_FAST_001\"].sort_values(by=\"Deviation_Ana\").head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It seems like the `DT136_MSS5_MSL3_none_one_hot_B0_v1` model has great performance in the benchmark with an error of `0.000094%`. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting Best Models Overall\n", "\n", "Similar to traditional ML validation techniques, it is only correct that we analyze the result of the ML algorithms on their average performance on a set of criticality benchmark cases, rather than just one. The examples here contain information on three benchmarks. Those will suffice for a proof-of-concept analysis. \n", "\n", "An option is simply grouping the model by performance. Beware, this can lead to some major misconceptions and it is shown here only as an example. " ] }, { "cell_type": "code", "execution_count": 32, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T23:09:03.346218Z", "start_time": "2021-05-07T23:09:03.336219Z" } }, "outputs": [], "source": [ "model_mean = final_set.groupby(\"Model\").mean()\n", "# model_mean = model_mean[['K_eff_ana']]\n", "model_mean[\"Error\"] = (abs(model_mean.K_eff_ana - 1) /1) * 100\n", "model_mean[\"Unc_Error\"] = (abs(model_mean.Unc_ana - 1) /1) * 100\n", "model_mean = model_mean.reset_index()" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "ExecuteTime": { "end_time": "2021-05-07T23:09:16.645075Z", "start_time": "2021-05-07T23:09:16.630574Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ModelK_eff_anaUnc_anaK_eff_impUnc_impDeviation_AnaDeviation_Imptrain_maeval_maetest_maemax_depthmssmslErrorUnc_Error
27DT110_MSS5_MSL1_none_one_hot_B0_v10.9999990.0004301.0002690.0002970.0020140.0016110.0522180.1310890.129714110510.00010099.957000
374DT90_MSS5_MSL1_none_one_hot_B1_v11.0000300.0004401.0000640.0002970.0014300.0014690.0523560.1300180.12985290510.00300099.956000
209DT310_MSS5_MSL1_none_one_hot_B1_v11.0000340.0004231.0001010.0002900.0017860.0016190.0518680.1302180.130013310510.00340099.957667
302DT60_MSS5_MSL1_none_one_hot_B0_v11.0000390.0004371.0001600.0002900.0014010.0016000.0530030.1310550.12965760510.00386799.956333
105DT180_MSS5_MSL1_none_one_hot_B1_v10.9999510.0004231.0003130.0002970.0017690.0016000.0519490.1301540.129956180510.00490099.957667
\n", "
" ], "text/plain": [ " Model K_eff_ana Unc_ana K_eff_imp \\\n", "27 DT110_MSS5_MSL1_none_one_hot_B0_v1 0.999999 0.000430 1.000269 \n", "374 DT90_MSS5_MSL1_none_one_hot_B1_v1 1.000030 0.000440 1.000064 \n", "209 DT310_MSS5_MSL1_none_one_hot_B1_v1 1.000034 0.000423 1.000101 \n", "302 DT60_MSS5_MSL1_none_one_hot_B0_v1 1.000039 0.000437 1.000160 \n", "105 DT180_MSS5_MSL1_none_one_hot_B1_v1 0.999951 0.000423 1.000313 \n", "\n", " Unc_imp Deviation_Ana Deviation_Imp train_mae val_mae test_mae \\\n", "27 0.000297 0.002014 0.001611 0.052218 0.131089 0.129714 \n", "374 0.000297 0.001430 0.001469 0.052356 0.130018 0.129852 \n", "209 0.000290 0.001786 0.001619 0.051868 0.130218 0.130013 \n", "302 0.000290 0.001401 0.001600 0.053003 0.131055 0.129657 \n", "105 0.000297 0.001769 0.001600 0.051949 0.130154 0.129956 \n", "\n", " max_depth mss msl Error Unc_Error \n", "27 110 5 1 0.000100 99.957000 \n", "374 90 5 1 0.003000 99.956000 \n", "209 310 5 1 0.003400 99.957667 \n", "302 60 5 1 0.003867 99.956333 \n", "105 180 5 1 0.004900 99.957667 " ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "model_mean.sort_values(\"Error\").head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### ------------------------------------------------ PRIVATE SECTION" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "ExecuteTime": { "end_time": "2021-04-22T22:02:29.347888Z", "start_time": "2021-04-22T22:02:29.319879Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\\begin{tabular}{lrrrrrrl}\n", "\\toprule\n", " Model & K\\_eff\\_ana & Unc\\_ana & Deviation\\_Ana & train\\_mae & val\\_mae & test\\_mae & tag \\\\\n", "\\midrule\n", "DT400\\_MSS2\\_MSL1\\_none\\_one\\_hot\\_B0\\_v1 & 1.002320 & 0.00043 & 0.2320 & 0.025773 & 0.136140 & 0.135027 & Train \\\\\n", "DT70\\_MSS10\\_MSL7\\_none\\_one\\_hot\\_B1\\_v1 & 0.997118 & 0.00044 & 0.2882 & 0.094443 & 0.118699 & 0.119142 & Val \\\\\n", "DT90\\_MSS10\\_MSL7\\_none\\_one\\_hot\\_B0\\_v1 & 0.922530 & 0.00046 & 7.7470 & 0.094439 & 0.119797 & 0.118706 & Test \\\\\n", "\\bottomrule\n", "\\end{tabular}\n", "\n" ] } ], "source": [ "print(model_utils.get_best_models_df(u233_001[[\"Model\", 'K_eff_ana', 'Unc_ana', 'Deviation_Ana', 'train_mae', 'val_mae', 'test_mae']]).to_latex(index=False))" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "ExecuteTime": { "end_time": "2021-04-22T22:02:37.371937Z", "start_time": "2021-04-22T22:02:37.358938Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\\begin{tabular}{lrrrrrr}\n", "\\toprule\n", " Model & K\\_eff\\_ana & Unc\\_ana & Deviation\\_Ana & train\\_mae & val\\_mae & test\\_mae \\\\\n", "\\midrule\n", "DT80\\_MSS15\\_MSL3\\_none\\_one\\_hot\\_B1\\_v1 & 0.999943 & 0.00041 & 0.0057 & 0.088061 & 0.120462 & 0.120684 \\\\\n", "\\bottomrule\n", "\\end{tabular}\n", "\n" ] } ], "source": [ "print(u233_001[[\"Model\", 'K_eff_ana', 'Unc_ana', 'Deviation_Ana', 'train_mae', 'val_mae', 'test_mae']].head(1).to_latex(index=False))" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "ExecuteTime": { "end_time": "2021-04-11T16:27:51.619674Z", "start_time": "2021-04-11T16:27:51.594686Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\\begin{tabular}{lrrrrrrl}\n", "\\toprule\n", " Model & K\\_eff\\_ana & Unc\\_ana & Deviation\\_Ana & train\\_mae & val\\_mae & test\\_mae & tag \\\\\n", "\\midrule\n", "DT400\\_MSS2\\_MSL1\\_none\\_one\\_hot\\_B0\\_v1 & 1.003330 & 0.00044 & 0.3330 & 0.025773 & 0.136140 & 0.135027 & Train \\\\\n", "DT70\\_MSS10\\_MSL7\\_none\\_one\\_hot\\_B1\\_v1 & 0.997767 & 0.00044 & 0.2233 & 0.094443 & 0.118699 & 0.119142 & Val \\\\\n", "DT90\\_MSS10\\_MSL7\\_none\\_one\\_hot\\_B0\\_v1 & 0.929108 & 0.00045 & 7.0892 & 0.094439 & 0.119797 & 0.118706 & Test \\\\\n", "\\bottomrule\n", "\\end{tabular}\n", "\n" ] } ], "source": [ "print(model_utils.get_best_models_df(u233_002_001[[\"Model\", 'K_eff_ana', 'Unc_ana', 'Deviation_Ana', 'train_mae', 'val_mae', 'test_mae']]).to_latex(index=False))" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "ExecuteTime": { "end_time": "2021-04-11T16:27:55.232320Z", "start_time": "2021-04-11T16:27:55.218320Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\\begin{tabular}{lrrrrrr}\n", "\\toprule\n", " Model & K\\_eff\\_ana & Unc\\_ana & Deviation\\_Ana & train\\_mae & val\\_mae & test\\_mae \\\\\n", "\\midrule\n", "DT280\\_MSS5\\_MSL1\\_none\\_one\\_hot\\_B0\\_v1 & 1.0 & 0.00041 & 0.0 & 0.05187 & 0.131216 & 0.129827 \\\\\n", "\\bottomrule\n", "\\end{tabular}\n", "\n" ] } ], "source": [ "print(u233_002_001[[\"Model\", 'K_eff_ana', 'Unc_ana', 'Deviation_Ana', 'train_mae', 'val_mae', 'test_mae']].head(1).to_latex(index=False))" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "ExecuteTime": { "end_time": "2021-04-11T16:31:09.456701Z", "start_time": "2021-04-11T16:31:09.431697Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\\begin{tabular}{lrrrrrrl}\n", "\\toprule\n", " Model & K\\_eff\\_ana & Unc\\_ana & Deviation\\_Ana & train\\_mae & val\\_mae & test\\_mae & tag \\\\\n", "\\midrule\n", "DT400\\_MSS2\\_MSL1\\_none\\_one\\_hot\\_B0\\_v1 & 1.005650 & 0.00042 & 0.5650 & 0.025773 & 0.136140 & 0.135027 & Train \\\\\n", "DT70\\_MSS10\\_MSL7\\_none\\_one\\_hot\\_B1\\_v1 & 1.000680 & 0.00044 & 0.0680 & 0.094443 & 0.118699 & 0.119142 & Val \\\\\n", "DT90\\_MSS10\\_MSL7\\_none\\_one\\_hot\\_B0\\_v1 & 0.936182 & 0.00046 & 6.3818 & 0.094439 & 0.119797 & 0.118706 & Test \\\\\n", "\\bottomrule\n", "\\end{tabular}\n", "\n" ] } ], "source": [ "print(model_utils.get_best_models_df(u233_002_002[[\"Model\", 'K_eff_ana', 'Unc_ana', 'Deviation_Ana', 'train_mae', 'val_mae', 'test_mae']]).to_latex(index=False))" ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "ExecuteTime": { "end_time": "2021-04-11T00:03:54.391117Z", "start_time": "2021-04-11T00:03:54.376117Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\\begin{tabular}{lrrrrrr}\n", "\\toprule\n", " Model & K\\_eff\\_ana & Unc\\_ana & Deviation\\_Ana & train\\_mae & val\\_mae & test\\_mae \\\\\n", "\\midrule\n", "DT170\\_MSS10\\_MSL3\\_none\\_one\\_hot\\_B0\\_v1 & 1.00022 & 0.00042 & 0.022 & 0.082419 & 0.121982 & 0.121942 \\\\\n", "\\bottomrule\n", "\\end{tabular}\n", "\n" ] } ], "source": [ "print(u233_002_002[[\"Model\", 'K_eff_ana', 'Unc_ana', 'Deviation_Ana', 'train_mae', 'val_mae', 'test_mae']].head(1).to_latex(index=False))" ] } ], "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.8.8" } }, "nbformat": 4, "nbformat_minor": 4 }