KKB_python_scratch_framework_sumup_lesson1

M IT Code is for people to review, and runs sometimes.

Review

1. Corralation, salient feature

COV(X,Y) = E(X-E(X)*(Y-E(Y)))
r(X,Y) = COV(X,Y)/(STD(X)*STD(Y)) == CORR

2. Machine Learning

2.1 Computational intelligence
2.2 Perceptual intelligence
2.3 Cognitive intelligence

3. K-Neighbor-Nearest(Lazy learning)

items = Sort(square(input - X)) 
yhat = mean(items(top_k))

4 function Fitting

4.1 Calculus
4.2 Random Iteration Get Best K and B(MonteCarlo Simulation)
  min_loss = +inf
  do 
      loss_ = MSE(Y, X * random_k + random_b)
      if loss_ < min_loss:
          min_loss = loss_
          best_k = random_k
          best_b = random_b
  while(1)        

5. Loss

5.1 Mean Square Error(MSE)
Partial of MSE:
 dL/dk = 2 * mean((yi - xi * k + b) * (-xi))
 dL/db = 2 * mean((yi - xi * k + b) * (1))

6. Gradient Descent

 k = k + (-1) * dL/dk
 b = b + (-1) * dL/db

7. Performance of Gradient Descent

 yhat1 = k * x + b ( < 1ns)
 yhat2 = knn(x) (~= 1ms)
 yhat2 is 1e6 times of yhat1 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值