diff --git a/tetradymite_PRM2020.ipynb b/tetradymite_PRM2020.ipynb index 0f1f4b0823d5da9bb7d959060999235ff43c1936..5e45474ab87dfc490d171a70825a3c68df6f89f0 100644 --- a/tetradymite_PRM2020.ipynb +++ b/tetradymite_PRM2020.ipynb @@ -92,15 +92,45 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": { "ExecuteTime": { - "end_time": "2020-11-03T16:51:20.970400Z", - "start_time": "2020-11-03T16:51:20.952704Z" + "end_time": "2021-06-18T10:11:21.702190Z", + "start_time": "2021-06-18T10:11:21.697979Z" }, "init_cell": true }, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "<script>\n", + " code_show=true; \n", + " function code_toggle() {\n", + " if (code_show)\n", + " {\n", + " $('div.input').hide();\n", + " } \n", + " else \n", + " {\n", + " $('div.input').show();\n", + " }\n", + " code_show = !code_show\n", + " } \n", + " $( document ).ready(code_toggle);\n", + " window.runCells(\"startup\");\n", + "</script>\n", + "The Python code for this notebook is by default hidden for easier reading.\n", + "To toggle on/off the code, click <a href=\"javascript:code_toggle()\">here</a>.\n" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "%%HTML\n", "<script>\n", @@ -140,11 +170,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": { "ExecuteTime": { - "end_time": "2020-11-03T16:51:20.988129Z", - "start_time": "2020-11-03T16:51:20.971872Z" + "end_time": "2021-06-18T10:11:21.715958Z", + "start_time": "2021-06-18T10:11:21.703778Z" }, "init_cell": true }, @@ -179,11 +209,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": { "ExecuteTime": { - "end_time": "2020-11-03T16:51:21.019833Z", - "start_time": "2020-11-03T16:51:20.989688Z" + "end_time": "2021-06-18T10:11:21.738839Z", + "start_time": "2021-06-18T10:11:21.717570Z" }, "init_cell": true }, @@ -249,11 +279,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": { "ExecuteTime": { - "end_time": "2020-11-03T16:51:21.154094Z", - "start_time": "2020-11-03T16:51:21.021983Z" + "end_time": "2021-06-18T10:11:21.861901Z", + "start_time": "2021-06-18T10:11:21.740433Z" }, "init_cell": true }, @@ -293,11 +323,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": { "ExecuteTime": { - "end_time": "2020-11-03T16:51:21.173521Z", - "start_time": "2020-11-03T16:51:21.155580Z" + "end_time": "2021-06-18T10:11:21.869280Z", + "start_time": "2021-06-18T10:11:21.863220Z" }, "init_cell": true }, @@ -361,11 +391,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": { "ExecuteTime": { - "end_time": "2020-11-03T16:51:21.204474Z", - "start_time": "2020-11-03T16:51:21.175033Z" + "end_time": "2021-06-18T10:11:21.889195Z", + "start_time": "2021-06-18T10:11:21.870692Z" }, "init_cell": true }, @@ -392,7 +422,7 @@ " if change['new'] == 'PRM2020':\n", " default_operations = ['add', 'sub', 'abs_diff', 'mult', 'div', 'exp', 'neg_exp', 'inv', 'sq', 'cb', \n", " 'sqrt', 'cbrt', 'log', 'abs']\n", - " default_features = ['z_cations','chi_cations','lambda_cations','z_anions','chi_anions','lambda_anions']\n", + " default_features = ['z_cations','x_cations','l_cations','z_anions','x_anions','l_anions']\n", "\n", " for op, widget in zip(possible_operations, op_list):\n", " widget.value = op in default_operations\n", @@ -411,7 +441,7 @@ " \n", " default_operations = ['add', 'sub', 'abs_diff', 'mult', 'div', 'exp', 'neg_exp', 'inv', 'sq', 'cb', \n", " 'sqrt', 'cbrt', 'log', 'abs']\n", - " default_features = ['z_cations','chi_cations','lambda_cations','z_anions','chi_anions','lambda_anions']\n", + " default_features = ['z_cations','x_cations','l_cations','z_anions','x_anions','l_anions']\n", " \n", " for op, widget in zip(possible_operations, op_list):\n", " widget.value = op in default_operations\n", @@ -426,7 +456,7 @@ "def find_descriptors(b):\n", " with out2:\n", " clear_output() \n", - " with out1:\n", + " with out1: \n", " clear_output()\n", " print('Calculating...', flush=True)\n", " selected_features = []\n", @@ -434,6 +464,8 @@ " for op, widget in zip(possible_operations, op_list):\n", " if widget.value:\n", " allowed_operations.append(op)\n", + " \n", + "\n", " for sel_feat, widget in zip(possible_features, feat_list):\n", " if widget.value:\n", " feat = sel_feat.split('_')[0]\n", @@ -445,8 +477,7 @@ " selected_features.append(feat + '_'+ 'L') \n", " selected_features.append(feat + '_'+ \"M\") \n", " selected_features.append(feat + '_'+ \"N\") \n", - " \n", - " \n", + " \n", " if tier_selection.value == 'PRM2020':\n", " selected_features = \"all\"\n", " tier = 0\n", @@ -477,8 +508,10 @@ "\n", " print(\"Number of features generated: \" + str(feat_space.n_feat))\n", " print(\"\")\n", + " \n", " try:\n", " sisso.fit()\n", + "\n", " for i in range(dimension_selection.value):\n", " print(str(i+1)+'D model')\n", " print(\"# misclassified: {} \".format(int(sisso.models[i][0].n_convex_overlap_train)))\n", @@ -501,16 +534,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": { "ExecuteTime": { - "end_time": "2020-11-03T16:51:21.475170Z", - "start_time": "2020-11-03T16:51:21.205856Z" + "end_time": "2021-06-18T10:11:22.206858Z", + "start_time": "2021-06-18T10:11:21.891096Z" }, "init_cell": true, "scrolled": false }, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "565d82f8a59d487b8e6fb554a9197112", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(HBox(children=(VBox(children=(Label(value=''), Checkbox(value=True, disabled=True, indent=False…" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "cb_layout = widgets.Layout(width = '15px')\n", "thin_layout = widgets.Layout(width = '100px')\n", @@ -520,23 +568,23 @@ "possible_operations = ['add', 'sub', 'abs_diff', 'mult', 'div', 'exp', 'neg_exp', 'inv', 'sq', 'cb', \n", " 'sqrt', 'cbrt', 'log', 'abs']\n", "\n", - "possible_features = ['z_cations','chi_cations','lambda_cations','z_anions','chi_anions','lambda_anions']\n", + "possible_features = ['z_cations','x_cations','l_cations','z_anions','x_anions','l_anions']\n", "\n", "tooltips = {\n", " \"z_cations\" : \"Atomic number\",\n", - " \"chi_cations\" : \"Pauling electronegativity\",\n", - " \"lambda_cations\" : \"Spin orbit coupling\",\n", + " \"x_cations\" : \"Pauling electronegativity\",\n", + " \"l_cations\" : \"Spin orbit coupling\",\n", " \"z_anions\" : \"Atomic number\",\n", - " \"chi_anions\" : \"Pauling electronegativity\",\n", - " \"lambda_anions\" : \"Spin orbit coupling\",\n", + " \"x_anions\" : \"Pauling electronegativity\",\n", + " \"l_anions\" : \"Spin orbit coupling\",\n", "}\n", "\n", "labels = {\n", " 'add' : '$x + y$', 'sub' : '$x - y$', 'abs_diff' : '$|x - y|$', 'mult' : '$x \\cdot y$', 'div' : '$x / y$',\n", " 'exp' : '$\\exp(x)$', 'neg_exp' : '$\\exp(-x)$', 'inv' : '$1/x$', 'sq' : '$x^2$', 'cb' : '$x^3$', \n", " 'six_pow' : '$x^6$', 'sqrt' : '$\\sqrt{x}$', 'cbrt' : '$\\sqrt[3]{x}$', 'log' : '$\\log(x)$',\n", - " 'abs' : '$|x|$', 'sin' : '$\\sin(x)$', 'cos' : '$\\cos(x)$', 'z_cations' : '$Z_{cations}$', 'chi_cations' : '$\\chi_{cations}$', \n", - " 'lambda_cations' : '$\\lambda_{cations}$', 'z_anions' : '$Z_{anions}$', 'chi_anions' : '$\\chi_{anions}$', 'lambda_anions' : '$\\lambda_{anions}$' \n", + " 'abs' : '$|x|$', 'sin' : '$\\sin(x)$', 'cos' : '$\\cos(x)$', 'z_cations' : '$Z_{cations}$', 'x_cations' : '$\\chi_{cations}$', \n", + " 'l_cations' : '$\\lambda_{cations}$', 'z_anions' : '$Z_{anions}$', 'x_anions' : '$\\chi_{anions}$', 'l_anions' : '$\\lambda_{anions}$' \n", "}\n", "\n", "op_list = []\n", @@ -589,6 +637,13 @@ "display(out_box)" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": null, @@ -614,7 +669,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.3" + "version": "3.7.10" } }, "nbformat": 4,