Skip to content

Commit

Permalink
chore: finalized cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin M. Jablonka committed Oct 28, 2020
1 parent 29563dc commit 4c7bba3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions molsim_ml.ipynb
Expand Up @@ -24,7 +24,9 @@
"At the end of the exercise, you will produce an interactive plot like the one below, comparing the predictions of your model against CO$_2$ computed with GCMC simulations.\n",
"The histograms show the distributions of the errors on the training set (left) and on the test set (right).\n",
"\n",
"![Parity interactive](_static/result.gif)\n",
"\n",
"\n",
"<img src=\"_static/result.gif\" alt=\"Parity interactive\" width=\"700\"/>\n",
"\n",
"This exercise requires a basic knowledge of Python, e.g. that you can write list comprehensions, and are able to read documentation of functions provided by Python packages.\n",
"You will be asked to provide some function arguments (indicated by `#fillme` comments).\n",
Expand All @@ -40,7 +42,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## -1. Only if you run on Colab"
"## -1. Only if you run this notebook on Colab"
]
},
{
Expand Down Expand Up @@ -1727,7 +1729,7 @@
"<details>\n",
"<summary> <font color='green'>Click here for a hint</font></summary>\n",
"<ul>\n",
" <li>Use something like <code>pd.options.display.max_columns=10</code> to adjust how many columns are shown.</li>\n",
" <li>Use something like <code>pd.options.display.max_columns=100</code> to adjust how many columns are shown.</li>\n",
"</ul>\n",
"</details>"
]
Expand Down Expand Up @@ -2787,9 +2789,7 @@
"source": [
" $\\color{DarkBlue}{\\textsf{Short Exercise}}$\n",
"- use the [joblib library](https://scikit-learn.org/stable/modules/model_persistence.html) to save your model\n",
"- make sure you can load it again\n",
"\n",
"Use this to save models as you go."
"- make sure you can load it again\n"
]
},
{
Expand Down Expand Up @@ -2912,6 +2912,7 @@
" # get the indices\n",
" shuffling_idx = np.arange(X.shape[0])\n",
" for n_round in range(n_repeats):\n",
" # FILL BELOW HERE\n",
" # shuffle them (fill in what you want to shuffle)\n",
" random_state.shuffle(#fillme) \n",
" \n",
Expand All @@ -2924,6 +2925,7 @@
" \n",
" # Deal with numpy arrays \n",
" else:\n",
" # FILL BELOW HERE\n",
" # array indexing is [row, column]\n",
" X_permuted[:, col_idx] = X_permuted[#fillme]\n",
" \n",
Expand All @@ -2936,6 +2938,13 @@
" return scores"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Nothing to change in the function below, it just call the `_calculate_permutation_scores` function you just completed. "
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -3038,6 +3047,7 @@
"<ul>\n",
" <li> To get the top <emph>n</emph> indices of an array <code>a</code>, you can use <code>np.argsort(a)[-n:]</code></li>\n",
" <li> Get the feature names from the <code>FEATURES</code> list </li> \n",
" <li> combined this might look like <code>np.array(FEATURES)[np.argsort(a)[-n:]]</code></li>\n",
"</ul>\n",
"</details>"
]
Expand Down

0 comments on commit 4c7bba3

Please sign in to comment.