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 ...
随机推荐
- HTML+CSS设计个人主页
在个人主页的设计中,我采用了圣代布局和div分块.效果图如下: <!DOCTYPE html> <html lang="en"> <head> ...
- 【C++周报】第一期2021-8-1
[C++周报]第一期 2021-8-1 这一期我们来看这道题目:https://vijos.org/p/1058 这道题是一道非常好的模拟题.题目如下: 描述 我们用文本处理器来处理一个特殊的文本文件 ...
- discuz连接微博登陆,第三方登录
首先记一下discuz的ucenter的架构: ucenter 是用户中心.其他的应用都是和ucenter连接,包括discuz也是ucenter的一个应用(默认的); 第一步: 在ucenter新建 ...
- ecshop商品批量上传之EC助理1.28支持ECshop2.7.3方法
目前官方随着ECShop V2.73的发布也发布了相对应的EC助理1.30版.默认EC助理1.28也支持到ECShop V2.72,要想让EC助理1.28也支持到ECShop V2.73,那要了解EC ...
- vue.js 配置axios 用来ajax请求数据
* 用npm 安装 axios 切换到项目的根目录 npm install --save axios vue-axios * 在vue的入口文件./src/main.js 中引入axios, 添加2行 ...
- 配置阿里云maven
在安装好Maven之后,默认的~/.m2目录下是没有maven仓库配置文件settings.xml的,默认使用的是官方的仓库,访问速度会非常慢,我们需要配置下国内的仓库. 创建~/.m2/settin ...
- file_get_contents('php://input') 数据如何转换成数组
前台表单页:demo01.html 后台:demo01.php 输出结果: 备注:若前台通过Ajax的post提交过来的是json数据,需要对json数据进行解析:$data = json_decod ...
- P4001-[ICPC-Beijing 2006]狼抓兔子【对偶图】
正题 题目链接:https://www.luogu.com.cn/problem/P4001 题目大意 给出一个类似于 的网格图,求起点到终点的最小割. 解题思路 最小割直接跑网络流,然后发现\(di ...
- 深入浅出WPF-06.Binding(绑定)02
Binding对数据的校验和转换 1)数据校验,通过Binding的ValidationRules属性(Collection类型)进行校验.可以设置多个数据校验条件. <Slider Margi ...
- 实验2:Open vSwitch虚拟交换机实践
作业链接:实验2:Open vSwitch虚拟交换机实践 一.实验目的 能够对Open vSwitch进行基本操作: 能够通过命令行终端使用OVS命令操作Open vSwitch交换机,管理流表: 能 ...


