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 ...
随机推荐
- LeetCode通关:连刷十四题,回溯算法完全攻略
刷题路线:https://github.com/youngyangyang04/leetcode-master 大家好,我是被算法题虐到泪流满面的老三,只能靠发发文章给自己打气! 这一节,我们来看看回 ...
- project read error(项目读取错误)
maven的pom文件出现project read error 1,打开电脑cmd操作界面,在cmd界面找到打开出错项目的文件夹; 比如我的项目文件夹在D:\>eclipse-jee-file\ ...
- 在C++11编译环境中,简单自测了一下C++标准库中的string/vector和迭代器,记录一下
#include <iostream> #include <vector> using namespace std; int main() { //////////////// ...
- Jmeter系列(34)- Jmeter优化常识
Jmeter UI页面是调试脚本的,运行脚本使用命令行运行:Windows使用batch,Linux使用shell Jmeter减少使用各类监听控件,吃内存.CPU:用后置处理去拿log文件,生成图表 ...
- linux中如何查看文件上下文
grep -C 10 keyword catalina.out filename https://blog.csdn.net/weixin_34791683/article/details/11660 ...
- spy++查找窗口句柄
spy++可以用来查找桌面程序(c/s)的窗口句柄,实现自动化测试. def find_idxSubHandle(pHandle, winClass, index=0): ""&q ...
- Win10删除电脑3D对象等7个文件夹
把下面几个注册表项依次删除掉 "图片"文件夹:[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Expl ...
- 鸿蒙内核源码分析(编译环境篇) | 编译鸿蒙看这篇或许真的够了 | 百篇博客分析OpenHarmony源码 | v50.06
百篇博客系列篇.本篇为: v50.xx 鸿蒙内核源码分析(编译环境篇) | 编译鸿蒙防掉坑指南 | 51.c.h.o 编译构建相关篇为: v50.xx 鸿蒙内核源码分析(编译环境篇) | 编译鸿蒙防掉 ...
- 面试官问:App测试和Web测试有什么区别?
WEB 测试和 App 测试从流程上来说,没有区别.都需要经历测试计划方案,用例设计,测试执行,缺陷管理,测试报告等相关活动. 从技术上来说,WEB 测试和 APP 测试其测试类型也基本相似,都需要进 ...
- FastAPI(44)- 操作关系型数据库
ORM FastAPI 可与任何数据库和任何样式的库配合使用并和数据库通信 object-relational mapping 对象关系映射 ORM 具有在代码和数据库表(关系)中的对象之间进行转换( ...


