Code(Credit) : CUTM 3164(0-2-2)
Course Objectives:
This is a hands-on, project-based course designed to introduce students to the Python programming language and its application in Materials Science through Machine Learning (ML). Students will learn the entire lifecycle of an ML project, from cleaning raw data to training and evaluating both classical and deep learning models. The course is structured around a real-world case study: predicting the heat capacity of inorganic materials. This practical approach will equip students with the foundational skills needed for modern computational research in fields like materials discovery, property prediction, and the analysis of experimental data.
Course Outcomes (COs)
Upon successful completion of this course, students will be able to:- CO1: Write basic Python scripts to store and manipulate materials science data (e.g., elemental properties, experimental measurements).
- CO2: Apply data pre-processing techniques using the Pandas library to clean, partition, and featurize a raw materials dataset.
- CO3: Train, evaluate, and compare the performance of various classical machine learning models for a regression task using Scikit-learn.
- CO4: Implement, train, and evaluate a basic neural network for the same regression task using the PyTorch library.
- CO5: Create effective data visualizations to interpret model performance and present the findings of a complete machine learning project in a structured report.
Module 1: Simple Python for Materials:
Introduction to Google Colab/Jupyter Notebooks. Variables and Data Types (integers, floats, strings). Storing elemental properties. Basic operators for scientific calculations (e.g., density, unit conversions). Introduction to lists and dictionaries for storing collections of data. Theprint()
function and f-strings for formatted output.
Module 2: The ML Project Lifecycle & Your Digital Lab
Overview of the 7 steps of an ML project. Setting up a local Python environment (Anaconda). Installing essential libraries (numpy
, pandas
, matplotlib
, scikit-learn
, torch
). Verifying the environment.
Module 3: Data Wrangling - Cleaning Your Raw Data
Introduction to the Pandas DataFrame. Loading data from a CSV file. Inspecting the data with.head()
, .shape()
, and .describe()
. Identifying and handling missing (NaN
) and unrealistic (e.g., negative temperature) values. Saving the cleaned data to a new file.
Module 4: The Critical Split & Data Featurization
Understanding data leakage in materials science. The wrong way vs. the right way to split data (splitting by unique formula). Converting chemical formulae into numerical vectors (Composition-Based Feature Vectors - CBFVs). The concept of data scaling and usingStandardScaler
(fit_transform
vs. transform
).
Module 5: Classical Machine Learning Models
Introduction to regression tasks. Training a "zoo" of models: Ridge, Support Vector Regressor, Random Forest, Gradient Boosting. Using theDummyRegressor
as a baseline. Evaluating model performance with metrics (R², MAE, RMSE). Comparing models fairly on a validation set. Re-training the best model.
Module 6: Deep Learning with Neural Networks
Introduction to PyTorch and Tensors. Building a simpleDenseNet
using nn.Module
. Understanding the roles of the Loss Function (e.g., L1Loss
) and the Optimizer (e.g., Adam
). The training loop: forward pass, backpropagation, and weight updates. Saving and loading a trained model for reproducibility.