Machine Learning Notes II

本文主要探讨了机器学习中的分类问题,重点介绍了二元分类、假设表示法、使用Sigmoid函数进行决策边界划分的方法,以及如何通过梯度下降法来最小化代价函数。此外,还讨论了多类别分类及正则化技术,用以解决过拟合和欠拟合问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Machine Learning Notes II

1.Classification

Focus on Binary classification problem

  • Hypothesis representation
    using Sigmoid Function,also called logistic function
    Sigmoid function
    The function looks like this->
    func image
    what needs to be emphasized is that z here is the theta’s transpose multiplies X.(Actually,this depends on the input of your X and theta, you can refer to the formula in the past when we talked about the linear regression)
  • Decision Boundary
    for simple decision boundary, it may looks like this->
    decision image
    Combine the hypothesis function with this image, we can find that:
    if z>=0, then h>=0.5 (which means it’s admitted)
    else(z<0), then h<0.5 (which means it’s not admitted)
  • Cost function
    Classification cost func
  • Gradient Descent
    The general form of gradient descent is->
    gradient descent
    Attention: You can find that the gradient descent here is almost the same as the way we used for linear regression. However, they are different, and the only difference is function h.

2.Multi-class Classification

Instead of y={0,1}, we’ll expend our definition so that y={0,1,..,n}.The way we solve it is dividing the problems into n+1 classificaiton problems.

3.Regulation

  • The problem of overfitting && underfitting
    overfitting image
    From the image above, we can see that the second pic is the right func we want.If the h is too simple or too complicated, func won’t perform well(which means the predictions are not so well).
    Underfitting, or high bias, is when the form of our hypothesis function h maps poorly to trend of the data, which is usually caused by a function that is too simple or uses too few features.
    For overfitting, or high variance,is caused by a hypothesis functionthat fits the avaliable data but doesn’t generalize well to predict data. It’s usually caused by a comlicated fucntion that creates a lot of unnecessary curves and angles unrelated to the data.
  • Use regularization to solve this problem
    Keep all the features but reduce the magnitude of parameters theta.
    • cost function with regularization
      cost function with regularization
      Attention: theta here must begin from 2,and the 1 means theta 0,which isn’t regularized.
    • Gradient descent
      Opps
    • For normal equation
      To add in regularization, the equation is the same as the orignal, except that we add another term inside the paratheses:
      opps
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值