Commit 71bfaf2a authored by Mohamed, Fawzi Roberto (fawzi)'s avatar Mohamed, Fawzi Roberto (fawzi)
Browse files

adding forgotten delta-ml tutorial

parent 279c8f19
{
"beaker": "2",
"evaluators": [
{
"name": "HTML",
"plugin": "HTML",
"view": {
"cm": {
"mode": "htmlmixed"
}
}
},
{
"name": "JavaScript",
"plugin": "JavaScript",
"view": {
"cm": {
"mode": "javascript",
"background": "#FFE0F0"
}
},
"languageVersion": "ES2015"
},
{
"name": "IPython",
"plugin": "IPython",
"setup": "%matplotlib inline\nimport numpy\nimport matplotlib\nfrom matplotlib import pylab, mlab, pyplot\nnp = numpy\nplt = pyplot\nfrom IPython.display import display\nfrom IPython.core.pylabtools import figsize, getfigs\nfrom pylab import *\nfrom numpy import *\n",
"view": {
"cm": {
"mode": "python"
}
}
},
{
"name": "Groovy",
"plugin": "Groovy",
"imports": "graxxia.*\njava.util.concurrent.TimeUnit\ncom.twosigma.beaker.NamespaceClient\ncom.twosigma.beaker.BeakerProgressUpdate\ncom.twosigma.beaker.chart.Color\ncom.twosigma.beaker.chart.GradientColor\ncom.twosigma.beaker.chart.legend.*\ncom.twosigma.beaker.chart.Filter\ncom.twosigma.beaker.chart.xychart.*\ncom.twosigma.beaker.chart.xychart.plotitem.*\ncom.twosigma.beaker.chart.categoryplot.*\ncom.twosigma.beaker.chart.categoryplot.plotitem.*\ncom.twosigma.beaker.chart.histogram.*\ncom.twosigma.beaker.chart.treemap.*\ncom.twosigma.beaker.chart.treemap.util.*\nnet.sf.jtreemap.swing.*\ncom.twosigma.beaker.chart.heatmap.HeatMap\ncom.twosigma.beaker.chart.KeyboardCodes\ncom.twosigma.beaker.jvm.object.*\ncom.twosigma.beaker.easyform.*\ncom.twosigma.beaker.easyform.formitem.*\ncom.twosigma.beaker.table.*\ncom.twosigma.beaker.table.format.*\ncom.twosigma.beaker.table.renderer.*\ncom.twosigma.beaker.table.highlight.*",
"view": {
"cm": {
"mode": "groovy"
}
}
}
],
"cells": [
{
"id": "code0eMtHu",
"type": "code",
"evaluator": "IPython",
"input": {
"body": [
"import os",
"os.chdir(\"/home/beaker/notebooks/ex1-molecules/molkrr\")",
"",
""
],
"hidden": true
},
"output": {
"state": {},
"selectedType": "Hidden",
"pluginName": "IPython",
"shellId": "C074E3DBE84B47A7807B5EAD0AE3C347",
"elapsedTime": 409,
"height": 81,
"hidden": true
},
"evaluatorReader": true,
"lineCount": 4,
"initialization": true,
"isError": false
},
{
"id": "codeE6GBbQ",
"type": "code",
"evaluator": "HTML",
"input": {
"body": [
"<label style=\"text-align: left; color: #20335d; font-weight: 900; font-size: 18pt; padding-top: 2em;\">",
"Prediction of molecular excitation energies from the ground-state:</label><br/>",
"<!-- Here put a subtitle",
"<label style=\"color: #20335d;font-weight: 900; font-size: 15pt;\">\"Some subtitle\"</label>",
" </p>",
"-->",
"",
"<!-- This part is for the author of the notebook, and some space for the version of the last review-->",
" <p style=\"font-size: 15px;\">Alejandro Perez Paz, Ask Hjorth Larsen, Joaquim Jornet Somoza, Carlos Manuel de Armas Morejón <span style=\"font-size: smaller;\">[version 2017-03-27]</span></p>",
"",
"<!-- Description of the notebook and what manage to do exactly-->",
"<div style=\"padding-top: 1em;\">",
"In this tutorial we predict the first excitation energy of molecules",
"from their geometric structure and from electronic properties of the",
"ground state.",
"</div>",
"",
"",
"<!-- If it is base on the work of some other people or on a publish article is the time to give proper credit-->",
"<!--",
"<div style=\"padding: 1ex; margin-top: 1ex; margin-bottom: 1ex; border-style: dotted; border-width: 1pt; border-color: blue; border-radius: 3px;\">",
"Athor 1, Author 2,... </span>, REFERNCEs ANSOME OTHE DATA <a href={\"link to some article page\"}>[PDF]</a>",
"</div>",
"-->",
"<div>",
"\"Run\" to check the algorithm; \"Background\" for a breve explanation; \"Instructions\" to know how things works. \"Settings\" to change the algorithm inputs and outputs.",
"</div>",
"<div style=\"padding-top: 2ex;\">",
"",
"</div>"
],
"hidden": true
},
"output": {
"state": {},
"result": {
"type": "BeakerDisplay",
"innertype": "Html",
"object": "<script>\nvar beaker = bkHelper.getBeakerObject().beakerObj;\n</script>\n<label style=\"text-align: left; color: #20335d; font-weight: 900; font-size: 18pt; padding-top: 2em;\">\nPrediction of molecular excitation energies from the ground-state:</label><br>\n<!-- Here put a subtitle\n<label style=\"color: #20335d;font-weight: 900; font-size: 15pt;\">\"Some subtitle\"</label>\n </p>\n-->\n\n<!-- This part is for the author of the notebook, and some space for the version of the last review-->\n <p style=\"font-size: 15px;\">Alejandro Perez Paz, Ask Hjorth Larsen, Joaquim Jornet Somoza, Carlos Manuel de Armas Morejón <span style=\"font-size: smaller;\">[version 2017-03-27]</span></p>\n\n<!-- Description of the notebook and what manage to do exactly-->\n<div style=\"padding-top: 1em;\">\nIn this tutorial we predict the first excitation energy of molecules\nfrom their geometric structure and from electronic properties of the\nground state.\n</div>\n\n\n<!-- If it is base on the work of some other people or on a publish article is the time to give proper credit-->\n<!--\n<div style=\"padding: 1ex; margin-top: 1ex; margin-bottom: 1ex; border-style: dotted; border-width: 1pt; border-color: blue; border-radius: 3px;\">\nAthor 1, Author 2,... </span>, REFERNCEs ANSOME OTHE DATA <a href={\"link to some article page\"}>[PDF]</a>\n</div>\n-->\n<div>\n\"Run\" to check the algorithm; \"Background\" for a breve explanation; \"Instructions\" to know how things works. \"Settings\" to change the algorithm inputs and outputs.\n</div>\n<div style=\"padding-top: 2ex;\">\n\n</div>"
},
"selectedType": "BeakerDisplay",
"elapsedTime": 1,
"height": 200
},
"evaluatorReader": true,
"lineCount": 30,
"isError": false
},
{
"id": "codezSZfYL",
"type": "code",
"evaluator": "HTML",
"input": {
"body": [
"<script>",
"var action_funtion = function() {",
" $(\"#result_button\").removeClass(\"active\").addClass(\"disabled\");",
" var reset_btn = document.getElementById('hidden-btn');",
" var space_label_btn = document.getElementById('hidden-label-space');",
" reset_btn.style.display = 'inline';",
" space_label_btn.style.display = 'inline';",
" getParameters()",
" beaker.evaluate(\"action_cell\"); // do something",
" beaker.evaluate(\"graph_cell\");",
"",
"};",
"var hide_reset_btn = function(){",
" var reset_btn = document.getElementById('hidden-btn');",
" var space_label_btn = document.getElementById('hidden-label-space');",
" reset_btn.style.display = 'none';",
" space_label_btn.style.display = 'none';",
"}",
"var reset = function(){",
" beaker.evaluate(\"settings-cell\");",
" hide_reset_btn()",
" var settings_cell = document.getElementById('hidden-settings-div');",
" settings_cell.style.display = 'none';",
"};",
"var view_settings = function(){",
" var settings_cell = document.getElementById('hidden-settings-div');",
" if(settings_cell.style.display == 'block')",
" {",
" settings_cell.style.display = 'none';",
" }",
" else",
" {",
" settings_cell.style.display = 'block';",
" document.getElementById('e_desc').checked = false;",
" document.getElementById('e_sigma').disabled = true;",
" }",
"};",
"var getParameters = function() {",
" beaker.param = {};",
" // var elements = document.getElementById(\"features_select\").elements;",
" for(var i = 0;i<document.forms.length;i++)",
" { ",
" for(var j = 0 ; j < document.forms[i].elements.length ; j++)",
" {",
" var item = document.forms[i].elements[j];",
" beaker.param[item.id] = Number(item.value);",
" if (item.id == 'e_desc')",
" {",
" if (item.value==0)",
" {",
" beaker.param[item.id] = item.checked? 1: 3;",
" }",
" else",
" {",
" beaker.param[item.id] = parseInt(item.value);",
" }",
" }",
" }",
" }",
" // beaker.param[\"theory_type\"] = 2;",
" beaker.param[\"method\"] = 2;",
" beaker.param[\"range\"] = 1;",
" beaker.param[\"db_type\"] = 1;",
" beaker.param[\"proper\"] = 1",
"};",
"beaker.show_result = function(result_link) {",
" $(\"#result_button\").attr(\"href\", result_link);",
" $(\"#result_button\").removeClass(\"disabled\").addClass(\"active\");",
"}",
"</script>",
"<style type=\"text/css\">",
" #hidden-btn{",
" display:normal;",
" } ",
"</style>",
"<style type=\"text/css\">",
" #hidden-label-space{",
" display:normal;",
" } ",
"</style>",
"<!--Actions buttons--->",
"<button class=\"btn btn-default\" onclick='action_funtion()' style=\"font-weight: bold;\">RUN</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
"<button class=\"btn btn-default\" id=\"hidden-btn\" onclick='reset()'>Reset</button><label id=\"hidden-label-space\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>",
"<!--<label title=\"This button becomes active when the run is finished.\"> <a href=\"#\" target=\"_blank\" class=\"btn btn-primary disabled\" id=\"result_button\" >View interactive plot</a> </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->",
"",
"<!-- this will popup a modal windows -->",
"<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#background-modal\">",
" Background",
"</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
"",
"<!-- Modal -->",
"<div class=\"modal fade\" id=\"background-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"background-modal-label\">",
" <div class=\"modal-dialog modal-lg\" role=\"document\">",
" <div class=\"modal-content\">",
" <div class=\"modal-header\">",
" <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>",
" <h4 class=\"modal-title\" id=\"background-modal-label\">Background</h4>",
" </div>",
" <div class=\"modal-body background-instructions\">",
" <p> We have ground-state and excited-state calculations of 22,000 molecules [RHTL2015]. The question is: Knowing ground-state data and",
" excitation energy for a subset of these molecules — the training set — how well can we predict the excitation energies for other molecules in the set from only their ground-state data?</p>",
"",
" <p> We here use the simple Kernel Ridge Regression algorithm [MW-KRR].The algorithm relies on numerical descriptors that are used to express the similarity of two molecules as a distance. The predicted value is taken by weighting known reference values from the training set according to their similarity to the test molecule.</p>",
"",
" <p> Choose different sizes of training set and different descriptors. The sorted Coulomb matrix (determined by the geometric structure) or the HOMO–LUMO gap (energy difference between highest occupied molecular orbital and lowest unoccupied molecular orbital which correlates with the actual excitation energy). Different types of descriptor can be weighted differently when determining the distance; these weights (called sigma) will affect how well the quantities are taken into account and affect the quality of predictions. </p>",
"",
" <!-- <p>extra bla bla bla, plus some links click <a href=\"CHANGE THIS\" target=\"_blank\">here</a> for more info on the Bla Bla</p> ",
"",
" <p> By running the tutorial with the default setting, you will be able to see some cool staf. In particular, by clicking on “View interactive 2D plot”, you will see an interactive chart that will blow your mind</p> -->",
" <!-- to show some images if it is necesary--> ",
" <!-- <img style=\"width:67%;height:67%\" src=\"2016-08-02_ZB_RS3-2.png\">-->",
" <br/>",
" <br/>",
" <p>References:</p>",
" <ol>",
" <li>[RHTL2015] The Journal of Chemical Physics 143, 084111 (2015)</li>",
" <li>[MW-KRR] <a href=\"https://www.ics.uci.edu/~welling/classnotes/papers_class/Kernel-Ridge.pdf\" target=\"_blank\">Kernel-Ridge.pdf</a></li>",
" </ol>",
" </div>",
" <div class=\"modal-footer\">",
" <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>",
" </div>",
" </div>",
" </div>",
"</div>",
"",
"<!-- Button trigger modal -->",
"<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#instructions-modal\">",
" Instructions",
"</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
"",
"<!-- Modal -->",
"<div class=\"modal fade\" id=\"instructions-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"instructions-modal-label\">",
" <div class=\"modal-dialog\" role=\"document\">",
" <div class=\"modal-content\">",
" <div class=\"modal-header\">",
" <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>",
" <h4 class=\"modal-title\" id=\"instructions-modal-label\">Instructions</h4>",
" </div>",
" <div class=\"modal-body instructions\">",
"<b><p>Instructions list </p></b>",
"",
"<p>This Beaker is preset with a small group of parameters are used by default, if you want to change something, the button <b>Settings</b>, allow you to do that.</p>",
"",
"<p>The section “Settings” has tree subsections:</p>",
"<ul>",
" ",
" <b><li> ML algorithm settings:</li></b>",
" <ul>",
" ",
" <li> Training set size: Number of molecules used to train the algorithm</li>",
" <li> Control set size: Number of molecules for which to test predictions</li>",
" <li> Norm: Method for calculating distances between two descriptors. L1 is the sum of absolute values of the differences between descriptors. L2 is the square root of the sum of the squared differences.</li>",
" <li>Regulatization λ: The learning mechanism stores information as a matrix K based on the distances between descriptors. If descriptors are very similar, the calculation will be badly conditioned. λ is added to the diagonal to improve the condition number, but a large value of λ will reduce the accuracy of the calculation.</li>",
" ",
" </ul>",
" ",
" <b><li> Descriptors:</li></b>",
" <ul>",
"",
" <li>Structural Descriptor: The structural descriptor attempts to capture the geometric similarity of two molecules as a single number. The structural descriptor does not describe excitation energies well, but structurally similar molecules are likely to have similar excitation energies. </li>",
" <li>Structural normalization (σ): Distances between Coulomb matrices are divided by this number. Distances are on the order of 1000 (in the units of the internal representation); hence reasonable normalizations are on the order of 1000. When using two descriptors at the same time, they should be normalized to similar values to achieve a good combination.</li>",
" <li>Electronic Descriptor: The HOMO-LUMO gap is the energy difference between highest occupied state and lowest unoccupied state in the ground-state calculation. This is a reasonable approximation of the excitation energy, and hence a good descriptor for predicting excitation energies. However it is only a single number and therefore cannot distinguish well between two different molecules that have (close to) the same HOMO-LUMO gap without the help of another descriptor.</li>",
" <li>Electronic normalization (σ): Distances between electronic descriptors are divided by this number. Distances are typically between 1 to 10 eV; hence a reasonable normalization is on the order of 1 to 10.</li> ",
" </ul>",
" <b><li>Feature to predict:</li></b>",
" <ul>",
" <li>Property to predict: Here yo can chose from two properties “Excitations energy” or the “Oscillations Strength”</li>",
" </ul>",
"</ul>",
"<p>After you feel comfortable with the parameters press the <b>RUN</b> button button and wait for the results.</p>",
" <!-- <p>References:</p>",
" <ol>",
" <li>[RHTL2015] The Journal of Chemical Physics 143, 084111 (2015)</li>",
" </ol>-->",
" </div>",
" <div class=\"modal-footer\">",
" <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>",
"<!-- <button type=\"button\" class=\"btn btn-primary\">Save changes</button> -->",
" </div>",
" </div>",
" </div>",
"</div>",
"",
"<!-- Button trigger modal -->",
"<button type=\"button\" class=\"btn btn-default\" onclick='view_settings()'>",
" Settings",
"</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",
"<a target=\"_blank\" href=\"http://forum.analytics-toolkit.nomad-coe.eu/\" class=\"btn btn-primary\">Some feed back</a>"
],
"hidden": true
},
"output": {
"state": {},
"result": {
"type": "BeakerDisplay",
"innertype": "Html",
"object": "<script>\nvar beaker = bkHelper.getBeakerObject().beakerObj;\n</script>\n<script>\nvar action_funtion = function() {\n $(\"#result_button\").removeClass(\"active\").addClass(\"disabled\");\n var reset_btn = document.getElementById('hidden-btn');\n var space_label_btn = document.getElementById('hidden-label-space');\n reset_btn.style.display = 'inline';\n space_label_btn.style.display = 'inline';\n getParameters()\n beaker.evaluate(\"action_cell\"); // do something\n beaker.evaluate(\"graph_cell\");\n\n};\nvar hide_reset_btn = function(){\n var reset_btn = document.getElementById('hidden-btn');\n var space_label_btn = document.getElementById('hidden-label-space');\n reset_btn.style.display = 'none';\n space_label_btn.style.display = 'none';\n}\nvar reset = function(){\n beaker.evaluate(\"settings-cell\");\n hide_reset_btn()\n var settings_cell = document.getElementById('hidden-settings-div');\n settings_cell.style.display = 'none';\n};\nvar view_settings = function(){\n var settings_cell = document.getElementById('hidden-settings-div');\n if(settings_cell.style.display == 'block')\n {\n settings_cell.style.display = 'none';\n }\n else\n {\n settings_cell.style.display = 'block';\n document.getElementById('e_desc').checked = false;\n document.getElementById('e_sigma').disabled = true;\n }\n};\nvar getParameters = function() {\n beaker.param = {};\n // var elements = document.getElementById(\"features_select\").elements;\n for(var i = 0;i<document.forms.length;i++)\n { \n for(var j = 0 ; j < document.forms[i].elements.length ; j++)\n {\n var item = document.forms[i].elements[j];\n beaker.param[item.id] = Number(item.value);\n if (item.id == 'e_desc')\n {\n if (item.value==0)\n {\n beaker.param[item.id] = item.checked? 1: 3;\n }\n else\n {\n beaker.param[item.id] = parseInt(item.value);\n }\n }\n }\n }\n // beaker.param[\"theory_type\"] = 2;\n beaker.param[\"method\"] = 2;\n beaker.param[\"range\"] = 1;\n beaker.param[\"db_type\"] = 1;\n beaker.param[\"proper\"] = 1\n};\nbeaker.show_result = function(result_link) {\n $(\"#result_button\").attr(\"href\", result_link);\n $(\"#result_button\").removeClass(\"disabled\").addClass(\"active\");\n}\n</script>\n<style type=\"text/css\">\n #hidden-btn{\n display:normal;\n } \n</style>\n<style type=\"text/css\">\n #hidden-label-space{\n display:normal;\n } \n</style>\n<!--Actions buttons--->\n<button class=\"btn btn-default\" onclick=\"action_funtion()\" style=\"font-weight: bold;\">RUN</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n<button class=\"btn btn-default\" id=\"hidden-btn\" onclick=\"reset()\" style=\"display: inline;\">Reset</button><label id=\"hidden-label-space\" style=\"display: inline;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>\n<!--<label title=\"This button becomes active when the run is finished.\"> <a href=\"#\" target=\"_blank\" class=\"btn btn-primary disabled\" id=\"result_button\" >View interactive plot</a> </label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->\n\n<!-- this will popup a modal windows -->\n<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#background-modal\">\n Background\n</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\n<!-- Modal -->\n<div class=\"modal fade\" id=\"background-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"background-modal-label\">\n <div class=\"modal-dialog modal-lg\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n <h4 class=\"modal-title\" id=\"background-modal-label\">Background</h4>\n </div>\n <div class=\"modal-body background-instructions\">\n <p> We have ground-state and excited-state calculations of 22,000 molecules [RHTL2015]. The question is: Knowing ground-state data and\n excitation energy for a subset of these molecules — the training set — how well can we predict the excitation energies for other molecules in the set from only their ground-state data?</p>\n\n <p> We here use the simple Kernel Ridge Regression algorithm [MW-KRR].The algorithm relies on numerical descriptors that are used to express the similarity of two molecules as a distance. The predicted value is taken by weighting known reference values from the training set according to their similarity to the test molecule.</p>\n\n <p> Choose different sizes of training set and different descriptors. The sorted Coulomb matrix (determined by the geometric structure) or the HOMO–LUMO gap (energy difference between highest occupied molecular orbital and lowest unoccupied molecular orbital which correlates with the actual excitation energy). Different types of descriptor can be weighted differently when determining the distance; these weights (called sigma) will affect how well the quantities are taken into account and affect the quality of predictions. </p>\n\n <!-- <p>extra bla bla bla, plus some links click <a href=\"CHANGE THIS\" target=\"_blank\">here</a> for more info on the Bla Bla</p> \n\n <p> By running the tutorial with the default setting, you will be able to see some cool staf. In particular, by clicking on “View interactive 2D plot”, you will see an interactive chart that will blow your mind</p> -->\n <!-- to show some images if it is necesary--> \n <!-- <img style=\"width:67%;height:67%\" src=\"2016-08-02_ZB_RS3-2.png\">-->\n <br>\n <br>\n <p>References:</p>\n <ol>\n <li>[RHTL2015] The Journal of Chemical Physics 143, 084111 (2015)</li>\n <li>[MW-KRR] <a href=\"https://www.ics.uci.edu/~welling/classnotes/papers_class/Kernel-Ridge.pdf\" target=\"_blank\">Kernel-Ridge.pdf</a></li>\n </ol>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n </div>\n </div>\n </div>\n</div>\n\n<!-- Button trigger modal -->\n<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#instructions-modal\">\n Instructions\n</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\n<!-- Modal -->\n<div class=\"modal fade\" id=\"instructions-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"instructions-modal-label\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n <h4 class=\"modal-title\" id=\"instructions-modal-label\">Instructions</h4>\n </div>\n <div class=\"modal-body instructions\">\n<b><p>Instructions list </p></b>\n\n<p>This Beaker is preset with a small group of parameters are used by default, if you want to change something, the button <b>Settings</b>, allow you to do that.</p>\n\n<p>The section “Settings” has tree subsections:</p>\n<ul>\n \n <b><li> ML algorithm settings:</li></b>\n <ul>\n \n <li> Training set size: Number of molecules used to train the algorithm</li>\n <li> Control set size: Number of molecules for which to test predictions</li>\n <li> Norm: Method for calculating distances between two descriptors. L1 is the sum of absolute values of the differences between descriptors. L2 is the square root of the sum of the squared differences.</li>\n <li>Regulatization λ: The learning mechanism stores information as a matrix K based on the distances between descriptors. If descriptors are very similar, the calculation will be badly conditioned. λ is added to the diagonal to improve the condition number, but a large value of λ will reduce the accuracy of the calculation.</li>\n \n </ul>\n \n <b><li> Descriptors:</li></b>\n <ul>\n\n <li>Structural Descriptor: The structural descriptor attempts to capture the geometric similarity of two molecules as a single number. The structural descriptor does not describe excitation energies well, but structurally similar molecules are likely to have similar excitation energies. </li>\n <li>Structural normalization (σ): Distances between Coulomb matrices are divided by this number. Distances are on the order of 1000 (in the units of the internal representation); hence reasonable normalizations are on the order of 1000. When using two descriptors at the same time, they should be normalized to similar values to achieve a good combination.</li>\n <li>Electronic Descriptor: The HOMO-LUMO gap is the energy difference between highest occupied state and lowest unoccupied state in the ground-state calculation. This is a reasonable approximation of the excitation energy, and hence a good descriptor for predicting excitation energies. However it is only a single number and therefore cannot distinguish well between two different molecules that have (close to) the same HOMO-LUMO gap without the help of another descriptor.</li>\n <li>Electronic normalization (σ): Distances between electronic descriptors are divided by this number. Distances are typically between 1 to 10 eV; hence a reasonable normalization is on the order of 1 to 10.</li> \n </ul>\n <b><li>Feature to predict:</li></b>\n <ul>\n <li>Property to predict: Here yo can chose from two properties “Excitations energy” or the “Oscillations Strength”</li>\n </ul>\n</ul>\n<p>After you feel comfortable with the parameters press the <b>RUN</b> button button and wait for the results.</p>\n <!-- <p>References:</p>\n <ol>\n <li>[RHTL2015] The Journal of Chemical Physics 143, 084111 (2015)</li>\n </ol>-->\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\n<!-- <button type=\"button\" class=\"btn btn-primary\">Save changes</button> -->\n </div>\n </div>\n </div>\n</div>\n\n<!-- Button trigger modal -->\n<button type=\"button\" class=\"btn btn-default\" onclick=\"view_settings()\">\n Settings\n</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n<a target=\"_blank\" href=\"http://forum.analytics-toolkit.nomad-coe.eu/\" class=\"btn btn-primary\">Some feed back</a>"
},
"selectedType": "BeakerDisplay",
"elapsedTime": 1,
"height": 72
},
"evaluatorReader": true,
"lineCount": 189,
"isError": false
},
{
"id": "settings-cell",
"type": "code",
"evaluator": "HTML",
"input": {
"body": [
"<style type=\"text/css\">",
" #hidden-settings-div{",
" display:none;",
" }",
"</style>",
"<script>",
" function validate(evt, value, id) ",
" {",
" var theEvent = evt || window.event;",
" var key = theEvent.keyCode || theEvent.which;",
" var learn_set;",
" var test_set;",
" if ((key < 48 || key > 57) && !(key == 8 || key == 9 || key == 13 || ",
" key == 37 || key == 39 || key == 46 || ",
" key == 44))",
" {",
" theEvent.returnValue = false;",
" if (theEvent.preventDefault) ",
" theEvent.preventDefault();",
" }",
" if (value.indexOf(',')!=-1 && key == 44)",
" {",
" theEvent.returnValue = false;",
" if (theEvent.preventDefault) ",
" theEvent.preventDefault();",
" }",
" if (id == \"test_set_size\")",
" {",
" learn_set = document.getElementById(\"training_set_size\");",
" test_set = document.getElementById(id);",
" }",
" if (id == \"test_set_size\" ",
" && (key >= 48 && key <= 57))",
" {",
" var new_key_value = key - 48;",
" var val = parseInt(value.concat(new_key_value.toString()));",
" var ls_value = parseInt(learn_set.value);",
" }",
" };",
" function check_e_descriptor(event, value)",
" {",
" var s_desc = document.getElementById(\"s_desc\");",
" if (s_desc.value == \"3\" && value == \"1\")",
" {",
" window.confirm(\"HOMO-LUMO gap is not a strong descriptor by itself\");",
" s_desc.value = \"1\";",
" }",
" };",
" function check_s_descriptor(event, value)",
" {",
" if (value == \"3\")",
" {",
" document.getElementById(\"s_sigma\").disabled = true;",
" }",
" else",
" {",
" document.getElementById(\"s_sigma\").disabled = false;",
" }",
" };",
" function hide_e_sigma(id)",
" {",
" if ( document.getElementById(id).checked)",
" {",
" document.getElementById('e_sigma').disabled = false;",
" }",
" else",
" {",
" document.getElementById('e_sigma').disabled = true;",
" }",
" };",
" function showCtrl(id, value)",
" {",
" var in_tag = document.getElementById(\"e_ctrl\");",
" var select = document.getElementById(\"e_desc_s\");",
" var inner_html_select =\"<select id=\\\"e_desc\\\"> <option value=\\\"1\\\">HOMO-LUMO gap LDA</option><option value=\\\"2\\\">HOMO-LUMO gap PBE0</option><option value=\\\"3\\\">None</option></select>\"",
" var inner_html_chkbox = \"<input value=\\\"0\\\"type=\\\"checkbox\\\" id=\\\"e_desc\\\" onclick=\\\"hide_e_sigma(id);\\\"> <label>HOMO-LUMO gap</label>\"",
" if (value == 3)",
" {",
" in_tag.innerHTML = inner_html_select;",
" document.getElementById('e_sigma').disabled = false;",
" }",
" else",
" {",
" in_tag.innerHTML = inner_html_chkbox;",
" document.getElementById('e_sigma').disabled = true;",
" }",
" }",
"</script>",
"<div class=\"ml_data\" id=\"hidden-settings-div\">",
" <form id=\"features_select\">",
" <div class=\"row\">",
" <p class=\"selection_descriptors\"><b>ML algorithm settings: </b></p>",
" <div class=\"row\">",
" <!--<label class =\"col-xs-4 col-md-4 col-lg-3\"> ",
" <i>Data base type:&nbsp;</i> <select id=\"db_type\">",
" <option value=\"1\">8 CONF</option>",
" </select></label>-->",
" ",
" <label class =\"col-xs-4 col-md-4 col-lg-3\">",
" <span title=\"Number of molecules used to train the algorithm\"> <i>Training set size:&nbsp;</i> </span>",
" <input id=\"training_set_size\" value=\"500\" min=\"1\" onkeypress='validate(event, value, id)' >",
" <!--<i>Training set size:&nbsp;</i> <select id=\"training_set_size\">",
" <option value=\"0\">1k</option>",
" <option value=\"1\">2k</option>",
" <option value=\"2\">5k</option>",
" <option value=\"3\">10k</option>",
" <option value=\"4\">15k</option>",
" </select>--></label>",
" <label class =\"col-xs-4 col-md-4 col-lg-3\">",
" <span title=\"Number of molecules for which to test predictions\"><i>Control set size:&nbsp;</i></span>",
" <input id=\"test_set_size\" value=\"100\" min=\"1\" onkeypress='validate(event, value, id)' >",
" <!-- <i>Control set size:&nbsp;</i> <select id=\"test_set_size\">",
" <option value=\"0\">1%</option>",
" <option value=\"1\">2%</option>",
" <option value=\"2\">10%</option>",
" <option value=\"3\">20%</option>",
" <option value=\"4\">50%</option>",
" </select> --></label>",
" <label class =\"col-xs-4 col-md-4 col-lg-3\"> ",
" <span title=\"Target theory for the machine learning. In the case that 'Delta ML' is selected, the prediction will be the gap between PBE0 and LDA energies. On this particular case you can select using 'Homo-Lumo gap' from LDA or PBE0.\">",
" <i>Theory level to predict:&nbsp;</i></span><select id=\"theory_type\" onchange=\"showCtrl(id, value);\">",
" <!--<option value=\"1\">LDA</option>-->",
" <option value=\"2\">PBE0</option>",
" <option value=\"3\">Delta ML</option>",
" </select></label>",
" </div>",
" <div class=\"row\">",
" <label class =\"col-xs-4 col-md-4 col-lg-3\"> ",
" <span title=\"Method for calculating distances between two descriptors. L1 is the sum of absolute values of the differences between descriptors. L2 is the square root of the sum of the squared differences.\"><i>Norm:&nbsp;</i> </span><select id=\"ml_norm\">",
" <option value=\"1\">L1</option>",
" <option value=\"2\">L2</option>",
" </select></label> ",
" <label class =\"col-xs-4 col-md-4 col-lg-3\"> ",
" <span title=\"The learning mechanism stores information as a matrix K based on the distances between descriptors. If descriptors are very similar, the calculation will be badly conditioned. λ is added to the diagonal to improve the condition number, but a large value of λ will reduce the accuracy of the calculation.\"><i>Regularization λ:</i></span> <input id=\"ganma\" value=\"0.02\" min=\"0.02\" onkeypress='validate(event, value, id)' > </label> ",
" <label id=\"theory_type\" value=\"2\" display=\"none\"></label> <label id=\"method\" value=\"2\" display=\"none\"></label>",
" <!-- <label class =\"col-xs-4 col-md-4 col-lg-3\"> ",
" <i>Method of prediction:&nbsp;</i> <select id=\"method\">",
" <option value=\"1\">Prunig</option>",
" <option value=\"2\">Full learning set</option>",
" </select></label>--> ",
" </div>",
" </div> <!-- End of row-->",
" <div class=\"row\">",
" <p class=\"selection_descriptors\"><b>Descriptors:</b></p>",
" <div class=\"row\"> ",
" <label class =\"col-xs-4 col-md-4 col-lg-3\"> ",
" <span title=\"The structural descriptor attempts to capture the geometric similarity of two molecules as a single number. The structural descriptor does not describe excitation energies well, but structurally similar molecules are likely to have similar excitation energies.\"><i>Structural descriptor:&nbsp;</i> </span> <select id=\"s_desc\" onchange='check_s_descriptor(event, value)'>",
" <option value=\"1\">Sorted Coulomb matrix</option>",
" <option value=\"2\">Diagonalized Coulomb matrix</option>",
" <option value=\"3\">None</option>",
" </select></label>",
" <label class =\"col-xs-4 col-md-4 col-lg-3\" title=\"σ value\"> ",
" <span title=\"Distances between Coulomb matrices are divided by this number. Distances are on the order of 1000 (in the units of the internal representation); hence reasonable normalizations are on the order of 1000. When using two descriptors at the same time, they should be normalized to similar values to achieve a good combination.\"><i>Structural normalization (σ):&nbsp;</i></span>",
" <input id=\"s_sigma\" value=\"1000\" min=\"1\" onkeypress='validate(event, value, id)' > </label>",
" </div>",
" <div class=\"row\"> ",
" <label class =\"col-xs-4 col-md-4 col-lg-3\">",
" <span title=\"The HOMO-LUMO gap is the energy difference between highest occupied state and lowest unoccupied state in the ground-state calculation. This is a reasonable approximation of the excitation energy, and hence a good descriptor for predicting excitation energies. However it is only a single number and therefore cannot distinguish well between two different molecules that have (close to) the same HOMO-LUMO gap without the help of another descriptor.\"><i>Electronic descriptor:&nbsp;</i></span>",
" <i id=\"e_ctrl\"><input value=\"0\" type=\"checkbox\" id=\"e_desc\" onclick=\"hide_e_sigma(id)\"> <label>HOMO-LUMO gap</label></i></label>",
" <!--",
" <i>Electronic Descriptor:&nbsp;</i> <select id=\"e_desc\" onchange='check_e_descriptor(event, value)'>",
" <option value=\"1\">HOMO-LUMO gap</option>",
" <option value=\"2\">Density of State</option>",
" <option value=\"3\">None</option>",
" </select>-->",
" <label class =\"col-xs-4 col-md-4 col-lg-3\" title=\"σ value\"> ",
" <span title=\"Distances between electronic descriptors are divided by this number. Distances are typically between 1 to 10 eV; hence a reasonable normalization is on the order of 1 to 10.\"> <i>Electronic normalization (σ):&nbsp;</i> </span>",
" <input id=\"e_sigma\" value=\"1\" min=\"1\" onkeypress='validate(event, value, id)' > </label>",
" </div> ",
" </div> <!-- End of row -->",
" <div class=\"row\">",
" <p class=\"ml_selection_descriptors\"><b>Feature to predict:</b></p>",
" <div class=\"row\">",
" <label class =\"col-xs-4 col-md-4 col-lg-3\"> ",
" <i>Excitation energy (eV)</i>",
" <!--<select id=\"proper\">",
" <option value=\"1\">Excitation energy (eV)</option>",
" <option value=\"2\">Oscillations Strength</option>",
" </select>--></label> ",
" <!--<input id=\"range\" value=\"1\" display=\"none\"> --> ",
" <!-- <i>How many values:&nbsp;</i><input id=\"range\" value=\"1\" min=\"1\" max=\"2\" onkeypress='validate(event, value, id)' > -->",
" </div>",
" </div> <!-- End of row -->",
" </form>",
"</div>"
],
"hidden": true
},
"output": {
"state": {},
"result": {
"type": "BeakerDisplay",
"innertype": "Html",
"object": "<script>\nvar beaker = bkHelper.getBeakerObject().beakerObj;\n</script>\n<style type=\"text/css\">\n #hidden-settings-div{\n display:none;\n }\n</style>\n<script>\n function validate(evt, value, id) \n {\n var theEvent = evt || window.event;\n var key = theEvent.keyCode || theEvent.which;\n var learn_set;\n var test_set;\n if ((key < 48 || key > 57) && !(key == 8 || key == 9 || key == 13 || \n key == 37 || key == 39 || key == 46 || \n key == 44))\n {\n theEvent.returnValue = false;\n if (theEvent.preventDefault) \n theEvent.preventDefault();\n }\n if (value.indexOf(',')!=-1 && key == 44)\n {\n theEvent.returnValue = false;\n if (theEvent.preventDefault) \n theEvent.preventDefault();\n }\n if (id == \"test_set_size\")\n {\n learn_set = document.getElementById(\"training_set_size\");\n test_set = document.getElementById(id);\n }\n if (id == \"test_set_size\" \n && (key >= 48 && key <= 57))\n {\n var new_key_value = key - 48;\n var val = parseInt(value.concat(new_key_value.toString()));\n var ls_value = parseInt(learn_set.value);\n }\n };\n function check_e_descriptor(event, value)\n {\n var s_desc = document.getElementById(\"s_desc\");\n if (s_desc.value == \"3\" && value == \"1\")\n {\n window.confirm(\"HOMO-LUMO gap is not a strong descriptor by itself\");\n s_desc.value = \"1\";\n }\n };\n function check_s_descriptor(event, value)\n {\n if (value == \"3\")\n {\n document.getElementById(\"s_sigma\").disabled = true;\n }\n else\n {\n document.getElementById(\"s_sigma\").disabled = false;\n }\n };\n function hide_e_sigma(id)\n {\n if ( document.getElementById(id).checked)\n {\n document.getElementById('e_sigma').disabled = false;\n }\n else\n {\n document.getElementById('e_sigma').disabled = true;\n }\n };\n function showCtrl(id, value)\n {\n var in_tag = document.getElementById(\"e_ctrl\");\n var select = document.getElementById(\"e_desc_s\");\n var inner_html_select =\"<select id=\\\"e_desc\\\"> <option value=\\\"1\\\">HOMO-LUMO gap LDA</option><option value=\\\"2\\\">HOMO-LUMO gap PBE0</option><option value=\\\"3\\\">None</option></select>\"\n var inner_html_chkbox = \"<input value=\\\"0\\\"type=\\\"checkbox\\\" id=\\\"e_desc\\\" onclick=\\\"hide_e_sigma(id);\\\"> <label>HOMO-LUMO gap</label>\"\n if (value == 3)\n {\n in_tag.innerHTML = inner_html_select;\n document.getElementById('e_sigma').disabled = false;\n }\n else\n {\n in_tag.innerHTML = inner_html_chkbox;\n document.getElementById('e_sigma').disabled = true;\n }\n }\n</script>\n<div class=\"ml_data\" id=\"hidden-settings-div\" style=\"display: block;\">\n <form id=\"features_select\">\n <div class=\"row\">\n <p class=\"selection_descriptors\"><b>ML algorithm settings: </b></p>\n <div class=\"row\">\n <!--<label class =\"col-xs-4 col-md-4 col-lg-3\"> \n <i>Data base type:&nbsp;</i> <select id=\"db_type\">\n <option value=\"1\">8 CONF</option>\n </select></label>-->\n \n <label class=\"col-xs-4 col-md-4 col-lg-3\">\n <span title=\"Number of molecules used to train the algorithm\"> <i>Training set size:&nbsp;</i> </span>\n <input id=\"training_set_size\" value=\"500\" min=\"1\" onkeypress=\"validate(event, value, id)\">\n <!--<i>Training set size:&nbsp;</i> <select id=\"training_set_size\">\n <option value=\"0\">1k</option>\n <option value=\"1\">2k</option>\n <option value=\"2\">5k</option>\n <option value=\"3\">10k</option>\n <option value=\"4\">15k</option>\n </select>--></label>\n <label class=\"col-xs-4 col-md-4 col-lg-3\">\n <span title=\"Number of molecules for which to test predictions\"><i>Control set size:&nbsp;</i></span>\n <input id=\"test_set_size\" value=\"100\" min=\"1\" onkeypress=\"validate(event, value, id)\">\n <!-- <i>Control set size:&nbsp;</i> <select id=\"test_set_size\">\n <option value=\"0\">1%</option>\n <option value=\"1\">2%</option>\n <option value=\"2\">10%</option>\n <option value=\"3\">20%</option>\n <option value=\"4\">50%</option>\n </select> --></label>\n <label class=\"col-xs-4 col-md-4 col-lg-3\"> \n <span title=\"Target theory for the machine learning. In the case that 'Delta ML' is selected, the prediction will be the gap between PBE0 and LDA energies. On this particular case you can select using 'Homo-Lumo gap' from LDA or PBE0.\">\n <i>Theory level to predict:&nbsp;</i></span><select id=\"theory_type\" onchange=\"showCtrl(id, value);\">\n <!--<option value=\"1\">LDA</option>-->\n <option value=\"2\">PBE0</option>\n <option value=\"3\">Delta ML</option>\n </select></label>\n </div>\n <div class=\"row\">\n <label class=\"col-xs-4 col-md-4 col-lg-3\"> \n <span title=\"Method for calculating distances between two descriptors. L1 is the sum of absolute values of the differences between descriptors. L2 is the square root of the sum of the squared differences.\"><i>Norm:&nbsp;</i> </span><select id=\"ml_norm\">\n <option value=\"1\">L1</option>\n <option value=\"2\">L2</option>\n </select></label> \n <label class=\"col-xs-4 col-md-4 col-lg-3\"> \n <span title=\"The learning mechanism stores information as a matrix K based on the distances between descriptors. If descriptors are very similar, the calculation will be badly conditioned. λ is added to the diagonal to improve the condition number, but a large value of λ will reduce the accuracy of the calculation.\"><i>Regularization λ:</i></span> <input id=\"ganma\" value=\"0.02\" min=\"0.02\" onkeypress=\"validate(event, value, id)\"> </label> \n <label id=\"theory_type\" value=\"2\" display=\"none\"></label> <label id=\"method\" value=\"2\" display=\"none\"></label>\n <!-- <label class =\"col-xs-4 col-md-4 col-lg-3\"> \n <i>Method of prediction:&nbsp;</i> <select id=\"method\">\n <option value=\"1\">Prunig</option>\n <option value=\"2\">Full learning set</option>\n </select></label>--> \n </div>\n </div> <!-- End of row-->\n <div class=\"row\">\n <p class=\"selection_descriptors\"><b>Descriptors:</b></p>\n <div class=\"row\"> \n <label class=\"col-xs-4 col-md-4 col-lg-3\"> \n <span title=\"The structural descriptor attempts to capture the geometric similarity of two molecules as a single number. The structural descriptor does not describe excitation energies well, but structurally similar molecules are likely to have similar excitation energies.\"><i>Structural descriptor:&nbsp;</i> </span> <select id=\"s_desc\" onchange=\"check_s_descriptor(event, value)\">\n <option value=\"1\">Sorted Coulomb matrix</option>\n <option value=\"2\">Diagonalized Coulomb matrix</option>\n <option value=\"3\">None</option>\n </select></label>\n <label class=\"col-xs-4 col-md-4 col-lg-3\" title=\"σ value\"> \n <span title=\"Distances between Coulomb matrices are divided by this number. Distances are on the order of 1000 (in the units of the internal representation); hence reasonable normalizations are on the order of 1000. When using two descriptors at the same time, they should be normalized to similar values to achieve a good combination.\"><i>Structural normalization (σ):&nbsp;</i></span>\n <input id=\"s_sigma\" value=\"1000\" min=\"1\" onkeypress=\"validate(event, value, id)\"> </label>\n </div>\n <div class=\"row\"> \n <label class=\"col-xs-4 col-md-4 col-lg-3\">\n <span title=\"The HOMO-LUMO gap is the energy difference between highest occupied state and lowest unoccupied state in the ground-state calculation. This is a reasonable approximation of the excitation energy, and hence a good descriptor for predicting excitation energies. However it is only a single number and therefore cannot distinguish well between two different molecules that have (close to) the same HOMO-LUMO gap without the help of another descriptor.\"><i>Electronic descriptor:&nbsp;</i></span>\n <i id=\"e_ctrl\"><input value=\"0\" id=\"e_desc\" onclick=\"hide_e_sigma(id);\" type=\"checkbox\"> <label>HOMO-LUMO gap</label></i></label>\n <!--\n <i>Electronic Descriptor:&nbsp;</i> <select id=\"e_desc\" onchange='check_e_descriptor(event, value)'>\n <option value=\"1\">HOMO-LUMO gap</option>\n <option value=\"2\">Density of State</option>\n <option value=\"3\">None</option>\n </select>-->\n <label class=\"col-xs-4 col-md-4 col-lg-3\" title=\"σ value\"> \n <span title=\"Distances between electronic descriptors are divided by this number. Distances are typically between 1 to 10 eV; hence a reasonable normalization is on the order of 1 to 10.\"> <i>Electronic normalization (σ):&nbsp;</i> </span>\n <input id=\"e_sigma\" value=\"1\" min=\"1\" onkeypress=\"validate(event, value, id)\" disabled=\"\"> </label>\n </div> \n </div> <!-- End of row -->\n <div class=\"row\">\n <p class=\"ml_selection_descriptors\"><b>Feature to predict:</b></p>\n <div class=\"row\">\n <label class=\"col-xs-4 col-md-4 col-lg-3\"> \n <i>Excitation energy (eV)</i>\n <!--<select id=\"proper\">\n <option value=\"1\">Excitation energy (eV)</option>\n <option value=\"2\">Oscillations Strength</option>\n </select>--></label> \n <!--<input id=\"range\" value=\"1\" display=\"none\"> --> \n <!-- <i>How many values:&nbsp;</i><input id=\"range\" value=\"1\" min=\"1\" max=\"2\" onkeypress='validate(event, value, id)' > -->\n </div>\n </div> <!-- End of row -->\n </form>\n</div>"
},
"selectedType": "BeakerDisplay",
"elapsedTime": 0,
"height": 281
},
"evaluatorReader": true,
"tags": "settings",
"isError": false,
"lineCount": 185
},
{
"id": "main_entry_point",
"type": "code",
"evaluator": "IPython",
"input": {
"body": [
"import ml_chemical_space as ml",
"reload(ml)",
"import ml_chemical_space as ml",
"# print beaker.param",
"errs, ref_values, prediction , outfile_path = ml.beaker_entry(beaker.param)",
"# print errs, ref_values, prediction , outfile_path",
"beaker.errs = np.reshape(errs,(len(errs)))",
"beaker.ref_values = np.reshape(ref_values,(len(errs)))",
"beaker.prediction = np.reshape(prediction,(len(errs)))",
"outfile = []",
"with open(outfile_path) as fd:",
" first = True",
" for line in fd:",
" if first:",
" first = False",
" continue",
" outfile.append(line.split('|'))",
"beaker.outfile_data = outfile"
],
"hidden": true
},
"output": {
"state": {},
"selectedType": "Results",
"pluginName": "IPython",
"shellId": "C074E3DBE84B47A7807B5EAD0AE3C347",
"elapsedTime": 5069,
"height": 33,
"dataresult": [
"java.lang.NullPointerException: Cannot invoke method getAt() on null object<br/>",
"\tat script149026592776170181916.run(script149026592776170181916.groovy:18)",
"\tat com.twosigma.beaker.groovy.utils.GroovyEvaluator$workerThread$MyRunnable.run(GroovyEvaluator.java:382)",
""
]
},
"evaluatorReader": true,
"lineCount": 18,
"isError": false,
"tags": "action_cell"
},
{
"id": "graph_cell",
"type": "code",
"evaluator": "Groovy",
"input": {
"body": [
"",
"try",
"{",
" def ref_pred_plot = new Plot( xLabel: \"References values (R)\", yLabel: \"Predicted values (P)\");",
" ",
" def out_put_label = \"\";",
" if(beaker.param[\"proper\"] == 1)",
" {",
" out_put_label = \"Excitation energy\";",
" }",
" if(beaker.param[\"proper\"] == 2)",
" {",