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. Sentry 后端监控 - 最佳实践(官方教程)

    系列 1 分钟快速使用 Docker 上手最新版 Sentry-CLI - 创建版本 快速使用 Docker 上手 Sentry-CLI - 30 秒上手 Source Maps Sentry For ...

  2. 妙用 background 实现花式文字效果

    本文将讲解如何利用 background 系列属性,巧妙的实现一些花式的文字效果.通过本文,你将可以学到: 通过 background-size 与 background-position 实现酷炫的 ...

  3. %v的使用

    不同的类型,他们的默认的%v     一个变动的格式化字符串,相当于一个变量,遇到不同类型,就变形成不同的格式. 类型 %v bool %t int/int8/... %d uint/uint8/.. ...

  4. Linux的bg和fg和jobs和nohup命令简单介绍

    我们都知道,在 Windows 上面,我们要么让一个程序作为服务在后台一直运行,要么停止这个服务.而不能让程序在前台后台之间切换.而 Linux 提供了 fg 和 bg 命令,让我们轻松调度正在运行的 ...

  5. Selenium系列5-XPath路径表达式

    Xpath介绍 XPath 使用路径表达式在 XML 文档中进行导航 XPath 使用路径表达式来选取 XML 文档中的节点或者节点集.这些路径表达式和我们在常规的电脑文件系统中看到的表达式非常相似. ...

  6. K8s 开始

    Kubernetes 是用于自动部署,扩展和管理容器化应用程序的开源系统.本文将介绍如何快速开始 K8s 的使用. 了解 K8s Kubernetes / Overview 搭建 K8s 本地开发测试 ...

  7. ecshop调用商品的购买次数方法

    这时候我们修改一下 写成一个函数放到lib_goods.php 这样就可以随便调用了 --------------------------------------------------------- ...

  8. jmeter之命令行执行jmx脚本

    使用界面执行不稳定,且保存报告非常麻烦 https://www.jb51.net/article/191367.htm 作者:Anthony_tester 来源:CSDN 原文:https://blo ...

  9. nginx 添加ssl证书

    第一步: 获取linux的证书格式  .crt  .key 第二步: 在nginx中default.conf中再添加一个server 第三步: 内容举例如下: server { #这里开始 liste ...

  10. django错误处理

    1.django.db.utils.OperationalError: no such table 意思:没有这个app应用对应的数据表的,可以用 python manage.py makemigra ...