0% found this document useful (0 votes)
19 views9 pages

Linear Regression Correlations Hands-On Tutorial

Uploaded by

Sudhamsh Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views9 pages

Linear Regression Correlations Hands-On Tutorial

Uploaded by

Sudhamsh Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Data science for Materials Science & Engineering

Linear Regression in materials science


– Correlations with melting temperature
In this module
• Introduction to linear regression with materials examples
• Hands-on tutorials using nanoHUB: Young’s modulus
• Hands-on tutorials using nanoHUB: correlating materials properties (this lecture)
• Homework assignments

Saaketh Desai and Alejandro Strachan


[email protected] || [email protected]
School of Materials Engineering & Network for Computational Nanotechnology
Purdue University
West Lafayette, Indiana USA

Saaketh Desai – Hands-on machine learning through nanoHUB 1


Objective and prerequisites
After completing this lecture you will:
• Learn to query materials dataset from an online database
• Construct and train a linear model to predict values from a materials dataset
• Evaluate uncertainties in the fitted parameters
• Compute errors in the fitting procedure

Pre-requisites:
1. Basic Python programming. See Juan C. Verduzco
https://nanohub.org/resources/33266
2. Querying materials repositories (in this series)

Saaketh Desai – Hands-on machine learning through nanoHUB 2


Linear Regression – a materials example
Callister, 9th edition

High bond strength – high melting temperature


Potential energy

Interatomic distance

High bond strength – high stiffness – high Young’s modulus

Melting temperature and Young’s modulus generally correlate to each other

Can we predict Young’s modulus based only on the melting temperature?

Saaketh Desai – Hands-on machine learning through nanoHUB 3


Step 1: Launching a Jupyter tool in nanoHUB
Machine Learning for Materials Science: Part 1
From your browser go to link: https://nanohub.org/tools/mseml/

Click on Launch Tool to begin

Saaketh Desai – Hands-on machine learning through nanoHUB 4


Step 2: Landing Page – Notebook: Linear Regression
Navigate to the
second link in the
landing page to
access the notebook
we will be working on
during this workshop

Saaketh Desai – Hands-on machine learning through nanoHUB 5


Step 3: Let’s get some data
Import scikit learn for linear regression

Query Pymatgen and Mendeleev for


atomic number, melting point etc.

Divide data into training and testing sets


• Training: used to parameterize the mode
• Testing: check the model can be used as
a stopping criteria – avoid overfitting
You can change the number of training/testing data here

Organize data into numpy arrays

Saaketh Desai – Hands-on machine learning through nanoHUB 6


Step 4: Create linear model and train model

Use scikit-learn to fit a linear model


Scikit-learn: https://scikit-learn.org/stable/

Print model parameters

Plot results

Saaketh Desai – Hands-on machine learning through nanoHUB 7


Plot results

Training
Testing
Model

Saaketh Desai – Hands-on machine learning through nanoHUB 8


Next steps

Homework assignment: to reinforce concepts and help students modify the


workflow and adapt it for their needs

Saaketh Desai – Hands-on machine learning through nanoHUB 9

You might also like