{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Load a data_set_predictions.yaml file\n", "\n", "The most common way to use a DataSetEvaluator is to load the ``data_set_predictions.yaml`` file produced during an optimization." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "from scm.params import *\n", "import os\n", "\n", "# if you go via ParAMSJob:\n", "# job = ParAMSJob.load_external('/path/results/')\n", "# dse = job.results.get_data_set_evaluator()\n", "\n", "# to just load the .yaml file:\n", "yaml_file = os.path.expandvars(\n", " \"$AMSHOME/scripting/scm/params/examples/ZnS_ReaxFF/example_output/best/data_set_predictions.yaml\"\n", ")\n", "dse = DataSetEvaluator(yaml_file)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Summary statistics (stats.txt)\n", "\n", "The results can be grouped in different ways. By default, the data is grouped first by ``'Extractor'`` and then by ``'Expression'``. To get a file like ``stats.txt``, simply call the ``.str()`` method:" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Group/Expression N MAE RMSE* Unit* Weight Loss* Contribution[%]\n", "-------------------------------------------------------------------------------------------------------------------------------------------------\n", "Total 466 0.59112 +0.97646 Mixed! 50.000 236.128 100.00 Total\n", "\n", " forces 297 0.76691 +1.02728 eV/angstrom 2.000 89.301 37.82 Extractor\n", " band_distorted_clean_110 144 0.89717 +1.14169 eV/angstrom 1.000 54.772 23.20 Expression\n", " band_distorted_ads_110 153 0.64432 +0.90649 eV/angstrom 1.000 34.529 14.62 Expression\n", "\n", " pes 30 0.09157 +0.14448 eV 13.000 65.858 27.89 Extractor\n", " pes('bondscan_h2s_pbesol', relative_to=5) 10 0.16696 +0.22823 eV 3.000 52.759 22.34 Expression\n", " pes('rocksalt', relative_to=2) 5 0.06917 +0.08621 eV 4.000 10.036 4.25 Expression\n", " pes('anglescan_h2s_pbesol', relative_to=2) 10 0.06506 +0.08106 eV 1.000 2.218 0.94 Expression\n", " pes('zincblende', relative_to=2) 5 0.01622 +0.02237 eV 5.000 0.844 0.36 Expression\n", "\n", " energy 9 0.63328 +1.63647 eV 9.000 26.796 11.35 Extractor\n", " 1.0*band_h2s_110-1.0*band_110-1.0*band_h2s 1 0.18263 -0.18263 eV 1.000 11.261 4.77 Expression\n", " 1.0*band_110-1.0*band_distorted_clean_110 1 4.89415 -4.89415 eV 1.000 5.988 2.54 Expression\n", " 0.041667*band_110_noconstraints-0.5*wurtzite_sp 1 0.13315 -0.13315 eV 1.000 5.985 2.53 Expression\n", " 1.0*zincblende_sp-0.5*wurtzite_sp 1 0.06582 +0.06582 eV 1.000 1.463 0.62 Expression\n", " 0.5*wurtzite_sp-0.03125*sulfur-0.5*Zn 1 0.06549 -0.06549 eV 1.000 1.448 0.61 Expression\n", " 1.0*rocksalt_sp-0.03125*sulfur-0.5*Zn 1 0.03069 +0.03069 eV 1.000 0.318 0.13 Expression\n", " 1.0*zincblende_sp-1.0*rocksalt_sp 1 0.03036 -0.03036 eV 1.000 0.311 0.13 Expression\n", " 1.0*band_h2s_110-1.0*band_distorted_ads_110 1 0.29687 +0.29687 eV 1.000 0.022 0.01 Expression\n", " 1.0*zincblende_sp-0.03125*sulfur-0.5*Zn 1 0.00033 +0.00033 eV 1.000 0.000 0.00 Expression\n", "\n", " angle 7 3.59374 +3.79878 degree 7.000 25.254 10.69 Extractor\n", " angle('band_110_noconstraints',39,19,24) 1 4.90284 +4.90284 degree 1.000 6.009 2.55 Expression\n", " angle('band_110_noconstraints',42,39,19) 1 4.75211 -4.75211 degree 1.000 5.646 2.39 Expression\n", " angle('band_110_noconstraints',39,19,31) 1 4.74455 -4.74455 degree 1.000 5.628 2.38 Expression\n", " angle('band_110_noconstraints',39,42,47) 1 4.11002 +4.11002 degree 1.000 4.223 1.79 Expression\n", " angle('band_110_noconstraints',23,27,47) 1 2.45845 -2.45845 degree 1.000 1.511 0.64 Expression\n", " angle('band_h2s',1,0,2) 1 2.39175 +2.39175 degree 1.000 1.430 0.61 Expression\n", " angle('band_110_noconstraints',27,47,4) 1 1.79647 +1.79647 degree 1.000 0.807 0.34 Expression\n", "\n", " distance 12 0.04638 +0.06270 angstrom 12.000 18.869 7.99 Extractor\n", " distance('band_h2s_110',34,19) 1 0.14270 -0.14270 angstrom 1.000 8.145 3.45 Expression\n", " distance('band_110_noconstraints',4,47) 1 0.09542 -0.09542 angstrom 1.000 3.642 1.54 Expression\n", " distance('band_h2s',0,1) 1 0.07365 -0.07365 angstrom 1.000 2.170 0.92 Expression\n", " distance('band_110_noconstraints',3,12) 1 0.06262 +0.06262 angstrom 1.000 1.568 0.66 Expression\n", " distance('band_110_noconstraints',39,42) 1 0.05802 +0.05802 angstrom 1.000 1.347 0.57 Expression\n", " distance('band_110_noconstraints',42,47) 1 0.05528 +0.05528 angstrom 1.000 1.222 0.52 Expression\n", " distance('band_110_noconstraints',27,47) 1 0.03551 +0.03551 angstrom 1.000 0.504 0.21 Expression\n", " distance('band_h2s_110',14, 37) 1 0.02452 -0.02452 angstrom 1.000 0.240 0.10 Expression\n", " distance('band_110_noconstraints',4,12) 1 0.00868 +0.00868 angstrom 1.000 0.030 0.01 Expression\n", " distance('band_110_noconstraints',19, 42) 1 0.00011 -0.00011 angstrom 1.000 0.000 0.00 Expression\n", " distance('band_110_noconstraints',12,15) 1 0.00004 -0.00004 angstrom 1.000 0.000 0.00 Expression\n", " distance('band_110_noconstraints',5,28) 1 0.00000 -0.00000 angstrom 1.000 0.000 0.00 Expression\n", "\n", " charges 110 0.10562 +0.11519 au 6.000 9.138 3.87 Extractor\n", " zincblende_sp 2 0.15138 +0.15138 au 1.000 2.292 0.97 Expression\n", " wurtzite_sp 4 0.14789 +0.14789 au 1.000 2.187 0.93 Expression\n", " rocksalt_sp 2 0.13159 +0.13159 au 1.000 1.731 0.73 Expression\n", " band_110_noconstraints 48 0.11118 +0.11430 au 1.000 1.306 0.55 Expression\n", " band_h2s_110 51 0.09724 +0.11327 au 1.000 1.283 0.54 Expression\n", " band_h2s 3 0.05482 +0.05814 au 1.000 0.338 0.14 Expression\n", "\n", " dihedral 1 1.91010 +1.91010 degree 1.000 0.912 0.39 Extractor\n", " dihedral('band_110_noconstraints',9,28,27,23) 1 1.91010 +1.91010 degree 1.000 0.912 0.39 Expression\n", "-------------------------------------------------------------------------------------------------------------------------------------------------\n", "The weighted total loss function is 236.128.\n", "N: number of numbers averaged for the MAE/RMSE\n", "MAE and RMSE: These are not weighted!\n", "RMSE*: if N == 1 the signed residual (reference-prediction) is given instead of the RMSE.\n", "Unit*: if the unit is \"Mixed!\" it means that the MAE and RMSE are meaningless.\n", "Loss function type: SSE(). The loss function value is affected by the Weight and Sigma of data_set entries.\n", "Contribution[%]: The contribution to the weighted loss function.\n" ] } ], "source": [ "print(dse.str())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that the extractor names for the various expressions are not shown if there are no arguments to the extractor. This makes the output more readable.\n", "\n", "You can access individual entries from the above table as follows:" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "110\n" ] } ], "source": [ "print(len(dse.results[\"charges\"].residuals)) # the N for the charges" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.151381045\n" ] } ], "source": [ "print(dse.results[\"charges\"][\"zincblende_sp\"].mae) # MAE for an expression" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1.0272752938737622\n" ] } ], "source": [ "print(dse.results[\"forces\"].rmse) # RMSE for an extractor" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "eV/angstrom\n" ] } ], "source": [ "print(dse.results[\"forces\"].unit) # unit for an extractor" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1.0\n" ] } ], "source": [ "print(\n", " dse.results[\"charges\"][\"wurtzite_sp\"].weight\n", ") # the weight is returned as a scalar, even for array reference values" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1.4626476245701765\n" ] } ], "source": [ "print(\n", " dse.results[\"energy\"][\"1.0*zincblende_sp-0.5*wurtzite_sp\"].my_loss\n", ") # \"my_loss\" refers to the loss of the individual entry" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.3781877244315181\n" ] } ], "source": [ "print(dse.results[\"forces\"].contribution) # fractional contribution to the weighted loss function" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "236.1283753165323\n" ] } ], "source": [ "print(dse.results.total_loss) # total loss function value" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SSE()\n" ] } ], "source": [ "print(dse.results.loss_type) # type of loss function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also just print a summary of a part of the table:" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Group/Expression N MAE RMSE* Unit* Weight Loss* Contribution[%]\n", "-----------------------------------------------------------------------------------------------------------------------\n", "forces 297 0.76691 +1.02728 eV/angstrom 2.000 89.301 37.82 Extractor\n", " band_distorted_clean_110 144 0.89717 +1.14169 eV/angstrom 1.000 54.772 23.20 Expression\n", " band_distorted_ads_110 153 0.64432 +0.90649 eV/angstrom 1.000 34.529 14.62 Expression\n", "-----------------------------------------------------------------------------------------------------------------------\n", "The weighted total loss function is 236.128.\n", "N: number of numbers averaged for the MAE/RMSE\n", "MAE and RMSE: These are not weighted!\n", "RMSE*: if N == 1 the signed residual (reference-prediction) is given instead of the RMSE.\n", "Unit*: if the unit is \"Mixed!\" it means that the MAE and RMSE are meaningless.\n", "Loss function type: None. The loss function value is affected by the Weight and Sigma of data_set entries.\n", "Contribution[%]: The contribution to the weighted loss function.\n" ] } ], "source": [ "print(dse.results[\"forces\"].str())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also modify the grouping to only go one level deep:" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Group/Expression N MAE RMSE* Unit* Weight Loss* Contribution[%]\n", "-------------------------------------------------------------------------------------------------------\n", "Total 466 0.59112 +0.97646 Mixed! 50.000 236.128 100.00 Total\n", " forces 297 0.76691 +1.02728 eV/angstrom 2.000 89.301 37.82 Extractor\n", " pes 30 0.09157 +0.14448 eV 13.000 65.858 27.89 Extractor\n", " energy 9 0.63328 +1.63647 eV 9.000 26.796 11.35 Extractor\n", " angle 7 3.59374 +3.79878 degree 7.000 25.254 10.69 Extractor\n", " distance 12 0.04638 +0.06270 angstrom 12.000 18.869 7.99 Extractor\n", " charges 110 0.10562 +0.11519 au 6.000 9.138 3.87 Extractor\n", " dihedral 1 1.91010 +1.91010 degree 1.000 0.912 0.39 Extractor\n", "-------------------------------------------------------------------------------------------------------\n", "The weighted total loss function is 236.128.\n", "N: number of numbers averaged for the MAE/RMSE\n", "MAE and RMSE: These are not weighted!\n", "RMSE*: if N == 1 the signed residual (reference-prediction) is given instead of the RMSE.\n", "Unit*: if the unit is \"Mixed!\" it means that the MAE and RMSE are meaningless.\n", "Loss function type: SSE(). The loss function value is affected by the Weight and Sigma of data_set entries.\n", "Contribution[%]: The contribution to the weighted loss function.\n" ] } ], "source": [ "dse.group_by((\"Extractor\",)) # the default is group_by(('Extractor', 'Expression'))\n", "print(dse.str())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If there is metadata attached to the training set entries, you can also group by those. For example, when creating a training set with a ``ResultsImporter``, the ``Group`` and ``SubGroup`` metadata are automatically set:" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Group/Expression N MAE RMSE* Unit* Weight Loss* Contribution[%]\n", "--------------------------------------------------------------------------------------------------------------------------\n", "Total 466 0.59112 +0.97646 Mixed! 50.000 236.128 100.00 Total\n", "\n", " Forces 297 0.76691 +1.02728 eV/angstrom 2.000 89.301 37.82 Group\n", " band_distorted_clean_110 144 0.89717 +1.14169 eV/angstrom 1.000 54.772 23.20 SubGroup\n", " band_distorted_ads_110 153 0.64432 +0.90649 eV/angstrom 1.000 34.529 14.62 SubGroup\n", "\n", " None 31 0.15023 +0.37134 Mixed! 14.000 66.770 28.28 Group\n", " bondscan_h2s_pbesol 10 0.16696 +0.22823 eV 3.000 52.759 22.34 SubGroup\n", " rocksalt 5 0.06917 +0.08621 eV 4.000 10.036 4.25 SubGroup\n", " anglescan_h2s_pbesol 10 0.06506 +0.08106 eV 1.000 2.218 0.94 SubGroup\n", " band_110_noconstraints 1 1.91010 +1.91010 degree 1.000 0.912 0.39 SubGroup\n", " zincblende 5 0.01622 +0.02237 eV 5.000 0.844 0.36 SubGroup\n", "\n", " ReactionEnergy 9 0.63328 +1.63647 eV 9.000 26.796 11.35 Group\n", " None 9 0.63328 +1.63647 eV 9.000 26.796 11.35 SubGroup\n", "\n", " Angles 7 3.59374 +3.79878 degree 7.000 25.254 10.69 Group\n", " band_110_noconstraints 6 3.79407 +3.98528 degree 6.000 23.824 10.09 SubGroup\n", " band_h2s 1 2.39175 +2.39175 degree 1.000 1.430 0.61 SubGroup\n", "\n", " Distances 12 0.04638 +0.06270 angstrom 12.000 18.869 7.99 Group\n", " band_h2s_110 2 0.08361 +0.10238 angstrom 2.000 8.386 3.55 SubGroup\n", " band_110_noconstraints 9 0.03508 +0.04806 angstrom 9.000 8.314 3.52 SubGroup\n", " band_h2s 1 0.07365 -0.07365 angstrom 1.000 2.170 0.92 SubGroup\n", "\n", " Charges 110 0.10562 +0.11519 au 6.000 9.138 3.87 Group\n", " zincblende_sp 2 0.15138 +0.15138 au 1.000 2.292 0.97 SubGroup\n", " wurtzite_sp 4 0.14789 +0.14789 au 1.000 2.187 0.93 SubGroup\n", " rocksalt_sp 2 0.13159 +0.13159 au 1.000 1.731 0.73 SubGroup\n", " band_110_noconstraints 48 0.11118 +0.11430 au 1.000 1.306 0.55 SubGroup\n", " band_h2s_110 51 0.09724 +0.11327 au 1.000 1.283 0.54 SubGroup\n", " band_h2s 3 0.05482 +0.05814 au 1.000 0.338 0.14 SubGroup\n", "--------------------------------------------------------------------------------------------------------------------------\n", "The weighted total loss function is 236.128.\n", "N: number of numbers averaged for the MAE/RMSE\n", "MAE and RMSE: These are not weighted!\n", "RMSE*: if N == 1 the signed residual (reference-prediction) is given instead of the RMSE.\n", "Unit*: if the unit is \"Mixed!\" it means that the MAE and RMSE are meaningless.\n", "Loss function type: SSE(). The loss function value is affected by the Weight and Sigma of data_set entries.\n", "Contribution[%]: The contribution to the weighted loss function.\n" ] } ], "source": [ "dse.group_by((\"Group\", \"SubGroup\"))\n", "print(dse.str())" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.7669139308273065\n" ] } ], "source": [ "print(dse.results[\"Forces\"].mae) # capital F in the Group metadata" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Access individual predictions and reference values (scatter_plots/)\n", "\n", "Call the ``.detailed_string()`` method to get files similar to ``scatter_plots/forces.txt`` etc." ] }, { "cell_type": "code", "execution_count": 77, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#Reference Prediction Unit Sigma Weight WSE* Row* Col* Expression\n", "#------------------------------------------------------------------------------------------------------------------------\n", "+0.419 +0.392 eV 0.054 1.0000 0.255 0 0 pes('zincblende', relative_to=2)\n", "+0.092 +0.092 eV 0.054 1.0000 0.000 1 0 pes('zincblende', relative_to=2)\n", "+0.000 +0.000 eV 0.054 1.0000 0.000 2 0 pes('zincblende', relative_to=2)\n", "+0.078 +0.092 eV 0.054 1.0000 0.065 3 0 pes('zincblende', relative_to=2)\n", "+0.278 +0.317 eV 0.054 1.0000 0.525 4 0 pes('zincblende', relative_to=2)\n", "+0.474 +0.336 eV 0.054 0.8000 5.171 0 0 pes('rocksalt', relative_to=2)\n", "+0.111 +0.083 eV 0.054 0.8000 0.202 1 0 pes('rocksalt', relative_to=2)\n", "+0.000 +0.000 eV 0.054 0.8000 0.000 2 0 pes('rocksalt', relative_to=2)\n", "+0.073 +0.006 eV 0.054 0.8000 1.220 3 0 pes('rocksalt', relative_to=2)\n", "+0.274 +0.161 eV 0.054 0.8000 3.442 4 0 pes('rocksalt', relative_to=2)\n", "+1.335 +0.857 eV 0.054 0.3000 23.227 0 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.732 +0.560 eV 0.054 0.3000 2.990 1 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.342 +0.333 eV 0.054 0.3000 0.007 2 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.114 +0.169 eV 0.054 0.3000 0.306 3 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.011 +0.060 eV 0.054 0.3000 0.252 4 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.000 +0.000 eV 0.054 0.3000 0.000 5 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.059 -0.019 eV 0.054 0.3000 0.614 6 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.170 -0.002 eV 0.054 0.3000 2.999 7 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.319 +0.044 eV 0.054 0.3000 7.654 8 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.495 +0.114 eV 0.054 0.3000 14.710 9 0 pes('bondscan_h2s_pbesol', relative_to=5)\n", "+0.650 +0.700 eV 0.054 0.1000 0.086 0 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "+0.204 +0.186 eV 0.054 0.1000 0.010 1 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "+0.000 +0.000 eV 0.054 0.1000 0.000 2 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "+0.040 +0.096 eV 0.054 0.1000 0.106 3 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "+0.307 +0.422 eV 0.054 0.1000 0.451 4 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "+0.768 +0.903 eV 0.054 0.1000 0.616 5 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "+1.376 +1.453 eV 0.054 0.1000 0.197 6 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "+2.043 +1.990 eV 0.054 0.1000 0.093 7 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "+2.597 +2.458 eV 0.054 0.1000 0.657 8 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "+2.818 +2.825 eV 0.054 0.1000 0.002 9 0 pes('anglescan_h2s_pbesol', relative_to=2)\n", "#------------------------------------------------------------------------------------------------------------------------\n", "#WSE*: Weighted Squared Error: weight*([reference-prediction]/sigma)**2\n", "#Row*, Col*: For scalars both numbers are 0. For 1D arrays Col is 0.\n" ] } ], "source": [ "dse.group_by((\"Extractor\", \"Expression\")) # reset to the original grouping\n", "results = dse.results[\"pes\"] # look at the results for the pes extractor\n", "print(results.detailed_string())" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0.419314, 0.09164115, 0.0, 0.07841534, 0.27771948, 0.47439122, 0.11065178, 0.0, 0.07282489, 0.27377707, 1.33538276, 0.73173446, 0.34163308, 0.11433319, 0.01054105, 0.0, 0.05929865, 0.17040413, 0.3193521, 0.49523743, 0.64987859, 0.20385679, 0.0, 0.04011389, 0.30652919, 0.76818668, 1.37634888, 2.04264645, 2.59729761, 2.8175004]\n" ] } ], "source": [ "print(results.reference_values) # list of reference values" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0.39185008, 0.09196291, 0.0, 0.09227838, 0.31714676, 0.33602331, 0.08328586, 0.0, 0.00560645, 0.16088318, 0.85651058, 0.55991041, 0.33346583, 0.16932453, 0.06042187, 0.0, -0.0185412, -0.00165861, 0.04446513, 0.11414837, 0.70031273, 0.18640377, 0.0, 0.09607728, 0.42212549, 0.90330381, 1.45275737, 1.99029061, 2.45778418, 2.825236]\n" ] } ], "source": [ "print(results.predictions) # list of predicted values" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "eV\n" ] } ], "source": [ "print(results.unit) # the unit" ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0.054422772491975996, 0.054422772491975996, 0.054422772491975996, 0.054422772491975996]\n" ] } ], "source": [ "print(results.accuracies) # the Sigma values (per expression)" ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1.0, 1.0, 1.0, 1.0, 1.0, 0.8, 0.8, 0.8, 0.8, 0.8, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]\n" ] } ], "source": [ "print(results.weights) # the Weights (per reference/prediction)" ] }, { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0.0035761475951556648, 0.04250420478293943, 0.2234329155570571, 0.009394469642807931]\n" ] } ], "source": [ "print(results.contributions) # list of individual contributions (per expression)" ] }, { "cell_type": "code", "execution_count": 78, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[\"pes('zincblende', relative_to=2)\", \"pes('rocksalt', relative_to=2)\", \"pes('bondscan_h2s_pbesol', relative_to=5)\", \"pes('anglescan_h2s_pbesol', relative_to=2)\"]\n" ] } ], "source": [ "print(results.expressions) # list of expressions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that the number of reference values is different from the number of expressions when the reference values are arrays. To get the reference values per expression:" ] }, { "cell_type": "code", "execution_count": 76, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Expression: pes('zincblende', relative_to=2), Ref. values: [0.419314, 0.09164115, 0.0, 0.07841534, 0.27771948]\n", "Expression: pes('rocksalt', relative_to=2), Ref. values: [0.47439122, 0.11065178, 0.0, 0.07282489, 0.27377707]\n", "Expression: pes('bondscan_h2s_pbesol', relative_to=5), Ref. values: [1.33538276, 0.73173446, 0.34163308, 0.11433319, 0.01054105, 0.0, 0.05929865, 0.17040413, 0.3193521, 0.49523743]\n", "Expression: pes('anglescan_h2s_pbesol', relative_to=2), Ref. values: [0.64987859, 0.20385679, 0.0, 0.04011389, 0.30652919, 0.76818668, 1.37634888, 2.04264645, 2.59729761, 2.8175004]\n" ] } ], "source": [ "for e in results.expressions:\n", " print(f\"Expression: {e}, Ref. values: {results[e].reference_values}\")" ] }, { "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.6.9" } }, "nbformat": 4, "nbformat_minor": 4 }