Embedding.bkr 58.9 KB
Newer Older
ankit kariryaa's avatar
ankit kariryaa committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
{
    "beaker": "2",
    "evaluators": [
        {
            "name": "HTML",
            "plugin": "HTML",
            "view": {
                "cm": {
                    "mode": "htmlmixed"
                }
            }
        },
        {
            "name": "TeX",
            "plugin": "TeX",
            "view": {
                "cm": {
                    "mode": "stex"
                }
            }
        },
        {
            "name": "IPython",
            "plugin": "IPython",
            "imports": "",
            "supplementalClassPath": "",
            "view": {
                "cm": {
                    "mode": "python"
                }
            },
            "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"
        },
        {
            "name": "JavaScript",
            "plugin": "JavaScript",
            "jsSetting2": "",
            "jsSetting1": "",
            "view": {
                "cm": {
                    "mode": "javascript",
                    "background": "#FFE0F0"
                }
            },
            "languageVersion": "ES2015"
        }
    ],
    "cells": [
        {
            "id": "markdownRBGLQA",
            "type": "markdown",
            "body": [
                "<p style=\"color: #20335d;;font-weight: 900; font-size: 22pt;\">  NOMAD analytics toolkit</p>",
                "<label style=\"text-align: center; color: #20335d; font-weight: 900; font-size: 18pt;\">Tutorial example on Crystal prediction II:</label> <label style=\"color: #20335d;font-weight: 900; font-size: 15pt;\"> Visualizing material-similarity for the case of octet-binary zincblende-vs.-rocksalt semiconductors</label>",
                " </p>",
                " <p style=\"font-size: 15px;\"> developed by Angelo Ziletti, Ankit Kariryaa, Fawzi Mohamed, Luca Ghiringhelli, and Matthias Scheffler. [Last update September 13, 2016]</p>"
            ],
            "evaluatorReader": false
        },
        {
            "id": "codeubF2um",
            "type": "code",
            "evaluator": "HTML",
            "input": {
                "body": [
                    "<style type=\"text/css\">",
                    " .lasso_instructions{",
                    "    font-size: 15px;",
                    "  } ",
                    "</style>",
                    "<!-- Button trigger modal -->",
                    "<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#lasso-motivation-modal\">",
                    " Introduction and motivation",
                    "</button>",
                    "",
                    "<!-- Modal -->",
                    "<div class=\"modal fade\" id=\"lasso-motivation-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"lasso-motivation-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=\"lasso-motivation-modal-label\">Introduction and motivation</h4>",
                    "      </div>",
                    "      <div class=\"modal-body lasso_instructions\">",
                    "        <p> In this tutorial, we present a tool that produces two-dimensional structure maps for octet binary compounds, by starting from a high-dimensional set of <i>features</i> (coordinates) that identify each data point (material), based on free-atom data of the atomic species constituting the binary material. </p>",
                    "          ",
                    "        <p> The low-dimensional embedding methods (here, two-dimensional for the sake of visualization) are <i>unsupervised</i> machine-learning algorithms; so, in our example, the algorithm processes only the spatial arrangement of the points in the high-dimensional representation that is determined by the user. </p>",
                    "        ",
                    "        <p> In the linear method, <b>principal component analysis (<a href=\"https://en.wikipedia.org/wiki/Feature_scaling\" target=\"_blank\">PCA</a>)</b>, the direction (linear combination of the input coordinates) with the maximum variance is identified as the first principal component (PC). The direction perpendicular to the first PC with the largest variance is the second PC.",
                    "          The process can be iterated up to as many dimensions as the initial dimensionality of the data, but here we stop at the second dimension and give the amount of total variance recovered by the first two principal components. </p>",
                    "      <p> In the two popular non-linear method we chose, <b>multidimensional scaling (<a href=\"https://en.wikipedia.org/wiki/Multidimensional_scaling\" target=\"_blank\">MDS</a>) </b> tries to preserve the distances from the given high-dimensional to the two-dimensional representation, ",
                    "        and the <b>t-Distributed Stochastic Neighbor Embedding (<a href=\"https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding\" target=\"_blank\">t-SNE</a>) </b> tries to preserve the local shape of groups of neighboring points. Both methods use a notion of distance that in our example is the Euclidean norm, even if in principle it could be any proper norm. </p>",
                    "",
                    "        <p> In the results, we show the data points colored according to the difference in energy between the Rocksalt (RS) and Zincblende (ZB) crystal structures (both relaxed to their local minima) of the material they represent. The labeling and consequent coloring is independent of the embedding method used, therefore the labeling is an <i>a posteriori</i>",
                    "          check that the high-dimensional representation could contain information about the labeling itself. In practice, if the coloring identifies clearly distinct areas, then the two dimensional representation is a map for the prediction of the labels, so that a new data point of unknown labeling, that lands in the 2D map in a area of points with known labeling, is expected to belong to that same labeling. </p>",
                    "        ",
                    "<p>The merit of the embedding methods is to provide relatively inexpensive tools to visually test whether a given set of features contains information about an investigated property (label). For this reason, they are widely used as preliminary tools for discovering structures in the data. </p>",
                    "<p> The prediction of RS vs ZB structure from a simple descriptor has a notable history in materials science [1-7], where descriptors were designed by chemically/physically-inspired intuition. </p>",
                    "",
                    "        <p>References:</p>",
                    "        <ol>",
                    "          <li>J. A. van Vechten, Phys. Rev. 182, 891 (1969).</li>",
                    "          <li>J. C. Phillips, Rev. Mod. Phys. 42, 317 (1970).</li>",
                    "          <li>J. St. John and A.N. Bloch, Phys. Rev. Lett. 33, 1095 (1974).</li>",
                    "          <li>J. R. Chelikowsky and J. C. Phillips, Phys. Rev. B 17, 2453 (1978).</li>",
                    "          <li>A. Zunger, Phys. Rev. B 22, 5839 (1980).</li>",
                    "          <li>D. G. Pettifor, Solid State Commun. 51, 31 (1984).</li>",
                    "          <li>Y. Saad, D. Gao, T. Ngo, S. Bobbitt, J. R. Chelikowsky, and W. Andreoni, Phys. Rev. B 85, 104104 (2012).</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>"
                ],
                "hidden": true
            },
            "output": {
                "state": {},
                "result": {
                    "type": "BeakerDisplay",
                    "innertype": "Html",
                    "object": "<script>\nvar beaker = bkHelper.getBeakerObject().beakerObj;\n</script>\n<style type=\"text/css\">\n .lasso_instructions{\n    font-size: 15px;\n  } \n</style>\n<!-- Button trigger modal -->\n<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#lasso-motivation-modal\">\n Introduction and motivation\n</button>\n\n<!-- Modal -->\n<div style=\"display: none;\" class=\"modal fade\" id=\"lasso-motivation-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"lasso-motivation-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=\"lasso-motivation-modal-label\">Introduction and motivation</h4>\n      </div>\n      <div class=\"modal-body lasso_instructions\">\n        <p> In this tutorial, we present a tool that produces two-dimensional structure maps for octet binary compounds, by starting from a high-dimensional set of <i>features</i> (coordinates) that identify each data point (material), based on free-atom data of the atomic species constituting the binary material. </p>\n          \n        <p> The low-dimensional embedding methods (here, two-dimensional for the sake of visualization) are <i>unsupervised</i> machine-learning algorithms; so, in our example, the algorithm processes only the spatial arrangement of the points in the high-dimensional representation that is determined by the user. </p>\n        \n        <p> In the linear method, <b>principal component analysis (<a href=\"https://en.wikipedia.org/wiki/Feature_scaling\" target=\"_blank\">PCA</a>)</b>, the direction (linear combination of the input coordinates) with the maximum variance is identified as the first principal component (PC). The direction perpendicular to the first PC with the largest variance is the second PC.\n          The process can be iterated up to as many dimensions as the initial dimensionality of the data, but here we stop at the second dimension and give the amount of total variance recovered by the first two principal components. </p>\n      <p> In the two popular non-linear method we chose, <b>multidimensional scaling (<a href=\"https://en.wikipedia.org/wiki/Multidimensional_scaling\" target=\"_blank\">MDS</a>) </b> tries to preserve the distances from the given high-dimensional to the two-dimensional representation, \n        and the <b>t-Distributed Stochastic Neighbor Embedding (<a href=\"https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding\" target=\"_blank\">t-SNE</a>) </b> tries to preserve the local shape of groups of neighboring points. Both methods use a notion of distance that in our example is the Euclidean norm, even if in principle it could be any proper norm. </p>\n\n        <p> In the results, we show the data points colored according to the difference in energy between the Rocksalt (RS) and Zincblende (ZB) crystal structures (both relaxed to their local minima) of the material they represent. The labeling and consequent coloring is independent of the embedding method used, therefore the labeling is an <i>a posteriori</i>\n          check that the high-dimensional representation could contain information about the labeling itself. In practice, if the coloring identifies clearly distinct areas, then the two dimensional representation is a map for the prediction of the labels, so that a new data point of unknown labeling, that lands in the 2D map in a area of points with known labeling, is expected to belong to that same labeling. </p>\n        \n<p>The merit of the embedding methods is to provide relatively inexpensive tools to visually test whether a given set of features contains information about an investigated property (label). For this reason, they are widely used as preliminary tools for discovering structures in the data. </p>\n<p> The prediction of RS vs ZB structure from a simple descriptor has a notable history in materials science [1-7], where descriptors were designed by chemically/physically-inspired intuition. </p>\n\n        <p>References:</p>\n        <ol>\n          <li>J. A. van Vechten, Phys. Rev. 182, 891 (1969).</li>\n          <li>J. C. Phillips, Rev. Mod. Phys. 42, 317 (1970).</li>\n          <li>J. St. John and A.N. Bloch, Phys. Rev. Lett. 33, 1095 (1974).</li>\n          <li>J. R. Chelikowsky and J. C. Phillips, Phys. Rev. B 17, 2453 (1978).</li>\n          <li>A. Zunger, Phys. Rev. B 22, 5839 (1980).</li>\n          <li>D. G. Pettifor, Solid State Commun. 51, 31 (1984).</li>\n          <li>Y. Saad, D. Gao, T. Ngo, S. Bobbitt, J. R. Chelikowsky, and W. Andreoni, Phys. Rev. B 85, 104104 (2012).</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>"
                },
                "selectedType": "BeakerDisplay",
                "elapsedTime": 0,
                "height": 72
            },
            "evaluatorReader": true,
            "lineCount": 52
        },
        {
            "id": "markdowntnAHej",
            "type": "markdown",
            "body": [
                "<p style=\"font-size: 15px;\"> <b> Machine learning methods: </b> <br>",
                "Multi- to 2-dimensional embedding, i.e. Principal Component Analysis (PCA), and a selection of non-linear embedding methods."
            ],
            "evaluatorReader": false
        },
        {
            "id": "codeZ2DSp3",
            "type": "code",
            "evaluator": "HTML",
            "input": {
                "body": [
                    "<style type=\"text/css\">",
                    " .lasso_instructions{",
                    "    font-size: 15px;",
                    "  } ",
                    "</style>",
                    "<!-- Button trigger modal -->",
                    "<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#lasso-instructions-modal\">",
                    " Instructions",
                    "</button>",
                    "",
                    "<!-- Modal -->",
                    "<div class=\"modal fade\" id=\"lasso-instructions-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"lasso-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=\"lasso-instructions-modal-label\">Instructions</h4>",
                    "      </div>",
                    "      <div class=\"modal-body lasso_instructions\">",
                    "<p> In this example, you can run the linear low-dimensional embedding method, <b>principal component analysis (<a href=\"https://en.wikipedia.org/wiki/Feature_scaling\" target=\"_blank\">PCA</a>)</b> and two selected non-linear methods, <b>multidimensional scaling (<a href=\"https://en.wikipedia.org/wiki/Multidimensional_scaling\" target=\"_blank\">MDS</a>) </b>",
                    "        and <b>t-Distributed Stochastic Neighbor Embedding (<a href=\"https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding\" target=\"_blank\">t-SNE</a>) </b>. </p>",
                    "      ",
                    "<p> The input features, that can be selected in the checklist below (any number of features larger than 2 is allowed), represent chemical elements constituting binary octet materials, that crystallize typically into rocksalt or zincblende crystal structure. </p>",
                    "<p> The next step is to select the embedding method (exclusive selection) and whether each feature is pre-processed by dividing it by the standard deviation of the whole population (all data points). Note that the feature are anyhow centered around their mean value as pre-processing.</p>      ",
                    "        ",
                    "<p> After selecting the list of features, the method, and the normalization criterion, click <b>“Run two-dimensional embedding”</b> to apply the selected method. </p>",
                    "  ",
                    "<p> During and at the end of the run, a brief summary is printed out below the <b>“Run two-dimensional embedding”</b> button. After the end of the run, click on <b>“View interactive 2D scatter plot”</b> (it is unlocked  at the end of the run) to open a new tab where the two-dimensional map is shown as an interactive scatter plot. </p>",
                    "<p> Note1: the plot stays active also after another run is performed, so that the output of several sets of input parameters can be compared in the viewer tabs.</p>",
                    "        <p> Note2: with the following selection of features:<br> ",
                    "        ['rs(A)', 'rs(B)', 'rp(A)', 'rp(B)', 'Es(A)/sqrt(Zval(A))', 'Es(B)/sqrt(Zval(B))', 'Ep(A)/sqrt(Zval(A))', 'Ep(B)/sqrt(Zval(B))']<br>",
                    "        and PCA method, one obtains a result similar to Fig. 4 in Y. Saad, D. Gao, T. Ngo, S. Bobbitt, J. R. Chelikowsky, and W. Andreoni, Phys. Rev. B 85, 104104 (2012).",
                    "          The plot may appear mirrored because the sign of the principal component is immaterial. Besides, the input data are slightly different (here, everything is calculated at the converged LDA level).",
                    "        </p>",
                    "      </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>"
                ],
                "hidden": true
            },
            "output": {
                "state": {},
                "result": {
                    "type": "BeakerDisplay",
                    "innertype": "Html",
                    "object": "<script>\nvar beaker = bkHelper.getBeakerObject().beakerObj;\n</script>\n<style type=\"text/css\">\n .lasso_instructions{\n    font-size: 15px;\n  } \n</style>\n<!-- Button trigger modal -->\n<button type=\"button\" class=\"btn btn-default\" data-toggle=\"modal\" data-target=\"#lasso-instructions-modal\">\n Instructions\n</button>\n\n<!-- Modal -->\n<div class=\"modal fade\" id=\"lasso-instructions-modal\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"lasso-instructions-modal-label\" style=\"display: none;\">\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=\"lasso-instructions-modal-label\">Instructions</h4>\n      </div>\n      <div class=\"modal-body lasso_instructions\">\n<p> In this example, you can run the linear low-dimensional embedding method, <b>principal component analysis (<a href=\"https://en.wikipedia.org/wiki/Feature_scaling\" target=\"_blank\">PCA</a>)</b> and two selected non-linear methods, <b>multidimensional scaling (<a href=\"https://en.wikipedia.org/wiki/Multidimensional_scaling\" target=\"_blank\">MDS</a>) </b>\n        and <b>t-Distributed Stochastic Neighbor Embedding (<a href=\"https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding\" target=\"_blank\">t-SNE</a>) </b>. </p>\n      \n<p> The input features, that can be selected in the checklist below (any number of features larger than 2 is allowed), represent chemical elements constituting binary octet materials, that crystallize typically into rocksalt or zincblende crystal structure. </p>\n<p> The next step is to select the embedding method (exclusive selection) and whether each feature is pre-processed by dividing it by the standard deviation of the whole population (all data points). Note that the feature are anyhow centered around their mean value as pre-processing.</p>      \n        \n<p> After selecting the list of features, the method, and the normalization criterion, click <b>“Run two-dimensional embedding”</b> to apply the selected method. </p>\n  \n<p> During and at the end of the run, a brief summary is printed out below the <b>“Run two-dimensional embedding”</b> button. After the end of the run, click on <b>“View interactive 2D scatter plot”</b> (it is unlocked  at the end of the run) to open a new tab where the two-dimensional map is shown as an interactive scatter plot. </p>\n<p> Note1: the plot stays active also after another run is performed, so that the output of several sets of input parameters can be compared in the viewer tabs.</p>\n        <p> Note2: with the following selection of features:<br> \n        ['rs(A)', 'rs(B)', 'rp(A)', 'rp(B)', 'Es(A)/sqrt(Zval(A))', 'Es(B)/sqrt(Zval(B))', 'Ep(A)/sqrt(Zval(A))', 'Ep(B)/sqrt(Zval(B))']<br>\n        and PCA method, one obtains a result similar to Fig. 4 in Y. Saad, D. Gao, T. Ngo, S. Bobbitt, J. R. Chelikowsky, and W. Andreoni, Phys. Rev. B 85, 104104 (2012).\n          The plot may appear mirrored because the sign of the principal component is immaterial. Besides, the input data are slightly different (here, everything is calculated at the converged LDA level).\n        </p>\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>"
                },
                "selectedType": "BeakerDisplay",
                "elapsedTime": 0,
                "height": 72
            },
            "evaluatorReader": true,
            "lineCount": 42
        },
        {
            "id": "lasso_gui",
            "type": "code",
            "evaluator": "HTML",
            "input": {
                "body": [
                    "<script>",
                    "var run_lasso = function() {",
                    "  $(\"#lasso_result_button\").removeClass(\"active\").addClass(\"disabled\");",
                    "  getFeatures();",
                    "  getEmbedMethod();",
                    "  getStandardize();",
                    "  beaker.evaluate(\"lasso_cell\"); // evaluate cells with tag \"lasso_cell\"",
                    " // view_result()",
                    "};",
                    "var reset_lasso = function(){",
                    "  beaker.evaluate(\"lasso_gui\");",
                    "};",
                    "var getFeatures = function() {",
                    "    beaker.selected_feature_list = [];",
                    "    $('#lasso_features_select input:checkbox').each(function () {",
                    "        if(this.checked )",
                    "          beaker.selected_feature_list.push(this.value);",
                    "    });",
                    "};",
                    "",
                    "  ",
                    "var getEmbedMethod = function() {",
                    "   beaker.embed_method = \"pca\";",
                    "   $('#embed_method_selector input:radio').each(function () {",
                    "     if(this.checked )",
                    "       beaker.embed_method = this.value;",
                    "   });",
                    "};",
                    "  ",
                    "var getStandardize = function() {",
                    "   beaker.standardize = \"yes\";",
                    "   $('#standardize input:radio').each(function () {",
                    "     if(this.checked )",
                    "       beaker.standardize = this.value;",
                    "   });",
                    "};",
                    "  ",
                    "beaker.view_result = function(result_link) {",
                    "//   beaker.evaluate(\"lasso_viewer_result\").then(function(x) {",
                    "    $(\"#lasso_result_button\").attr(\"href\", result_link);",
                    "//   }); ",
                    "  $(\"#lasso_result_button\").removeClass(\"disabled\").addClass(\"active\");",
                    "}",
                    "</script>",
                    "<style type=\"text/css\">",
                    "  label {",
                    "    font-size: 18px;",
                    "  }",
                    " .lasso_control{",
                    "    font-size: 18px;",
                    "  }   ",
                    ".lasso_form_group input {",
                    "    width: 15px;",
                    "    height: 15px;",
                    "    padding: 0;",
                    "    margin:0;",
                    "    padding-right:5px; ",
                    "    vertical-align: bottom;",
                    "    top: -1px;",
                    "} ",
                    " .lasso_selection_description{",
                    "        padding: 10px 15px;",
                    "  }",
                    "</style>",
                    "<div class=\"lasso_control\">",
                    "  <div class=\"row\">",
                    "    <p class=\"lasso_selection_description\"><b>Primary features </b>",
                    "  (all energies are in eV and all distances in &#x212b;, hover the mouse pointer over the feature names to see a full description):</p>",
                    "    <form id=\"lasso_features_select\">",
                    "      <div class=\"lasso_form_group\">",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\" title=\"Ionization potential of atom A\"> <input type=\"checkbox\" value=\"IP(A)\" > <i>IP</i> <sup>A</sup></label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"IP(B)\"  > <span title=\"Ionization potential of atom B\"><i>IP</i> <sup>B</sup></span></label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"EA(A)\"  > <span title=\"Electron affinity of atom A\"> <i>EA</i> <sup>A</sup></span></label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"EA(B)\"  > <span title=\"Electron affinity of atom B\"> <i>EA</i> <sup>B</sup></span></label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HOMO(A)\"  > <span title=\"Energy of highest occupied molecular orbital for atom A\"><i>E</i> <sup>A</sup><sub>HOMO</sub></span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HOMO(B)\"  > <span title=\"Energy of highest occupied molecular orbital for atom B\"> <i>E</i> <sup>B</sup><sub>HOMO</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"LUMO(A)\"  > <span title=\"Energy of lowest unoccupied molecular orbital for atom A\"> <i>E</i> <sup>A</sup><sub>LUMO</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"LUMO(B)\"  > <span title=\"Energy of lowest unoccupied molecular orbital for atom B\"> <i>E</i> <sup>B</sup><sub>LUMO</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rs(A)\" CHECKED > <span title=\"Radius at which the radial probability density of the valence s orbital is maximum for atom A\"> <i>r</i><sub>s</sub><sup>A</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rs(B)\" CHECKED > <span title=\"Radius at which the radial probability density of the valence s orbital is maximum for atom B\"> <i>r</i><sub>s</sub><sup>B</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rp(A)\" CHECKED > <span title=\"Radius at which the radial probability density of the valence p orbital is maximum for atom A\"> <i>r</i><sub>p</sub><sup>A</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rp(B)\" CHECKED > <span title=\"Radius at which the radial probability density of the valence p orbital is maximum for atom B\"> <i>r</i><sub>p</sub><sup>B</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rd(A)\" CHECKED > <span title=\"Radius at which the radial probability density of the valence d orbital is maximum for atom A\"> <i>r</i><sub>d</sub><sup>A</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rd(B)\" CHECKED > <span title=\"Radius at which the radial probability density of the valence d orbital is maximum for atom B\"> <i>r</i><sub>d</sub><sup>B</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Es(A)/sqrt(Zval(A))\"  > ",
                    "         <span title=\"Energy of the valence s orbital(s) divided by the square root of the number of valence electrons of atom A. [Phys. Rev. B 85, 104104 (2012)]\"> <i>E</i><sub>s</sub><sup>A</sup>/sqrt(<i>Z</i> <sup>A</sup><sub>val</sub>) </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Es(B)/sqrt(Zval(B))\"  > ",
                    "         <span title=\"Energy of the valence s orbital(s) divided by the square root of the number of valence electrons of atom B. [Phys. Rev. B 85, 104104 (2012)]\"> <i>E</i><sub>s</sub><sup>B</sup>/sqrt(<i>Z</i> <sup>B</sup><sub>val</sub>) </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ep(A)/sqrt(Zval(A))\"  > ",
                    "         <span title=\"Energy of the valence p orbital(s) divided by the square root of the number of valence electrons of atom A. [Phys. Rev. B 85, 104104 (2012)]\"> <i>E</i><sub>p</sub><sup>A</sup>/sqrt(<i>Z</i> <sup>A</sup><sub>val</sub>) </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ep(B)/sqrt(Zval(B))\"  > ",
                    "         <span title=\"Energy of the valence p orbital(s) divided by the square root of the number of valence electrons of atom B. [Phys. Rev. B 85, 104104 (2012)]\"> <i>E</i><sub>p</sub><sup>B</sup>/sqrt(<i>Z</i> <sup>B</sup><sub>val</sub>) </span> </label>",
                    "        ",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"d_AA\" > <span title=\"Bond length of atomA-atomA dimer\"> <i>d</i><sup>AA</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"d_BB\"> <span title=\"Bond length of atomB-atomB dimer\"> <i>d</i><sup>BB</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HL_gap_AA\" > <span title=\"HOMO-LUMO gap of atomA-atomA dimer\"> Δ<i>E</i> <sup>AA</sup><sub>HL</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HL_gap_BB\" > <span title=\"HOMO-LUMO gap of atomB-atomB dimer\"> Δ<i>E</i> <sup>BB</sup><sub>HL</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ebinding_AA\" > <span title=\"Binding energy of atomA-atomA dimer\"> <i>E</i> <sup>AA</sup><sub>b</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ebinding_BB\" > <span title=\"Binding energy of atomB-atomB dimer\"> <i>E</i> <sup>BB</sup><sub>b</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Z(A)\" > <span title=\"Atomic number of atom A\"> <i>Z</i> <sup>A</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Z(B)\" > <span title=\"Atomic number of atom B\"> <i>Z</i> <sup>B</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"val(A)\" > <span title=\"Number of valence electrons of atom A\"> <i>Z</i> <sup>A</sup><sub>val</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"val(B)\" > <span title=\"Number of valence electrons of atom B\"> <i>Z</i> <sup>B</sup><sub>val</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"period(A)\" > <span title=\"Period (in the periodic table) of atom A\"> <i>n</i> <sup>A</sup><sub>period</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"period(B)\" > <span title=\"Period (in the periodic table) of atom B\"> <i>n</i> <sup>B</sup><sub>period</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"r_sigma\" > <span title=\"John-Bloch's indicator1: |rp(A) + rs(A) - rp(B) -rs(B)| ",
                    "           [Phys. Rev. Lett. 33. 1095 (1974)]\"> r<sub>σ</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"r_pi\" > <span title=\"John-Bloch's indicator2: |rp(A) - rs(A)| +| rp(B) -rs(B)| ",
                    "          [Phys. Rev. Lett. 33. 1095 (1974)]\">  r<sub>π</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"d_AB\" > <span title=\"Bond length of atomA-atomB dimer\"> <i>d</i><sup>AB</sup>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HL_gap_AB\" > <span title=\"HOMO-LUMO gap of atomA-atomB dimer\"> Δ<i>E</i> <sup>AB</sup><sub>HL</sub>  </span> </label>",
                    "         <label class =\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ebinding_AB\" > <span title=\"Binding energy of atomA-atomB dimer\"> <i>E</i> <sup>AB</sup><sub>b</sub>  </span> </label>",
                    "      </div>",
                    "    </form>",
                    "  </div>  <!-- End of row-->",
                    "  <br>",
                    "  <div class=\"row\"> <!-- Start of second row-->",
                    "      <div class=\"lasso_form_group\">",
                    "        <p class=\"lasso_selection_description\"><b>Embedding methods:</b> </p>",
                    "        <div id='embed_method_selector'>",
                    "          <label class =\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptions\" id=\"inlineRadio1\" value=\"pca\" CHECKED>  Principal Compenent Analysis (PCA) [<a href=\"https://en.wikipedia.org/wiki/Principal_component_analysis\" target=\"_blank\">more info</a>]</label>",
                    "          <label class =\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptions\" id=\"inlineRadio2\" value=\"mds\"> Multidimensional scaling (MDS) [<a href=\"https://en.wikipedia.org/wiki/Multidimensional_scaling\" target=\"_blank\">more info</a>]</label>",
                    "          <label class =\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptions\" id=\"inlineRadio3\" value=\"tsne_pca\"> t-Distributed Stochastic Neighbor Embedding (t-SNE) [<a href=\"https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding\" target=\"_blank\">more info</a>]</label>",
                    "        </div>         ",
                    "      </div>",
                    "  </div><!-- End of row-->  ",
                    "    <div class=\"row\"> <!-- Start of second row-->",
                    "      <div class=\"lasso_form_group\">",
                    "        <p class=\"lasso_selection_description\"><b>Scale data to unit-variance:</b>",
                    "        (data are centered around the mean in any case) [<a href=\"https://en.wikipedia.org/wiki/Feature_scaling\" target=\"_blank\">more info</a>]</p>",
                    "        <div id='standardize'>",
                    "          <label class =\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptionsStandardize\" id=\"inlineRadio4\" value=\"True\" CHECKED> yes </label>",
                    "          <label class =\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptionsStandardize\" id=\"inlineRadio5\" value=\"False\"> no </label>",
                    "        </div>         ",
                    "      </div>",
                    "  </div><!-- End of row-->  ",
                    "  <br>",
                    "",
                    "<!-- <span title=''> <img src=\"http://images.clipartpanda.com/question-purzen_Icon_with_question_mark_Vector_Clipart.png\" style=\"height: 30px; width: 30px;\"> </span> -->",
                    "  <button class=\"btn btn-default\" onclick='run_lasso()'>RUN TWO-DIMENSIONAL EMBEDDING</button>",
                    "  <button class=\"btn btn-default\" onclick='reset_lasso()'>RESET</button>",
                    "  <label title=\"This button becomes active when the run is finished. By clicking it, an interactive structural-similarity plot will be opened\"> <a href=\"#\" target=\"_blank\" class=\"btn btn-primary disabled\" id=\"lasso_result_button\" >View interactive 2D scatter plot</a> </label>",
                    "</div> <!-- End of lasso_control -->",
                    ""
                ],
                "hidden": true
            },
            "output": {
                "selectedType": "BeakerDisplay",
                "outputArrived": true,
                "elapsedTime": 0,
                "state": {},
                "result": {
                    "type": "BeakerDisplay",
                    "innertype": "Html",
                    "object": "<script>\nvar beaker = bkHelper.getBeakerObject().beakerObj;\n</script>\n<script>\nvar run_lasso = function() {\n  $(\"#lasso_result_button\").removeClass(\"active\").addClass(\"disabled\");\n  getFeatures();\n  getEmbedMethod();\n  getStandardize();\n  beaker.evaluate(\"lasso_cell\"); // evaluate cells with tag \"lasso_cell\"\n // view_result()\n};\nvar reset_lasso = function(){\n  beaker.evaluate(\"lasso_gui\");\n};\nvar getFeatures = function() {\n    beaker.selected_feature_list = [];\n    $('#lasso_features_select input:checkbox').each(function () {\n        if(this.checked )\n          beaker.selected_feature_list.push(this.value);\n    });\n};\n\n  \nvar getEmbedMethod = function() {\n   beaker.embed_method = \"pca\";\n   $('#embed_method_selector input:radio').each(function () {\n     if(this.checked )\n       beaker.embed_method = this.value;\n   });\n};\n  \nvar getStandardize = function() {\n   beaker.standardize = \"yes\";\n   $('#standardize input:radio').each(function () {\n     if(this.checked )\n       beaker.standardize = this.value;\n   });\n};\n  \nbeaker.view_result = function(result_link) {\n//   beaker.evaluate(\"lasso_viewer_result\").then(function(x) {\n    $(\"#lasso_result_button\").attr(\"href\", result_link);\n//   }); \n  $(\"#lasso_result_button\").removeClass(\"disabled\").addClass(\"active\");\n}\n</script>\n<style type=\"text/css\">\n  label {\n    font-size: 18px;\n  }\n .lasso_control{\n    font-size: 18px;\n  }   \n.lasso_form_group input {\n    width: 15px;\n    height: 15px;\n    padding: 0;\n    margin:0;\n    padding-right:5px; \n    vertical-align: bottom;\n    top: -1px;\n} \n .lasso_selection_description{\n        padding: 10px 15px;\n  }\n</style>\n<div class=\"lasso_control\">\n  <div class=\"row\">\n    <p class=\"lasso_selection_description\"><b>Primary features </b>\n  (all energies are in eV and all distances in Å, hover the mouse pointer over the feature names to see a full description):</p>\n    <form id=\"lasso_features_select\">\n      <div class=\"lasso_form_group\">\n         <label class=\"col-xs-4 col-md-4 col-lg-2\" title=\"Ionization potential of atom A\"> <input type=\"checkbox\" value=\"IP(A)\"> <i>IP</i> <sup>A</sup></label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"IP(B)\"> <span title=\"Ionization potential of atom B\"><i>IP</i> <sup>B</sup></span></label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"EA(A)\"> <span title=\"Electron affinity of atom A\"> <i>EA</i> <sup>A</sup></span></label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"EA(B)\"> <span title=\"Electron affinity of atom B\"> <i>EA</i> <sup>B</sup></span></label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HOMO(A)\"> <span title=\"Energy of highest occupied molecular orbital for atom A\"><i>E</i> <sup>A</sup><sub>HOMO</sub></span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HOMO(B)\"> <span title=\"Energy of highest occupied molecular orbital for atom B\"> <i>E</i> <sup>B</sup><sub>HOMO</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"LUMO(A)\"> <span title=\"Energy of lowest unoccupied molecular orbital for atom A\"> <i>E</i> <sup>A</sup><sub>LUMO</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"LUMO(B)\"> <span title=\"Energy of lowest unoccupied molecular orbital for atom B\"> <i>E</i> <sup>B</sup><sub>LUMO</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rs(A)\" checked=\"\"> <span title=\"Radius at which the radial probability density of the valence s orbital is maximum for atom A\"> <i>r</i><sub>s</sub><sup>A</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rs(B)\" checked=\"\"> <span title=\"Radius at which the radial probability density of the valence s orbital is maximum for atom B\"> <i>r</i><sub>s</sub><sup>B</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rp(A)\" checked=\"\"> <span title=\"Radius at which the radial probability density of the valence p orbital is maximum for atom A\"> <i>r</i><sub>p</sub><sup>A</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rp(B)\" checked=\"\"> <span title=\"Radius at which the radial probability density of the valence p orbital is maximum for atom B\"> <i>r</i><sub>p</sub><sup>B</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rd(A)\" checked=\"\"> <span title=\"Radius at which the radial probability density of the valence d orbital is maximum for atom A\"> <i>r</i><sub>d</sub><sup>A</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"rd(B)\" checked=\"\"> <span title=\"Radius at which the radial probability density of the valence d orbital is maximum for atom B\"> <i>r</i><sub>d</sub><sup>B</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Es(A)/sqrt(Zval(A))\"> \n         <span title=\"Energy of the valence s orbital(s) divided by the square root of the number of valence electrons of atom A. [Phys. Rev. B 85, 104104 (2012)]\"> <i>E</i><sub>s</sub><sup>A</sup>/sqrt(<i>Z</i> <sup>A</sup><sub>val</sub>) </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Es(B)/sqrt(Zval(B))\"> \n         <span title=\"Energy of the valence s orbital(s) divided by the square root of the number of valence electrons of atom B. [Phys. Rev. B 85, 104104 (2012)]\"> <i>E</i><sub>s</sub><sup>B</sup>/sqrt(<i>Z</i> <sup>B</sup><sub>val</sub>) </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ep(A)/sqrt(Zval(A))\"> \n         <span title=\"Energy of the valence p orbital(s) divided by the square root of the number of valence electrons of atom A. [Phys. Rev. B 85, 104104 (2012)]\"> <i>E</i><sub>p</sub><sup>A</sup>/sqrt(<i>Z</i> <sup>A</sup><sub>val</sub>) </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ep(B)/sqrt(Zval(B))\"> \n         <span title=\"Energy of the valence p orbital(s) divided by the square root of the number of valence electrons of atom B. [Phys. Rev. B 85, 104104 (2012)]\"> <i>E</i><sub>p</sub><sup>B</sup>/sqrt(<i>Z</i> <sup>B</sup><sub>val</sub>) </span> </label>\n        \n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"d_AA\"> <span title=\"Bond length of atomA-atomA dimer\"> <i>d</i><sup>AA</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"d_BB\"> <span title=\"Bond length of atomB-atomB dimer\"> <i>d</i><sup>BB</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HL_gap_AA\"> <span title=\"HOMO-LUMO gap of atomA-atomA dimer\"> Δ<i>E</i> <sup>AA</sup><sub>HL</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HL_gap_BB\"> <span title=\"HOMO-LUMO gap of atomB-atomB dimer\"> Δ<i>E</i> <sup>BB</sup><sub>HL</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ebinding_AA\"> <span title=\"Binding energy of atomA-atomA dimer\"> <i>E</i> <sup>AA</sup><sub>b</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ebinding_BB\"> <span title=\"Binding energy of atomB-atomB dimer\"> <i>E</i> <sup>BB</sup><sub>b</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Z(A)\"> <span title=\"Atomic number of atom A\"> <i>Z</i> <sup>A</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Z(B)\"> <span title=\"Atomic number of atom B\"> <i>Z</i> <sup>B</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"val(A)\"> <span title=\"Number of valence electrons of atom A\"> <i>Z</i> <sup>A</sup><sub>val</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"val(B)\"> <span title=\"Number of valence electrons of atom B\"> <i>Z</i> <sup>B</sup><sub>val</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"period(A)\"> <span title=\"Period (in the periodic table) of atom A\"> <i>n</i> <sup>A</sup><sub>period</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"period(B)\"> <span title=\"Period (in the periodic table) of atom B\"> <i>n</i> <sup>B</sup><sub>period</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"r_sigma\"> <span title=\"John-Bloch's indicator1: |rp(A) + rs(A) - rp(B) -rs(B)| \n           [Phys. Rev. Lett. 33. 1095 (1974)]\"> r<sub>σ</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"r_pi\"> <span title=\"John-Bloch's indicator2: |rp(A) - rs(A)| +| rp(B) -rs(B)| \n          [Phys. Rev. Lett. 33. 1095 (1974)]\">  r<sub>π</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"d_AB\"> <span title=\"Bond length of atomA-atomB dimer\"> <i>d</i><sup>AB</sup>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"HL_gap_AB\"> <span title=\"HOMO-LUMO gap of atomA-atomB dimer\"> Δ<i>E</i> <sup>AB</sup><sub>HL</sub>  </span> </label>\n         <label class=\"col-xs-4 col-md-4 col-lg-2\"> <input type=\"checkbox\" value=\"Ebinding_AB\"> <span title=\"Binding energy of atomA-atomB dimer\"> <i>E</i> <sup>AB</sup><sub>b</sub>  </span> </label>\n      </div>\n    </form>\n  </div>  <!-- End of row-->\n  <br>\n  <div class=\"row\"> <!-- Start of second row-->\n      <div class=\"lasso_form_group\">\n        <p class=\"lasso_selection_description\"><b>Embedding methods:</b> </p>\n        <div id=\"embed_method_selector\">\n          <label class=\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptions\" id=\"inlineRadio1\" value=\"pca\" checked=\"\">  Principal Compenent Analysis (PCA) [<a href=\"https://en.wikipedia.org/wiki/Principal_component_analysis\" target=\"_blank\">more info</a>]</label>\n          <label class=\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptions\" id=\"inlineRadio2\" value=\"mds\"> Multidimensional scaling (MDS) [<a href=\"https://en.wikipedia.org/wiki/Multidimensional_scaling\" target=\"_blank\">more info</a>]</label>\n          <label class=\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptions\" id=\"inlineRadio3\" value=\"tsne_pca\"> t-Distributed Stochastic Neighbor Embedding (t-SNE) [<a href=\"https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding\" target=\"_blank\">more info</a>]</label>\n        </div>         \n      </div>\n  </div><!-- End of row-->  \n    <div class=\"row\"> <!-- Start of second row-->\n      <div class=\"lasso_form_group\">\n        <p class=\"lasso_selection_description\"><b>Scale data to unit-variance:</b>\n        (data are centered around the mean in any case) [<a href=\"https://en.wikipedia.org/wiki/Feature_scaling\" target=\"_blank\">more info</a>]</p>\n        <div id=\"standardize\">\n          <label class=\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptionsStandardize\" id=\"inlineRadio4\" value=\"True\" checked=\"\"> yes </label>\n          <label class=\"col-xs-4 col-md-4 col-lg-4\"><input type=\"radio\" name=\"inlineRadioOptionsStandardize\" id=\"inlineRadio5\" value=\"False\"> no </label>\n        </div>         \n      </div>\n  </div><!-- End of row-->  \n  <br>\n\n<!-- <span title=''> <img src=\"http://images.clipartpanda.com/question-purzen_Icon_with_question_mark_Vector_Clipart.png\" style=\"height: 30px; width: 30px;\"> </span> -->\n  <button class=\"btn btn-default\" onclick=\"run_lasso()\">RUN TWO-DIMENSIONAL EMBEDDING</button>\n  <button class=\"btn btn-default\" onclick=\"reset_lasso()\">RESET</button>\n  <label title=\"This button becomes active when the run is finished. By clicking it, an interactive structural-similarity plot will be opened\"> <a href=\"#\" target=\"_blank\" class=\"btn btn-primary disabled\" id=\"lasso_result_button\">View interactive 2D scatter plot</a> </label>\n</div> <!-- End of lasso_control -->\n"
                },
                "height": 486
            },
            "evaluatorReader": true,
            "lineCount": 144
        },
        {
            "id": "code2uVtKX",
            "type": "code",
            "evaluator": "IPython",
            "input": {
                "body": [
                    "from IPython.core.display import HTML ",
                    "",
                    "# load packages",
                    "from nomad_sim.wrappers import get_json_list, calc_descriptor ",
                    "from nomad_sim.wrappers import calc_model, calc_embedding, plot",
                    "import hashlib",
                    "",
                    "# define paths",
                    "tmp_folder = '/home/beaker/.beaker/v1/web/tmp/'",
                    "control_file = '/home/beaker/.beaker/v1/web/tmp/control.json'",
                    "data_folder='/home/beaker/test/nomad_sim/data_zcrs'",
                    "lookup_file = '/home/beaker/.beaker/v1/web/tmp/lookup.dat'",
                    "atomic_data_file = '/home/beaker/test/nomad_sim/lasso_example/atom_info.csv'",
                    "binary_data_file = '/home/beaker/test/nomad_sim/lasso_example/dimer_info.csv'",
                    "",
                    "# get the json_list",
                    "json_list = get_json_list(method='folder', drop_duplicates=False, ",
                    "    data_folder=data_folder, tmp_folder=tmp_folder)",
                    "",
                    "calc_descriptor(desc_type='atomic_features', ",
                    "    selected_feature_list=beaker.selected_feature_list,",
                    "    atomic_data_file=atomic_data_file,",
                    "    binary_data_file=binary_data_file,",
                    "    json_list=json_list, tmp_folder=tmp_folder)"
                ],
                "hidden": true
            },
            "output": {
                "selectedType": "Results",
                "state": {},
                "pluginName": "IPython",
                "shellId": "585C142199134107831DB6C55C408637",
                "height": 103,
                "elapsedTime": 15058
            },
            "evaluatorReader": true,
            "lineCount": 24,
            "tags": "lasso_cell"
        },
        {
            "id": "codeeWTtU4",
            "type": "code",
            "evaluator": "IPython",
            "input": {
                "body": [
                    "embed_params = {'learning_rate': 20}",
                    "",
                    "calc_embedding(embed_method=beaker.embed_method, embed_params=embed_params,",
                    "              desc_type='atomic_features',",
                    "              lookup_file=lookup_file, tmp_folder=tmp_folder,",
                    "              standardize=beaker.standardize)",
                    ""
                ],
                "hidden": true
            },
            "output": {
                "state": {},
                "selectedType": "Results",
                "pluginName": "IPython",
                "shellId": "585C142199134107831DB6C55C408637",
                "height": 215,
                "elapsedTime": 455
            },
            "evaluatorReader": true,
            "lineCount": 7,
            "tags": "lasso_cell"
        },
        {
            "id": "lasso_viewer_result",
            "type": "code",
            "evaluator": "IPython",
            "input": {
                "body": [
                    "parameter_list = beaker.selected_feature_list",
                    "parameter_list.append(beaker.embed_method)",
                    "",
                    "name_html_page = hashlib.sha224(str(parameter_list)).hexdigest()[:16]",
                    "",
                    "json_list, frame_list, x_list, y_list, target_list = get_json_list(method='file', data_folder=data_folder,",
                    "    path_to_file=lookup_file, drop_duplicates=True, displace_duplicates=True, predicted_value=False)",
                    "beaker.viewer_result = name_html_page",
                    "",
                    "plot_result = plot(name=name_html_page, json_list=json_list, frames='list', frame_list=frame_list, ",
                    "    file_format='NOMAD', clustering_x_list=x_list, clustering_y_list=y_list, target_list=target_list,",
                    "    target_unit='eV', legend_title='Reference E(RS)-E(ZB)', target_name='E(RS)-E(ZB)',    ",
                    "    plot_title = 'Two-dimensional embedding',",
                    "    clustering_point_size=12, tmp_folder=tmp_folder, control_file=control_file)",
                    ""
                ],
                "hidden": true
            },
            "output": {
                "state": {},
                "selectedType": "Results",
                "pluginName": "IPython",
                "shellId": "585C142199134107831DB6C55C408637",
                "height": 103,
                "elapsedTime": 5909
            },
            "evaluatorReader": true,
            "lineCount": 15,
            "tags": "lasso_cell"
        },
        {
            "id": "markdownetkGD7",
            "type": "markdown",
            "body": [
                "<!-- <p style=\"font-size: 15px;\"> <b> Note </b>: the default selection will produce an interactive version of  </p>",
                "<div class=\"crop\"   style=\"overflow:hidden;height:346px;width:346px\"> ",
                "<a href=\"http://journals.aps.org/prl/article/10.1103/PhysRevLett.114.105503/figures/2/medium\" target=\"_blank\"> <img style=\"margin: -188px 0 0 0\" src=\"http://journals.aps.org/prl/article/10.1103/PhysRevLett.114.105503/figures/2/medium\"> </a>",
                "</div>",
                "<p  style=\"font-size: 15px;\"> from <a href=\"http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.114.105503\" target=\"_blank\"> Phys. Rev. Lett. 114, 105503 (2015) </a>. </p> -->"
            ],
            "evaluatorReader": false
        },
        {
            "id": "codeVFrr3c",
            "type": "code",
            "evaluator": "JavaScript",
            "input": {
                "body": [
                    "var result_link = '/user/tmp/' + beaker.viewer_result + '.html';",
                    "beaker.view_result(result_link);"
                ],
                "hidden": true
            },
            "output": {
                "selectedType": "BeakerDisplay",
                "pluginName": "JavaScript",
                "state": {},
                "hidden": true,
                "elapsedTime": 28
            },
            "evaluatorReader": true,
            "lineCount": 2,
            "tags": "lasso_cell"
        }
    ],
    "namespace": {
        "selected_feature_list": [
            "rs(A)",
            "rs(B)",
            "rp(A)",
            "rp(B)",
            "rd(A)",
            "rd(B)"
        ],
        "allowed_operations": [
            "|-|",
            "/",
            "^2",
            "exp"
        ],
        "maxDim": null,
        "max_dim": "2",
        "max_dim2": 18,
        "max_dim3": [
            11
        ],
        "runInfo": "running Lasso",
        "viewer_result": "a07a590d6030cf73",
        "embed_method": "pca",
        "standardize": "True"
    },
    "locked": true
}