---
# System prepended metadata

title: Machine learning cơ bản
tags: [Studing]

---

# Machine learning cơ bản
---
![](https://hackmd.io/_uploads/B12suFR-6.png)
### Đạo hàm tiến
Tính de/db. 
![](https://hackmd.io/_uploads/Hkd1AY0ZT.png =x300)
### Đạo hàm lùi (back propagation)
https://nttuan8.com/bai-4-backpropagation/
Tính de/db,de/da. 
![](https://hackmd.io/_uploads/SkYMAKAZp.png =x250)
Trường hợp này ta sẽ thấy tính de/da tiện hơn.

VD:
![](https://hackmd.io/_uploads/SJ0COK0ba.png =x400)
Đạo hàm cục bộ (màu đỏ) là hệ số.
Đạo hàm từng phần (màu xanh lá). Tổng của tất cả(đạo hàm từng phần tại điểm đến * đạo hàm cục bộ của điểm đến đó)
vd tại dy/db=dy/dd * dd/db + dy/de * de/db 
https://drive.google.com/drive/folders/1KDifaACbAuomUiyBsiZfN09gFoKa5iqo

BT logistic regression
![](https://hackmd.io/_uploads/r1qssK0ba.png =x150)
![](https://hackmd.io/_uploads/H18uiYAb6.png =x300)
![](https://hackmd.io/_uploads/Sy3tiKC-a.png)

## Linear regression model
![](https://hackmd.io/_uploads/SJ-0B8yMa.png =x200)
![](https://hackmd.io/_uploads/Hym4YUkz6.png =x300)
![](https://hackmd.io/_uploads/H1Vo08kzT.png)
### Polynomial ![](https://hackmd.io/_uploads/Sk_U1vkGT.png =x30)![](https://hackmd.io/_uploads/HkFPZvkGp.png =x200)

### Gaussian ![](https://hackmd.io/_uploads/H1PiJv1zT.png =x60)![](https://hackmd.io/_uploads/Sy6OWvyfa.png =x200)

### Sigmoid ![](https://hackmd.io/_uploads/r1iT1PJzp.png =x70)![](https://hackmd.io/_uploads/S119WDJG6.png =x200)

![](https://hackmd.io/_uploads/BJNjxDJMT.png =x250)

### Integer Encoding
![](https://hackmd.io/_uploads/SJUvTPyGp.png =x150)
### One-Hot Encoding
![](https://hackmd.io/_uploads/HJN8aDJzp.png =x150)

## Logistic Function
![](https://hackmd.io/_uploads/Byek2dkf6.png)
![](https://hackmd.io/_uploads/B1rx2_kGT.png)
![](https://hackmd.io/_uploads/r1gZh_yMT.png)
### Loss measure
![image.png](https://hackmd.io/_uploads/BkLgOTkQT.png)
![](https://hackmd.io/_uploads/S1LlauJG6.png =x140)
## Tree
Định lượng: last output là số.
Định tính: last output là loại.
### Entropy
![image](https://hackmd.io/_uploads/H1xVxbsm6.png =x50)
![image](https://hackmd.io/_uploads/SkBql-iQ6.png =x70)
![image](https://hackmd.io/_uploads/ry_E4bs7T.png =x140)

### Gini
![image](https://hackmd.io/_uploads/ry_MV-imp.png =x160)
### Misclassification
![image](https://hackmd.io/_uploads/ByIBP-jma.png =x150)
![image](https://hackmd.io/_uploads/SJ0AN-iQ6.png)
### Evaluating Association Rules
![image](https://hackmd.io/_uploads/BJ5P5sXE6.png =x150)

### Regression tree
![image](https://hackmd.io/_uploads/SJsi9iQVa.png =x200)
![image](https://hackmd.io/_uploads/HygkFboXa.png =x200)
-y: giá trị trung bình
e là độ lỗi % (có thể sai nếu -y~0)
cv: cross-validation

### Multivariate Trees
Tại một nút xài hơn nhiều 1 thuộc tính.
## Bayes
### Maximum likelihood
![image](https://hackmd.io/_uploads/B1dUSiH4a.png =x200)
![image](https://hackmd.io/_uploads/BJJaVjS46.png)
![image](https://hackmd.io/_uploads/ByU1SsH4T.png =x200)

## Language model
### Estimating N-Gram Probabilities
![image](https://hackmd.io/_uploads/r12ub3LrT.png =x200)
![image](https://hackmd.io/_uploads/r1AYfhLS6.png =x230)
![image](https://hackmd.io/_uploads/Sy6PihUBp.png =x200)
## AdaBoost
https://viblo.asia/p/adaboost-buoc-di-dau-cua-boosting-gAm5yrGwKdb
https://drive.google.com/drive/folders/1KDifaACbAuomUiyBsiZfN09gFoKa5iqo
https://scikit-learn.org/stable/auto_examples/ensemble/plot_adaboost_twoclass.html
![image](https://hackmd.io/_uploads/HkD4IFvra.png =x220)
![image](https://hackmd.io/_uploads/By_Y8Fwr6.png =x250)
![image](https://hackmd.io/_uploads/rJo0tItrT.png =x250)

## Atificial neural network (ANN)
### Activation
![image](https://hackmd.io/_uploads/HkdJ3T7Pp.png =x170)![image](https://hackmd.io/_uploads/Bk4E3pXDa.png =x200)
### Softmax
![image](https://hackmd.io/_uploads/Bkttha7D6.png =x250)

### Cost func
![image](https://hackmd.io/_uploads/Hy6a6TXw6.png =x120)
![image](https://hackmd.io/_uploads/ry0CT67wp.png =x100)

### AdaGrad
![image](https://hackmd.io/_uploads/HJc0lAmva.png =x250)
![image](https://hackmd.io/_uploads/rJH2bCXva.png =x200)
### Back propagation
![image](https://hackmd.io/_uploads/HkhRNCXPp.png =x200)
![image](https://hackmd.io/_uploads/Sk8yBR7Pa.png =x200)

![image](https://hackmd.io/_uploads/HysHfAXP6.png =x250)
![image](https://hackmd.io/_uploads/rkDhGRQPa.png =x350)![image](https://hackmd.io/_uploads/BkexmA7v6.png =x90)

## Convolution neutral network
https://www.youtube.com/watch?v=gv693bG9K98&t=2626s
![image](https://hackmd.io/_uploads/ByZhaDrnp.png)
![image](https://hackmd.io/_uploads/HyUsOkVP6.png =x200)

### Convolution
![image](https://hackmd.io/_uploads/SyOTIkVDp.png =x200)
P(Padding): thêm viền ngoài ảnh.
S(Strike): khoảng cách giữa 2 lần chiếu lên ảnh.
F(kernal size)

### Pooling
reduce the number of feature-map coefficients to process
![image](https://hackmd.io/_uploads/SyzyCJNvT.png =x150)
![image](https://hackmd.io/_uploads/B1epFAJVDT.png =x250)
![image](https://hackmd.io/_uploads/B1a4TvS36.png =x200)

### Một số mạng 
https://www.youtube.com/watch?v=gv693bG9K98&t=2626s
* VGG-16(nay đã có VGG-19)
* Inception(GoogleLeNet)
* ResNet
* Darknet-53
* 

## Tham khảo
https://drive.google.com/drive/folders/1kmCWMLzL5sez5RK4v4Q7jXjrVTcqDAVU
https://machinelearningcoban.com/2017/01/04/kmeans2/