0% found this document useful (0 votes)
19 views

Lecture 7

This document summarizes a lecture on machine learning and principal component analysis (PCA). It discusses preprocessing data, performing PCA by calculating eigenvectors and eigenvalues from a correlation matrix, and using the top principal components that capture over 90% of the variance. An example applies PCA to a dataset, calculates principal components, and projects the data onto the new component space. It also discusses using PCA on inputs and outputs of a coal-fired power plant process.

Uploaded by

sdsdsd
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 views

Lecture 7

This document summarizes a lecture on machine learning and principal component analysis (PCA). It discusses preprocessing data, performing PCA by calculating eigenvectors and eigenvalues from a correlation matrix, and using the top principal components that capture over 90% of the variance. An example applies PCA to a dataset, calculates principal components, and projects the data onto the new component space. It also discusses using PCA on inputs and outputs of a coal-fired power plant process.

Uploaded by

sdsdsd
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/ 18

Machine Learning for Chemical Engineers

CHE F315

Ajaya Kumar Pani


BITS Pilani Department of Chemical Engineering
B.I.T.S-Pilani, Pilani Campus
Pilani Campus
Lecture-7
29-01-2024
BITS Pilani
Pilani Campus
Data Preprocessing
BITS Pilani
Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

Recap

Feature extraction
Principal component analysis
Applications
Procedure
Algorithm

3 February 2024 4
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

Step by step procedure

Get the input data matrix


Mean center and scale each value
Determine the correlation matrix
Get the eigen vectors and corresponding eigen values
Arrange the eigen vectors in the order of decreasing eigen
values
Consider only those eigen vectors for which the cumulative
eigen value is equal to or more than 90% of the total eigen
value
These eigen vectors (principal components are our modified
set of variables)

3 February 2024 5
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

Example
s(i) x1 x2
s(1) 0.69 0.49
s(2) –1.31 –1.21
s(3) 0.39 0.99
s(4) 0.09 0.29
s(5) 1.29 1.09
s(6) 0.49 0.79
s(7) 0.19 –0.31
s(8) –0.81 –0.81
s(9) –0.31 –0.31
s(10) -0.71 -1.01

3 February 2024 6
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

Example

3 February 2024 7
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

Example
covx =

0.6166 0.6154
0.6154 0.7166

>> [eigv,eigv1]=eig(covx)

eigv =

-0.7352 0.6779
0.6779 0.7352

eigv1 =

0.0491 0
0 1.2840

3 February 2024 8
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

>> feature = [0.6779, 0.7352;-0.7352,0.6779]


0.107503 0.839459
feature =
0.001543 -1.78337
-0.46347 0.957849
0.6779 0.7352 -0.1522 0.262759
-0.7352 0.6779 0.073123 1.687319
-0.24864 0.895789
>> Z = X*feature; 0.356713 -0.07046
0.046413 -1.14461
0.017763 -0.43806
0.261243 -1.20667 9
3 February 2024
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

Example

s(i) x1 x2
s(1) 0.69 0.49 0.107503 0.839459
s(2) –1.31 –1.21
0.001543 -1.78337
s(3) 0.39 0.99 -0.46347 0.957849
s(4) 0.09 0.29 -0.1522 0.262759
0.073123 1.687319
s(5) 1.29 1.09
-0.24864 0.895789
s(6) 0.49 0.79
0.356713 -0.07046
s(7) 0.19 –0.31
s(8) –0.81 –0.81 0.046413 -1.14461
s(9) –0.31 –0.31 0.017763 -0.43806
s(10) -0.71 -1.01 0.261243 -1.20667

3 February 2024 10
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

Example

3 February 2024 11
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

Example

3 February 2024 12
BITS Pilani, Pilani Campus
Case Study
(Coal Fired Thermal Power Plant)

Inputs Outputs
Steam Flow (TPH) CO
Feed Water Flow
SA Flow
PA Flow
Furnace Temp
Flue Gas Temp (APH Outlet)
IDF Current
SAF Current
Steam Temp
Steam Pr

BITS Pilani, Deemed to be University under Section 3 of UGC Act, 1956


CHE F315 Machine Learning for Chemical Engineers

Case Study
(Coal Fired Thermal Power Plant)

BITS Pilani, Pilani Campus


CHE F315 Machine Learning for Chemical Engineers

Case Study
(Coal Fired Thermal Power Plant)
[m,n] = size(X);
average = mean(X);
stdv = std(X)
for j = 1:n
for i = 1:m
Xscaled(i,j) = (X(i,j) - average(j))/stdv(j);
end
end
covx = (Xscaled'*Xscaled)/(m-1);

BITS Pilani, Pilani Campus


CHE F315 Machine Learning for Chemical Engineers

Case Study
(Coal Fired Thermal Power Plant)
[evect,eval]=eig(covx);
eval = diag(eval);
[eval1,index] = sort(eval,'descend');
plot(eval1);
evect1 = evect(:,8:10);
modX = Xscaled*evect1;

3 February 2024 16
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

More datasets

UCI Machine learning repository


https://archive.ics.uci.edu/datasets

https://data.mendeley.com/

3 February 2024 17
BITS Pilani, Pilani Campus
CHE F315 Machine Learning for Chemical Engineers

3 February 2024
18 BITS Pilani, Pilani Campus

You might also like