Machine learning(2-Linear regression with one variable )
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 )的更多相关文章
- Machine Learning No.1: Linear regression with one variable
1. hypothsis 2. cost function: 3. Goal: 4. Gradient descent algorithm repeat until convergence { (fo ...
- [Machine Learning] 多变量线性回归(Linear Regression with Multiple Variable)-特征缩放-正规方程
我们从上一篇博客中知道了关于单变量线性回归的相关问题,例如:什么是回归,什么是代价函数,什么是梯度下降法. 本节我们讲一下多变量线性回归.依然拿房价来举例,现在我们对房价模型增加更多的特征,例如房间数 ...
- 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 ...
- 机器学习---最小二乘线性回归模型的5个基本假设(Machine Learning Least Squares Linear Regression Assumptions)
在之前的文章<机器学习---线性回归(Machine Learning Linear Regression)>中说到,使用最小二乘回归模型需要满足一些假设条件.但是这些假设条件却往往是人们 ...
- 机器学习---用python实现最小二乘线性回归算法并用随机梯度下降法求解 (Machine Learning Least Squares Linear Regression Application SGD)
在<机器学习---线性回归(Machine Learning Linear Regression)>一文中,我们主要介绍了最小二乘线性回归算法以及简单地介绍了梯度下降法.现在,让我们来实践 ...
- Andrew Ng Machine Learning 专题【Linear Regression】
此文是斯坦福大学,机器学习界 superstar - Andrew Ng 所开设的 Coursera 课程:Machine Learning 的课程笔记. 力求简洁,仅代表本人观点,不足之处希望大家探 ...
- 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 ...
- 机器学习之单变量线性回归(Linear Regression with One Variable)
1. 模型表达(Model Representation) 我们的第一个学习算法是线性回归算法,让我们通过一个例子来开始.这个例子用来预测住房价格,我们使用一个数据集,该数据集包含俄勒冈州波特兰市的住 ...
- [笔记]机器学习(Machine Learning) - 01.线性回归(Linear Regression)
线性回归属于回归问题.对于回归问题,解决流程为: 给定数据集中每个样本及其正确答案,选择一个模型函数h(hypothesis,假设),并为h找到适应数据的(未必是全局)最优解,即找出最优解下的h的参数 ...
- 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 ...
随机推荐
- 使用Apache poi来编写导出excel的工具类
在JavaWeb开发的需求中,我们会经常看到导出excel的功能需求,然后java并没有提供操作office文档的功能,这个时候我们就需要使用额外的组件来帮助我们完成这项功能了. 很高兴Apache基 ...
- Verilog RTL优化策略(一):推荐使用assign语法替代if-else和case语法
参考 <手把手教你设计CPU--RISC-V处理器篇> 先给出不用if-else和case的原因 Verilog中的if-else和case语法存在两大缺点: 不能传播不定态X: 会产生优 ...
- Mybatis公司开发常用!
Mybatis核心 本文重点:注解开发,mybatis多表操作,动态SQL(WHERE,SET,IF,SQL-ID减少复用) 代码地址--https://gitee.com/zhangjzm/my-b ...
- HCNP Routing&Switching之路由过滤工具Filter-Policy
前文我们了解了路由控制技术中路由策略和路由匹配工具IP-Prefix相关话题,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/15314262.html:今天我们 ...
- 网站URL Rewrite(伪静态)设置方法
1.如果您的服务器支持.htaccess,则无需设置,网站根目录下的.htaccess已经设置好规则.规则详情:http://download.destoon.com/rewrite/htaccess ...
- Jmeter系列(27)- 常用逻辑控制器(6) | 如果(if)控制器If Controller
如果(if)控制器(If Controller) 在实际工作中,当使用JMeter做性能脚本或者接口脚本时,当遇到需要对不同的条件做不同的操作时,我们可以使用JMeter中if控制器来实现 if控制器 ...
- react 的一些学习资料
* react开发实战 (Pro React) https://github.com/apress/pro-react * react 配置好的环境https://github.com/bricksp ...
- php 扫描url死链接
* 从Packagist上搜索需要的包 https://packagist.org/ * 通过composer下载依赖包 composer require guzzlehttp/guzzle comp ...
- 接口测试checklist
静态测试 接口文档与设计文档对应 接口定义 接口定义与数据库定义 业务功能测试 系统全流程验证 逆向全流程验证 事务性测试 边界值测试 业务规则边界值 场景分析合理长度 场景分析合理数据量 输入.输出 ...
- Node.js Koa框架学习笔记
Koa 基本介绍 Koa是Node.js中非常出名的一款WEB框架,其特点是短小精悍性能强. 它由Express原版人马打造,同时也是Egg框架的设计蓝图,可以说Koa框架的学习性价比是非常高的. 官 ...


