Top Banner
Data processing in CĐKT
20

Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Jul 07, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Data processing in CĐKT

Page 2: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Pattern recognition - Applications

Page 3: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Function approximation/regression –

Xấp xỉ hàm hay Phương pháp hồi quy

Đặt vấn đề: Tìm quy luật thay đổi của áp

suất chỉ thị bình quân theo thời gian

Time 8105 8141 8230 8231 8232 8233 8824 8825 9077 9079 Pi (bar) 9.97 9.14 8.97 9 9.05 8.65 8.3 8.5 8.74 8.41

Page 4: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Ý tưởng ban đầu: Data plot

0 1000 2000 3000 4000 5000 6000 7000

5

5.5

6

6.5

7

7.5

8

8.5

9

9.5

10

Time (h)

Mean indic

ate

d p

ressure

(bar)

Pi

Page 5: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Matching function – Phương pháp bình

phương bé nhất (least square)

Tìm hàm số y = f(x) mô tả tốt nhất quan hệ

giữa 2 biến rời rác (bậc nhất y = a0 + a1x)

Page 6: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Matching function – Phương pháp bình

phương bé nhất (least square)

Xác định sai số bình phương (khoảng cách)

Với điều kiện cực tiểu

2

1

ˆmin)min(

n

i

ii yyR

Page 7: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Matching function – Phương pháp bình

phương bé nhất (least square)

Linear model

1000 2000 3000 4000 5000 6000

5

5.5

6

6.5

7

7.5

8

8.5

9

9.5

10

Time (h)

Mea

n in

dica

ted

pres

sure

(ba

r)

Pi vs. Time

fit 1

Linear model Poly1:

f(x) = p1*x + p2

Coefficients (with 95% confidence

bounds):

p1 = -3.546e-005 (-0.0001329, 6.2e-005)

p2 = 8.944 (8.466, 9.421)

Goodness of fit:

SSE: 62.57

R-square: 0.007053

Adjusted R-square: -0.006365

RMSE: 0.9195

Page 8: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Matching function – Phương pháp bình

phương bé nhất (least square)

Loại bỏ outliers (data exclusion)

1000 2000 3000 4000 5000 6000

5

5.5

6

6.5

7

7.5

8

8.5

9

9.5

10

Time (h)

Mea

n in

dicat

ed p

ress

ure

(bar

)

Pi vs. Time

Outliers exclusion

Linear model Poly1:

f(x) = p1*x + p2

Coefficients (with 95% confidence bounds):

p1 = -1.988e-005 (-6.357e-005, 2.38e-005)

p2 = 9.088 (8.875, 9.301)

Goodness of fit:

SSE: 11.21

R-square: 0.01181

Adjusted R-square: -0.002511

RMSE: 0.4031

Page 9: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Matching function – Phương pháp bình

phương bé nhất (least square)

Sai số bình phương (Residuals)

1000 2000 3000 4000 5000 6000

5

6

7

8

9

10

Data and Fits

1000 2000 3000 4000 5000 6000-1.5

-1

-0.5

0

0.5

1Residuals

Pi vs. Time

Outliers exclusion

Outliers exclusion

Page 10: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Lựa chọn dữ liệu chẩn đoán Hệ số tương quan (correlation coefficient)

Ví dụ: Cho tập dữ liệu, hỏi chủng có liên quan gì đến nhau

không?

x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17

44 1,2 363 360 366 340 357 340 452 352 215,8 21,6 115 45 3860 19 26 44 1,24 367 365 370 354 363 347 453 352 205,3 22 118 44 3780 17 27

45 1,32 362 360 380 349 373 368 461 352 214,9 22,1 112 45 3910 6 18,5 45 1,32 364 359 367 346 356 343 447 347 218,2 22,2 115 44 3850 17 26 44 1,2 365 355 371 345 359 348 461 360 210,7 21,6 112 45 3430 19 27 44 1,3 368 362 371 340 361 346 454 351 218,4 22,3 122 45 3910 21 29 45 1,3 360 359 366 336 362 345 450 347 217,2 22,1 112 45 3820 10 24 44 1,3 359 351 366 361 366 353 454 349 218,2 22,3 116 45 3870 11 24,5 45 1,3 367 362 365 365 363 345 458 354 217,7 22,4 123 45 3970 20 30

Page 11: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Ma trận hệ số tương quan

Colum

n 1 Colum

n 2 Colum

n 3 Colum

n 4 Colum

n 5 Colum

n 6 Colum

n 7 Colum

n 8 Colum

n 9 Column 10

Column 11

Column 12

Column 13

Column 14

Column 15

Column 16

Column 17

Column 1 1,00 Column 2 0,41 1,00 Column 3 0,67 -0,23 1,00 Column 4 0,65 -0,32 0,92 1,00 Column 5 0,65 -0,32 0,90 0,96 1,00 Column 6 0,38 -0,42 0,56 0,74 0,71 1,00 Column 7 0,59 -0,33 0,81 0,92 0,92 0,78 1,00 Column 8 0,56 -0,36 0,83 0,91 0,94 0,75 0,88 1,00 Column 9 0,56 -0,42 0,84 0,96 0,92 0,80 0,90 0,92 1,00

Column 10 0,31 -0,60 0,75 0,87 0,81 0,75 0,80 0,83 0,95 1,00

Column 11 0,54 0,66 0,14 0,06 0,00 -0,09 -0,04 0,01 0,06 -0,06 1,00

Column 12 0,80 0,76 0,28 0,20 0,19 0,07 0,20 0,12 0,10 -0,14 0,75 1,00

Column 13 0,75 0,14 0,65 0,71 0,62 0,62 0,71 0,55 0,66 0,50 0,41 0,66 1,00

Column 14 0,41 -0,22 0,63 0,67 0,59 0,53 0,62 0,50 0,65 0,61 0,05 0,13 0,53 1,00

Column 15 0,82 0,55 0,46 0,43 0,40 0,24 0,33 0,37 0,37 0,17 0,79 0,83 0,66 0,17 1,00

Column 16 0,33 -0,51 0,68 0,80 0,70 0,79 0,78 0,65 0,82 0,82 -0,10 0,01 0,73 0,64 0,14 1,00

Column 17 0,35 -0,46 0,64 0,77 0,67 0,80 0,79 0,64 0,81 0,80 -0,04 0,07 0,78 0,62 0,18 0,98 1,00

Page 12: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Data pre-processing

Standardization

Các biến dữ liệu có đơn vị và độ lớn khác

nhau có thể so sánh với nhau

Page 13: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Data pre-processing

Smoothing (moving average)

Giúp loại bỏ ảnh hưởng của nhiễu

Page 14: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Function approximation with

neural network

c d li u

D li u

đ u o

D li u

đ u ra

Nh

n

ng

Page 15: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Function approximation with

neural network Thông sô đ u o Thông sô đ u ra

Vi tri thanh răng, h Vong quay đông cơ, n

Nhi t đô nươc l m mat o, tnv Công suât co ich, Ne

Nhi t đô u bôi trơn o, tdv Nhi t đô khi xa , tkx

Nhi t đô không khi n p, ts Nhi t đô nươc l m mat ra, tnr

Ap suât không khi n p, ps Nhi t đô u bôi trơn ra, tdr

Tồn tại quan hệ hàm số: outputs = f (inputs)

Không tuyến tính, đa chiều

Không giải được bằng toán học truyền thống

Page 16: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Function approximation with

neural network

Training data set

Cross-validation data

Testing data set

Chuẩn bị, xử lý dữ

liệu

Lựa chọn cấu trúc

mạng và điều kiện đầu

Huấn luyện mạng

Kiểm tra mạng

đã huấn luyện

Sử dụng để nhận dạng

dữ liệu mới

Yes

No

Page 17: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Training/Cross-validation errors

L i huân luy n

S lư t huân luy n

ư ng trên: L i huân luy n

ư ng dươi: L i ki m tra ch o

Page 18: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Kết quả tính toán trên mô hình

0 10 20 30 40 50 60 70 80 90 100320

340

360

380

400E

xh.

gas t

em

p.

0 10 20 30 40 50 60 70 80 90 100-10

-5

0

5

10

% P

ridic

tion e

rror

desired

output

Page 19: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Bài tập thực hành

Cho bảng số liệu áp suất chỉ thị bình quân

theo thời gian

Pi 9.97 9.14 8.97 9 9.05 8.65 8.3 8.5 8.74 8.41 9.05 9.21 9.27 9.3 9.28

Time 105 141 230 231 232 233 824 825 1077 1079 1135 1137 1139 1171 1172

Pi 9.52 8.91 4.84 9.25 9.36 9.28 9.25 9.7 9.25 8.87 9.5 8.86 9.15 8.7 8.51

Time 1469 1603 1800 2168 2474 2899 3302 3480 3830 4019 4556 5179 5362 5365 5386

Pi 7.74 9.05 9.1 9.03 8.85 8.72 6.15 6.16 9.3 9.28 9.13 9.13 8.88 8.79 8.8

Time 5388 5458 5482 5483 5484 5485 5578 5579 5635 5636 5640 5641 5712 5713 5714

Pi 8.75 8.08 8.55 8.58 9.21 9.24 9.01 9.38 9.12 9.8 9.02 9 9.07 9.03 7.85

Time 5716 5718 5782 5783 5801 5809 5833 5834 5883 5887 5911 5912 5913 5930 5936

Pi 6.55 5.05 9.22 9.3 9.27 9.15 9 9.34 9.12 9.22 9.22 8.85 8.91 9.02 9.04

Time 5940 5963 5980 5981 6072 6073 6078 6178 6179 6351 6352 6483 6486 6535 6536

Page 20: Data processing in CĐKTscholar.vimaru.edu.vn/sites/default/files/diemphd/files/...Matching function – Phương pháp bình phương bé nhất (least square) Loại bỏ outliers

Matlab curve fitting

Sử dụng MATLAB Curve fitting toolbox để

tìm quy luật thay đổi

Các chức năng fitting cơ bản;

Lọc dữ liệu (data smoothing, outliers

exclusion, robust fit)