1、Model representation

  • Our Training Set [训练集]:

  • We will start with this ‘’Housing price prediction‘’ example first of fitting linear functions, and we will build on this to eventually have more complex models

2、Cost function

  • 代价函数(平方误差函数):It figures out how to fit the best possible straight line to our data
  • So how to choose θi's ?

  • and just try:

  • The parameters we choose determine the accuracy of the straight line we get relative to our training set
  • But there is modeling error 建模误差

  • Our goal is to select the model parameters that minimize the sum of squares of modeling errors

  • That is to minimize the cost function!

  • summary:

2-1、Cost function introduction I

  • We look up some plots to understand the cost function

2-2、Cost function introduction II

  • Let's take a look at the three-dimensional space diagram of the cost function(also called a convex function 凸函数)

  • And here is an example of a contour figure:

  • The contour figure is a more convenient way to visualize the cost function

3、Gradient descent

  • It turns out gradient descent(梯度下降) is a more general algorithm and is used not only in linear regression. I will introduce how to use gradient descent for minimizing some arbitrary function J
  • The formula of the batch gradient descent algorithm :

4、Gradient descent intuition

  • Derivative term purpose :get closer to the minimum

  • Learning rate α

  • But what if my parameter θ1 is already at a local minimum?
  • Gradient descent can converge to a local minimum, even with the learning rate α fixed

5、Gradient descent for linear regression

Machine learning(2-Linear regression with one variable )的更多相关文章

  1. Machine Learning No.1: Linear regression with one variable

    1. hypothsis 2. cost function: 3. Goal: 4. Gradient descent algorithm repeat until convergence { (fo ...

  2. [Machine Learning] 多变量线性回归(Linear Regression with Multiple Variable)-特征缩放-正规方程

    我们从上一篇博客中知道了关于单变量线性回归的相关问题,例如:什么是回归,什么是代价函数,什么是梯度下降法. 本节我们讲一下多变量线性回归.依然拿房价来举例,现在我们对房价模型增加更多的特征,例如房间数 ...

  3. Fast and accurate bacterial species identification in urine specimens using LC-MS/MS mass spectrometry and machine learning (解读人:闫克强)

    文献名:Fast and accurate bacterial species identification in urine specimens using LC-MS/MS mass spectr ...

  4. 机器学习---最小二乘线性回归模型的5个基本假设(Machine Learning Least Squares Linear Regression Assumptions)

    在之前的文章<机器学习---线性回归(Machine Learning Linear Regression)>中说到,使用最小二乘回归模型需要满足一些假设条件.但是这些假设条件却往往是人们 ...

  5. 机器学习---用python实现最小二乘线性回归算法并用随机梯度下降法求解 (Machine Learning Least Squares Linear Regression Application SGD)

    在<机器学习---线性回归(Machine Learning Linear Regression)>一文中,我们主要介绍了最小二乘线性回归算法以及简单地介绍了梯度下降法.现在,让我们来实践 ...

  6. Andrew Ng Machine Learning 专题【Linear Regression】

    此文是斯坦福大学,机器学习界 superstar - Andrew Ng 所开设的 Coursera 课程:Machine Learning 的课程笔记. 力求简洁,仅代表本人观点,不足之处希望大家探 ...

  7. CheeseZH: Stanford University: Machine Learning Ex5:Regularized Linear Regression and Bias v.s. Variance

    源码:https://github.com/cheesezhe/Coursera-Machine-Learning-Exercise/tree/master/ex5 Introduction: In ...

  8. 机器学习之单变量线性回归(Linear Regression with One Variable)

    1. 模型表达(Model Representation) 我们的第一个学习算法是线性回归算法,让我们通过一个例子来开始.这个例子用来预测住房价格,我们使用一个数据集,该数据集包含俄勒冈州波特兰市的住 ...

  9. [笔记]机器学习(Machine Learning) - 01.线性回归(Linear Regression)

    线性回归属于回归问题.对于回归问题,解决流程为: 给定数据集中每个样本及其正确答案,选择一个模型函数h(hypothesis,假设),并为h找到适应数据的(未必是全局)最优解,即找出最优解下的h的参数 ...

  10. Machine Learning No.2: Linear Regression with Multiple Variables

    1. notation: n = number of features x(i) = input (features) of ith training example  = value of feat ...

随机推荐

  1. 除PerfDog之外,还有什么性能测试工具。

    除PerfDog之外,还有什么性能测试工具. 高通的Snapdragon Profiler 下载地址:https://developer.qualcomm.com/software/snapdrago ...

  2. Windows下安装程序时提示未安装Microsoft Net FrameWork 2.0

    问题描述 安装程序时碰到如下: 现在基本都是用win7.win10系统,缺少环境大多数都是因为系统没有启用. 解决方法 控制面板 - 程序 - 启用或关闭Windows功能 - 把第一项'NET Fr ...

  3. [第七篇]——Docker Hello World之Spring Cloud直播商城 b2b2c电子商务技术总结

    Docker Hello World Docker 允许你在容器内运行应用程序, 使用  docker run 命令来在容器内运行一个应用程序. 输出Hello world xxx@xxx:~$ do ...

  4. linux下分卷压缩,合并解压的3种方法

    我们上传东西的时候,由于文件过大而不能上传,或者不给上传,最明显的就是发邮件了,附件最大5M,有的10M.如果超过了就郁闷了.这个时候,如果能把压缩的东西,分割开来就比较爽了,windows下面我想大 ...

  5. minio & gitlab runner

    Docker安装Minio存储服务器详解 # mkdir -p /data/minio # docker pull nexus3:8089/minio/minio # docker run -p 90 ...

  6. go语言游戏服务端开发(三)——服务机制

    五邑隐侠,本名关健昌,12年游戏生涯. 本教程以Go语言为例.   P2P网络为服务进程间.服务进程与客户端间通信提供了便利,在这个基础上可以搭建服务. 在服务层,通信包可以通过定义协议号来确定该包怎 ...

  7. 【C++】特殊字符“\0”,以及NULL相关

    我们都知道,'\0'是字符串的结束标记.因此,执行这段代码: #include<bits/stdc++.h> using namespace std; int main(){ cout&l ...

  8. 解决idea debugger Frames are not available

    现象:idea2017.3.7 sofaboot项目debugger报错 Frames are not available. 之前好用,不知道为啥突然不能debugger,run能正常运行代码.如下图 ...

  9. 关于PHP数组Key的强制类型转换

    PHP是弱类型语言,就像JavaScript一样,在定义变量时,不需要强制指定变量的类型.同时,PHP又有着强大的数组功能,数组的Key即可以是普通的数字类型下标,也可以是字符串类型的Hash键值,那 ...

  10. CF587F-Duff is Mad【AC自动机,根号分治】

    正题 题目链接:https://www.luogu.com.cn/problem/CF587F 题目大意 给出\(n\)个字符串\(s\).\(q\)次询问给出\(l,r,k\)要求输出\(s_{l. ...