From 78fceb72915519b43468764c13302ed476136b13 Mon Sep 17 00:00:00 2001 From: Aron Walsh Date: Mon, 27 Jan 2025 13:40:58 +0000 Subject: [PATCH] 2025 Lecture 3 --- Lecture3.ipynb | 1861 ++++++++++++++++++++++++++++++++++++++++++++++++ _toc.yml | 1 + 2 files changed, 1862 insertions(+) create mode 100644 Lecture3.ipynb diff --git a/Lecture3.ipynb b/Lecture3.ipynb new file mode 100644 index 0000000..d602e52 --- /dev/null +++ b/Lecture3.ipynb @@ -0,0 +1,1861 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "hF3EDWL0A0RQ" + }, + "source": [ + "# Materials Data" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "Mo2IDc40A0RV" + }, + "source": [ + "
\n", + " πŸ’‘ Michael Ashby and David Jones: How is the engineer to choose from this vast menu the material that best suits the purpose?\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "s1XIAlqsA0RW" + }, + "source": [ + "\n", + "\n", + "[Lecture slides](https://speakerdeck.com/aronwalsh/mlformaterials-lecture3-ml)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "JLQe-aiNUrTZ" + }, + "source": [ + "## πŸš€ Data-driven thermoelectrics\n", + "\n", + "The goal today is to access, filter, and visualise materials data. There is a growing number of open computational materials science databases that include [Materials Project](https://materialsproject.org), [NOMAD](https://nomad-lab.eu), [OQMD](https://oqmd.org), and [AFLOW](http://www.aflowlib.org). \n", + "\n", + "We will use an application programming interface (API) via Python. Open Databases Integration for Materials Design ([OPTIMADE](https://www.optimade.org)) provides access to >20 databases and >20 million structures using a single interface.\n", + "\n", + "
\n", + " 🚨 Data warning: Many computational databases are based on the properties of static crystals. In reality, temperature influences the structures and properties of materials. We have to start somewhere, but keep this in mind when judging the utility of derived models and the trust in \"ground truth\" reference data.\n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2023-12-21T15:56:33.424917100Z", + "start_time": "2023-12-21T15:55:20.372896400Z" + }, + "colab": { + "base_uri": "https://localhost:8080/" + }, + "executionInfo": { + "elapsed": 81812, + "status": "ok", + "timestamp": 1691500256978, + "user": { + "displayName": "Calysta Tesiman", + "userId": "13160776105216987028" + }, + "user_tz": -60 + }, + "id": "5ULOjac_UrTe", + "outputId": "6f22c5b0-a830-45dd-9fd0-4305bf00e856" + }, + "outputs": [], + "source": [ + "# Installation of libraries\n", + "!pip install optimade --quiet\n", + "!pip install matminer --quiet\n", + "!pip install elementembeddings --quiet\n", + "!pip install pymatviz --quiet \n", + "!pip install plotly --quiet " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2023-12-21T15:56:44.654986700Z", + "start_time": "2023-12-21T15:56:33.427916800Z" + }, + "id": "VD52AmC9UrTf" + }, + "outputs": [], + "source": [ + "# Import of modules\n", + "import pandas as pd # Data manipulation with DataFrames\n", + "import numpy as np # Numerical operations\n", + "import matplotlib.pyplot as plt # Plotting\n", + "import pprint # Pretty print data structures\n", + "import os # Operating system functions" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "
\n", + "Colab error solution\n", + "If running the import module cell fails with an \"AttributeError\", click `Runtime` -> `Restart Session` and then simply rerun the cell. \n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "tags": [] + }, + "source": [ + "## Database queries\n", + "\n", + "In the following Python code, we use OPTIMADE to query a database and retrieve structures that contain a specified number of elements. \n", + "\n", + "The steps include:\n", + "\n", + "* _Initialise the OPTIMADE client:_ specify the database provider.\n", + "\n", + "* _Define a filter:_ set the criteria for filtering the materials data.\n", + "\n", + "* _Retrieve and process data:_ Query the database using the filter and process the retrieved data." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "from optimade.client import OptimadeClient\n", + "\n", + "# Initialise with specified provider\n", + "client = OptimadeClient(include_providers={\"mp\"}) \n", + " # Other providers include \"mp\", \"alexandria\", \"oqmd\", \"jarvis\", \"aflow\"\n", + "\n", + "# Define a filter to find structures with exactly n elements\n", + "filters = ['nelements=8']\n", + "\n", + "# Process each filter to fetch and display relevant data\n", + "for f in filters:\n", + " # Retrieve data using the client\n", + " result = client.get(f)\n", + " \n", + " if 'structures' in result and f in result['structures']:\n", + " provider_data = next(iter(result['structures'][f].values()))\n", + " structures_data = provider_data['data']\n", + "\n", + " # Print the count of structures found\n", + " print(f\"Count for filter '{f}': {len(structures_data)}\")\n", + "\n", + " # Print a summary of each structure's ID and formula\n", + " print(\"Summary of Compounds:\")\n", + " for structure in structures_data:\n", + " structure_id = structure.get('id', 'No ID provided')\n", + " formula = structure.get('attributes', {}).get('chemical_formula_descriptive', 'No formula provided')\n", + " print(f\"ID: {structure_id}, Formula: {formula}\")\n", + " else:\n", + " print(\"No data found for this filter.\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "ExecuteTime": { + "end_time": "2023-12-21T15:57:14.756137500Z", + "start_time": "2023-12-21T15:56:48.644742700Z" + }, + "colab": { + "base_uri": "https://localhost:8080/", + "height": 67, + "referenced_widgets": [ + "a302e21f48824e5fbfa7ac28a0a9a17e", + "9c2a732ff4dd44a9ad017bbec1f43b80", + "d0d1d1a34b954d90bf222529f2760639", + "882fc224a5f143acac770c2addd18026", + "92228f1970b94bf795bb5919bd49c751", + "efff1771eb2e4f1caa66f79c710ce0cb", + "82105f5048054a03a2d9b270ca084c07", + "ae6256b8cc0f489f927bc534250b88d8", + "39c496c90ceb423996dca18f9133e352", + "89ea4b83f2ab464cb2cd4fc2a5280072", + "c7aac064987448198b95cc13dee8a548" + ] + }, + "id": "CunkngP2UrTk", + "outputId": "319b8f6b-4040-4f64-b2b3-3bce1550630f" + }, + "source": [ + "They are complex compounds! \n", + "\n", + "We won't spend too much time delving into the specifics of each API since they each come with their own syntax and capabilities. They can also be slow for complex searches. However, it's important to grasp the overall logic behind constructing queries.\n", + "\n", + "For instance, consider the following example using the Materials Project API. This query is designed to search for materials that contain Li, have a band gap between 0.5 and 1.5 eV, and consist of either two or three elements:\n", + "\n", + "```python\n", + "with MPRester(ACCESS_KEY, use_document_model=False) as mpr:\n", + " docs = mpr.materials.summary.search(\n", + " elements=[\"Li\"],\n", + " band_gap=(0.5,1.5),\n", + " num_elements=(2,3),\n", + " fields=['material_id', 'formula_pretty', 'band_gap', 'is_stable', 'theoretical']\n", + " )\n", + "\n", + "print(\"Number of binary and ternary Li containing compounds with a band gap between 0.5 and 1.5 eV: \", len(docs))\n", + "```\n", + "\n", + "Running this requires getting your own [access key](https://next-gen.materialsproject.org/api#api-key). We had problems last year as too many students connected at once and Imperial College got temporarily blocked! For this activity we will move forward and \"cheat\" by using a pre-built dataset." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ptQXH0UrUrTo" + }, + "source": [ + "## Chemical space of thermoelectric materials \n", + "\n", + "In the Lecture 2 activity, we used a [matminer](https://hackingmaterials.lbl.gov/matminer/) dataset on crystal hardness. Today we will turn to thermoelectric materials. \n", + "\n", + "Thermoelectric devices convert temperature differences directly into electrical voltage, enabling applications in power generation and refrigeration. Their efficiency is characterised by the dimensionless figure of merit (zT), which depends on electrical conductivity, Seebeck coefficient, and thermal conductivity (read more [here](https://www.nature.com/articles/nmat2090)). Let's explore the diverse compositions that give rise to these properties." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import matminer # Materials informatics\n", + "from matminer.datasets.dataset_retrieval import load_dataset # Load materals datasets\n", + "\n", + "print(matminer.datasets.dataset_retrieval.get_all_dataset_info('ucsb_thermoelectrics'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The dataset is a reasonable size, so we can load it all without downsampling." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2023-12-21T16:00:25.618523800Z", + "start_time": "2023-12-21T15:57:16.092693400Z" + }, + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, + "outputs": [], + "source": [ + "# Use matminer to download the dataset\n", + "df = load_dataset('ucsb_thermoelectrics')\n", + "\n", + "print(f'The full dataset contains {df.shape[0]} entries. \\n')\n", + "print('The DataFrame is shown below:')\n", + "df.head(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "jupyter": { + "outputs_hidden": false + } + }, + "source": [ + "Let's perform a deeper check:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Display the columns of the dataset\n", + "print(\"Columns in the dataset:\")\n", + "print(df2.columns)\n", + "\n", + "# Check for any missing values in the dataset\n", + "print(\"\\nChecking for missing values:\")\n", + "print(df2.isnull().sum())" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "
\n", + " Code hint \n", + "Check the DataFrame name\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "First, let's visualise the distribution of the zT performance metric in the dataset. This will help us understand the range and common values." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import seaborn as sns\n", + "\n", + "# Plot the distribution of zT values\n", + "plt.figure(figsize=(5, 4))\n", + "sns.histplot(df['zT'], bins=, kde=True)\n", + "plt.title('Thermoelectric figure of merit (zT)')\n", + "plt.xlabel('zT (unitless)')\n", + "plt.ylabel('Frequency')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "
\n", + " Code hint \n", + "Set the number of bins for the histogram. 50?
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, we will analyse the distribution of elements within our thermoelectrics dataset by creating a heatmap over the periodic table. This would take a lot of time from scratch, but we can use the [pymatviz](https://github.com/janosh/pymatviz) package." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import re\n", + "from collections import Counter\n", + "from pymatviz import ptable_heatmap\n", + "\n", + "# Extract all unique elements from the composition column\n", + "elements = []\n", + "for composition in df['composition']:\n", + " # Split each composition by non-alphanumeric characters to extract elements\n", + " elements += [part for part in re.split('[^a-zA-Z]', composition) if part]\n", + "\n", + "# Count the frequency of each element\n", + "element_counts = Counter(elements)\n", + "\n", + "# Convert the Counter object to a dictionary for the heatmap\n", + "element_counts_dict = dict(element_counts)\n", + "\n", + "# Create the periodic table heatmap \n", + "fig = ptable_heatmap(\n", + " element_counts_dict, \n", + " colormap=\"viridis\", \n", + " cbar_label_fmt=\"Frequency of Elements\", \n", + " log=True, # Use logarithmic scale for better visualisation\n", + " value_kwargs={\"fontsize\": 10}, # Adjust font size for element labels\n", + " return_type=\"figure\" # Return the figure for further customisation\n", + ")\n", + "\n", + "# Add a title\n", + "fig.suptitle(\"Element Frequency in Thermoelectric Dataset\", fontsize=16, fontweight=\"bold\")\n", + "\n", + "# Display the plot\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "uEPF6ETxA0Rk" + }, + "source": [ + "## Unsupervised machine learning\n", + "\n", + "We have a set of materials with different compositions. We can use machine learning to visualise these in two or three dimensions. You can think of this like a materials map. \n", + "\n", + "We refer to the methods that enable us to reduce high-dimensional data into lower dimensions as [dimensionality reduction techniques](https://scikit-learn.org/stable/modules/manifold.html). These allow us to visualise complex data and in this example we will make use of Principal Component Analysis (PCA).\n", + "\n", + "
\n", + " Overview of PCA \n", + "PCA is a popular technique for dimensionality reduction and data preprocessing, enabling the simplification of complex datasets. High-dimensional data is transformed into a new coordinate system where the axes align with the directions of maximum variance in the original data. These new axes, termed \"principal components,\" are orthogonal. The first principal component captures the highest variance, the second captures the second highest, etc.\n", + "\n", + "_Key use cases include:_\n", + "\n", + "- **Dimensionality Reduction**: Identifying and eliminating less informative dimensions, reducing noise and computational complexity.\n", + "\n", + "- **Data Visualisation**: Facilitating easier interpretation while preserving essential patterns.\n", + "\n", + "- **Noise Reduction**: Filtering out noise or unimportant variations by focusing on significant variance.\n", + "\n", + "- **Feature Engineering**: A preprocessing step to transform data before applying machine learning algorithms, potentially improving performance.\n", + "\n", + "_PCA workflow:_\n", + "\n", + "1. **Center the Data**: Subtract the mean from each feature to center the data around the origin.\n", + "\n", + " $\n", + " X_{\\text{centered}} = X - \\bar{X}\n", + " $\n", + "\n", + "2. **Calculate Covariance Matrix**: Compute the covariance matrix to understand feature relationships and their [covariance](https://en.wikipedia.org/wiki/Covariance).\n", + "\n", + " $\n", + " \\text{Cov}(X) = \\frac{1}{n}X_{\\text{centered}}^T X_{\\text{centered}}\n", + " $\n", + "\n", + "3. **Compute Eigenvalues and Eigenvectors**: Calculate eigenvalues ($\\lambda_i$) and eigenvectors ($\\mathbf{v}_i$) of the covariance matrix. Eigenvectors represent maximum variance directions, and eigenvalues quantify the variance magnitude.\n", + "\n", + " $\n", + " \\text{Cov}(X) \\mathbf{v}_i = \\lambda_i \\mathbf{v}_i\n", + " $\n", + "\n", + "4. **Sort Eigenvalues**: Sort eigenvalues in descending order, rearranging corresponding eigenvectors accordingly.\n", + "\n", + "5. **Select Principal Components**: Choose a subset of eigenvectors (principal components) based on eigenvalues, explaining the most variance in the data.\n", + "\n", + "6. **Project Data**: Project original data onto selected principal components, yielding a lower-dimensional representation.\n", + "\n", + "Note that PCA analysis is limited by its reliance on linear transformations of the data. In cases where non-linear structures are prominent, alternative techniques such as t-distributed Stochastic Neighbor Embedding (t-SNE) can be used.\n", + "
" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2023-12-21T16:01:52.881969600Z", + "start_time": "2023-12-21T16:01:51.488322900Z" + }, + "colab": { + "base_uri": "https://localhost:8080/", + "height": 472 + }, + "id": "9JKs4xR7A0Rk", + "outputId": "e48cbed6-e0f7-49f1-dc9c-36a88453cf9c" + }, + "outputs": [], + "source": [ + "# Perform PCA analysis\n", + "from sklearn.decomposition import PCA\n", + "plt.rcdefaults() # Reset the matplotlib style\n", + "\n", + "# Random 10D vectors for demonstration purposes\n", + "np.random.seed(42)\n", + "num_samples = 1000\n", + "dimensionality = 0\n", + "random_state = 42\n", + "data = np.random.rand(num_samples, dimensionality)\n", + "\n", + "# Perform PCA to reduce the dimensionality to 2D\n", + "pca = PCA(n_components=dimensionality)\n", + "reduced_data = pca.fit_transform(data)\n", + "\n", + "# Create a color map based on the original data points\n", + " # Use the first dimension of the original data as the color value\n", + "color_map = data[:, 0]\n", + "\n", + "# Plot the 2D projection\n", + "plt.figure(figsize=(5, 3))\n", + "plt.scatter(reduced_data[:, 0], reduced_data[:, 1], c=color_map, cmap='viridis')\n", + "plt.colorbar(label='Colour based on first dimension')\n", + "plt.xlabel('Principal Component 1')\n", + "plt.ylabel('Principal Component 2')\n", + "plt.title('2D projection using PCA')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "tags": [] + }, + "source": [ + "
\n", + " Code hint \n", + "Set the number of dimensions (components) to 2\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "V8K3c0DwA0Rl" + }, + "source": [ + "#### Featurise compositions \n", + "\n", + "Using our dataset, we can try different featurisation schemes and analyse the resulting visualisations. Here we will perform a Magpie encoding of chemical compositions using the [ElementEmbeddings](https://github.com/WMD-group/ElementEmbeddings) package." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from elementembeddings.composition import composition_featuriser\n", + "\n", + "magpie_df = composition_featuriser(df, formula_column=\"composition\", embedding='magpie')\n", + "magpie_df.head()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Note all of the extra columns that have been added containing the features. We need to do a little cleanup of the DataFrame and can then proceed with our PCA analysis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2023-12-21T16:04:19.112810300Z", + "start_time": "2023-12-21T16:04:14.667594600Z" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "from sklearn.decomposition import PCA\n", + "from sklearn.preprocessing import StandardScaler\n", + "import matplotlib.pyplot as plt\n", + "\n", + "# Select only the new features by dropping the original columns and handling NaNs\n", + "new_features_df = magpie_df.drop(columns=df.columns).dropna()\n", + "\n", + "# Extract feature values \n", + "X = new_features_df.values\n", + "X_standardised = StandardScaler().fit_transform(X)\n", + "\n", + "# Perform PCA to reduce dimensionality to 2D\n", + "pca = PCA(n_components=2)\n", + "reduced_data = pca.fit_transform(X_standardised)\n", + "\n", + "# Create a single plot for visualisation\n", + "fig, ax = plt.subplots(figsize=(6, 4))\n", + "\n", + "# Select a label for coloring (assuming zT column exists in the original df)\n", + "color_map = df[\"zT\"].values # Use original DataFrame for the label (e.g., zT)\n", + "\n", + "# Scatter plot in 2D space\n", + "scatter = ax.scatter(reduced_data[:, 0], reduced_data[:, 1], c=color_map, cmap='viridis', alpha=0.25, s=100)\n", + "\n", + "# Add labels and title\n", + "ax.set_xlabel(\"Component 1\")\n", + "ax.set_ylabel(\"Component 2\")\n", + "ax.set_title(\"2D PCA of Magpie Features\")\n", + "\n", + "# Add colour bar\n", + "fig.colorbar(scatter, ax=ax, label=\"zT\")\n", + "\n", + "# Show the plot\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let’s check how much variance is captured by the first two principal components. Capturing above 50% of the variance with two dimensions is generally acceptable for initial exploration. However, for practical applications, we might need to increase the number of components to explain a higher proportion of the variance (e.g. 80%-90%) to ensure sufficient representation of the data." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Check explained variance \n", + "explained_variance = pca.explained_variance_ratio_\n", + "cumulative_variance = explained_variance.cumsum()\n", + "print(f\"Explained variance by Component 1: {explained_variance[0]:.2f}\")\n", + "print(f\"Explained variance by Component 2: {explained_variance[1]:.2f}\")\n", + "print(f\"Cumulative variance explained by 2 components: {cumulative_variance[1]:.2f}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "Now, wouldn't it be nice if we could see what material each data point refers to. [Plotly](https://plotly.com/python/) can help with that." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import plotly.express as px\n", + "\n", + "# Add the zT column and composition column from the original DataFrame for coloring and hover info\n", + "plot_df = pd.DataFrame(reduced_data, columns=['Component 1', 'Component 2'])\n", + "plot_df['zT'] = df['zT'].values\n", + "plot_df['composition'] = df['composition'].values # Assuming this is the column with chemical formulas\n", + "\n", + "# Create an interactive scatter plot using Plotly\n", + "fig = px.scatter(\n", + " plot_df, \n", + " x='Component 1', \n", + " y='Component 2', \n", + " color='zT', \n", + " color_continuous_scale='Viridis', \n", + " opacity=0.6,\n", + " hover_name='composition', # Show chemical formula on hover\n", + " hover_data={'Component 1': ':.2f', 'Component 2': ':.2f', 'zT': ':.2f'}, # Additional hover data\n", + " labels={'zT': 'zT Value'}\n", + ")\n", + "\n", + "fig.update_traces(marker=dict(size=10)) # Adjust the size value as needed\n", + "\n", + "fig.update_layout(\n", + " width=6*96, # 6 inches converted to pixels\n", + " height=4*96 # 4 inches converted to pixels\n", + ")\n", + "\n", + "# Show the interactive plot\n", + "fig.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, let's see how a 3D projection looks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from mpl_toolkits.mplot3d import Axes3D\n", + "\n", + "# Perform PCA to reduce dimensionality to 3D\n", + "pca = PCA(n_components=3)\n", + "reduced_data = pca.fit_transform(X_standardised)\n", + "\n", + "# Create a 3D plot for visualisation\n", + "fig = plt.figure(figsize=(6, 5))\n", + "\n", + "# Create a 3D plot\n", + "ax = fig.add_subplot(111, projection='3d')\n", + "color_map = df[\"zT\"].values \n", + "scatter = ax.scatter(reduced_data[:, 0], reduced_data[:, 1], reduced_data[:, 2], c=color_map, cmap='viridis', alpha=0.5)\n", + "\n", + "# Add labels and title\n", + "ax.set_xlabel(\"Component 1\")\n", + "ax.set_ylabel(\"Component 2\")\n", + "ax.set_zlabel(\"Component 3\")\n", + "ax.set_title(\"3D PCA of Magpie Features\")\n", + "\n", + "# Show the plot\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "E9pdrnlcA0Rn" + }, + "source": [ + "
\n", + " Code hint \n", + "You can change the featurisation scheme to see the impact on the resulting visualisation and distribution of compositions\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 🚨 Exercise 3\n", + "\n", + "
\n", + " πŸ’‘ Coding exercises: The exercises are designed to apply what you have learned with room for creativity. It is fine to discuss solutions with your classmates, but the actual code should not be directly copied.\n", + "
\n", + "\n", + "### Your details" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2023-12-21T16:06:48.931855300Z", + "start_time": "2023-12-21T16:06:48.922998200Z" + } + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "\n", + "# Insert your values\n", + "Name = \"No Name\" # Replace with your name\n", + "CID = 123446 # Replace with your College ID (as a numeric value with no leading 0s)\n", + "\n", + "# Set a random seed using the CID value\n", + "CID = int(CID)\n", + "np.random.seed(CID)\n", + "\n", + "# Print the message\n", + "print(\"This is the work of \" + Name + \" [CID: \" + str(CID) + \"]\")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "IhKzENzxUrTv" + }, + "source": [ + "### Problem\n", + "\n", + "Unsupervised machine learning techniques, such as dimensionality reduction, allow us to uncover patterns and relationships in complex datasets. \n", + "\n", + "A set of tasks will be assigned to apply different techniques to visualise clustering to explore the properties of thermoelectric materials." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2023-12-21T16:06:48.951267800Z", + "start_time": "2023-12-21T16:06:48.931855300Z" + } + }, + "outputs": [], + "source": [ + "#Empty block for your answers\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "ExecuteTime": { + "end_time": "2023-12-21T16:06:49.192205600Z", + "start_time": "2023-12-21T16:06:48.940257900Z" + } + }, + "outputs": [], + "source": [ + "#Empty block for your answers\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "
\n", + " πŸ““ Submission: When your notebook is complete in Google Colab, go to File > Download and choose .ipynb. The completed file should be uploaded to Blackboard under assignments for MATE70026.\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 🌊 Dive deeper\n", + "\n", + "* _Level 1:_ Tackle Chapter 8 on Linear Unsupervised Learning in [Machine Learning Refined](https://github.com/jermwatt/machine_learning_refined#what-is-new-in-the-second-edition).\n", + "\n", + "* _Level 2:_ Read about our attempt to screen _all inorganic materials_ (with caveats) in the journal [Chem](https://doi.org/10.1016/j.chempr.2016.09.010). \n", + "\n", + "* _Level 3:_ Watch a [seminar](https://www.youtube.com/watch?v=gd-uahI5xbA) by quantum chemist Anatole von Lilienfeld on chemical space. " + ] + } + ], + "metadata": { + "colab": { + "provenance": [], + "toc_visible": true + }, + "kernelspec": { + "display_name": "vscode24", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.4" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "012b2e529c564223a1b2492c8e4d5412": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "19210eeb81354717910870d9a8f4a746": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "19da398c5b2c4bb5aa08f3112380175d": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "2bb5ea02999d47fc8d07c7d24b2e65b3": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "39c496c90ceb423996dca18f9133e352": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "42783a9965e3446ba86caa1f712e7426": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "44ed84d4719a4f2299d03bedebf270e6": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_c9a9de9ebe0044b9bbfa0a8c52ab81ec", + "placeholder": "​", + "style": "IPY_MODEL_539b471846d4471e9fa4ce9992ef377a", + "value": " 2/2 [00:00<00:00, 45.51it/s]" + } + }, + "463ec167775a429e987ab616b392fbef": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "success", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_42783a9965e3446ba86caa1f712e7426", + "max": 34243, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_c6fb4f4887304439826b8c3c4402b62a", + "value": 34243 + } + }, + "46b9184974cd43f0a622f6bf4991fa59": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "521aad5ac2864d519c391cbcc14c5969": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "539b471846d4471e9fa4ce9992ef377a": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "59539504e422446681efe23b6e848eb2": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_521aad5ac2864d519c391cbcc14c5969", + "placeholder": "​", + "style": "IPY_MODEL_d19382f214d7459c8d010a9fbe4ca584", + "value": "Retrieving SummaryDoc documents: 100%" + } + }, + "5f121ccdfc4944ea8afa264df9bc0a50": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_012b2e529c564223a1b2492c8e4d5412", + "placeholder": "​", + "style": "IPY_MODEL_46b9184974cd43f0a622f6bf4991fa59", + "value": "Retrieving SummaryDoc documents: 100%" + } + }, + "63630cdd6bc144c4ae831f51ea65c3af": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_2bb5ea02999d47fc8d07c7d24b2e65b3", + "placeholder": "​", + "style": "IPY_MODEL_19da398c5b2c4bb5aa08f3112380175d", + "value": " 34243/34243 [00:32<00:00, 1162.12it/s]" + } + }, + "6d52e381611645bab0f9375c648deb0f": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "success", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_7b23adb3e4e941fa97d091340f3f21b6", + "max": 2, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_19210eeb81354717910870d9a8f4a746", + "value": 2 + } + }, + "7b23adb3e4e941fa97d091340f3f21b6": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "81f54d5285894dcca88358e375667d16": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_5f121ccdfc4944ea8afa264df9bc0a50", + "IPY_MODEL_463ec167775a429e987ab616b392fbef", + "IPY_MODEL_63630cdd6bc144c4ae831f51ea65c3af" + ], + "layout": "IPY_MODEL_f2433932847d40058ce5513588873486" + } + }, + "82105f5048054a03a2d9b270ca084c07": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "882fc224a5f143acac770c2addd18026": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_89ea4b83f2ab464cb2cd4fc2a5280072", + "placeholder": "​", + "style": "IPY_MODEL_c7aac064987448198b95cc13dee8a548", + "value": " 4437/4437 [00:03<00:00, 1384.71it/s]" + } + }, + "89ea4b83f2ab464cb2cd4fc2a5280072": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "92228f1970b94bf795bb5919bd49c751": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "974df9cd43cb4f98815a601fbe1a4cf0": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "9c2a732ff4dd44a9ad017bbec1f43b80": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HTMLView", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_efff1771eb2e4f1caa66f79c710ce0cb", + "placeholder": "​", + "style": "IPY_MODEL_82105f5048054a03a2d9b270ca084c07", + "value": "Retrieving SummaryDoc documents: 100%" + } + }, + "a302e21f48824e5fbfa7ac28a0a9a17e": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_9c2a732ff4dd44a9ad017bbec1f43b80", + "IPY_MODEL_d0d1d1a34b954d90bf222529f2760639", + "IPY_MODEL_882fc224a5f143acac770c2addd18026" + ], + "layout": "IPY_MODEL_92228f1970b94bf795bb5919bd49c751" + } + }, + "ab95afc367c742e58639c8c7e8428303": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "HBoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "HBoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "HBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_59539504e422446681efe23b6e848eb2", + "IPY_MODEL_6d52e381611645bab0f9375c648deb0f", + "IPY_MODEL_44ed84d4719a4f2299d03bedebf270e6" + ], + "layout": "IPY_MODEL_974df9cd43cb4f98815a601fbe1a4cf0" + } + }, + "ae6256b8cc0f489f927bc534250b88d8": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "c6fb4f4887304439826b8c3c4402b62a": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "ProgressStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "ProgressStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "bar_color": null, + "description_width": "" + } + }, + "c7aac064987448198b95cc13dee8a548": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "c9a9de9ebe0044b9bbfa0a8c52ab81ec": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "d0d1d1a34b954d90bf222529f2760639": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "FloatProgressModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "FloatProgressModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "1.5.0", + "_view_name": "ProgressView", + "bar_style": "success", + "description": "", + "description_tooltip": null, + "layout": "IPY_MODEL_ae6256b8cc0f489f927bc534250b88d8", + "max": 4437, + "min": 0, + "orientation": "horizontal", + "style": "IPY_MODEL_39c496c90ceb423996dca18f9133e352", + "value": 4437 + } + }, + "d19382f214d7459c8d010a9fbe4ca584": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "1.5.0", + "model_name": "DescriptionStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "1.5.0", + "_model_name": "DescriptionStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "StyleView", + "description_width": "" + } + }, + "efff1771eb2e4f1caa66f79c710ce0cb": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "f2433932847d40058ce5513588873486": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "1.2.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + } + } + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/_toc.yml b/_toc.yml index 6c9e705..0fe3012 100644 --- a/_toc.yml +++ b/_toc.yml @@ -15,3 +15,4 @@ parts: chapters: - file: Lecture1 - file: Lecture2 + - file: Lecture3