Machine Learning ---- Feature Scaling

目录

 一、What is feature scaling::

二、Why do we need to perform feature scaling?

三、How to perform feature scaling:

        1、Normalization:

        2、Mean normalization:

        3、Standardization (data needs to follow a normal distribution):


 一、What is feature scaling:

        Simply put, it is the process of normalizing the units of data, which results in significant differences in the non unit values of various data in the training dataset. However, we use normalization and other methods to stabilize the data range within a relatively small area.

二、Why do we need to perform feature scaling?

        I have read many articles, and it's like how we often have a one-sided understanding of something due to its overly prominent side. For the more valuable side, we unconsciously lean towards the past. It is best for us to understand this point from a contour map:

        Using the example said by Andrew Ng, let's assume that his housing price prediction is:

Total square meter: 300 square meters~2000 square metersNumber of rooms: 1 to 5
w_1 = 50w_2 = 0.1
w_1 = 0.1w_2 = 50

        Meanwhile, assuming b=50, for a 2000 square meter, 5-room house, the normal price would be 500000 yuan:

        At the same time, assuming b=50, for a 2000 square meter, 5-room house, the normal price is 500000 yuan. Therefore, when we bring in two different groups of w1 and w2 in the list, we can find that the factor with the larger value is: the total square * 50+room * 0.1, which gives a value of about 100000 yuan, while the other group is about 500000 yuan.

        We can find that we prefer a smaller value with a larger corresponding coefficient. So, what is the relationship between this and gradient descent?

        We can understand it from the contour map:

        This is a contour map of J(\vec{w},b)  ,So we can take a look at how gradient descent may go if it needs to reach its minimum point:

        Due to the short axis range corresponding to size and the long axis corresponding to room, in order to obtain a minimum value that satisfies the condition through gradient descent, this situation may occur, leading to slower convergence. That's why we need to perform feature scaling, and if the image is not an ellipse but a circle, its effect is the best case.

        At the same time, we can also combine Euclidean distance for understanding

三、How to perform feature scaling:

        1、Normalization:

x^{'} = \frac{x - min(x)}{max(x) - min(x)}

        The corresponding value range is [0,1], but there are also more flexible forms:

x^{'} = a + \frac{x - min(x)}{max(x) - min(x)}(b - a)

        The corresponding value range is [a, b]. Generally speaking, the values of a and b should not be too large or too small, and [-5, 5] are suitable.

        2、Mean normalization:

x^{'} = \frac{x - \bar{x}}{max(x) - min(x)}

        3、Standardization (data needs to follow a normal distribution):

x^{'} = \frac{x - \bar{x}}{\sigma }

        The denominator corresponds to the standard deviation of x, which is actually the standardized formula for a normal distribution:

x^{'} = \frac{x - \mu}{\sigma }

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/467431.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

salesforce生产环境如何删除触发器

由于生产环境不能直接删除触发器,所以需要在sandbox中先让触发器inactive再部署到生产环境,就可以让触发器失效了。

人物百度百科如何创建?人物类词条编辑指南

创建人物百度百科是一项既具有挑战性的工作。下面,伯乐网络传媒就来给大家详细介绍如何创建人物百度百科,包括准备工作、创建步骤以及常见问题解答。 一、创建人物百度百科的准备工作 1. 人物百科词条创建要求 百度百科对创建人物词条有一定的要求&…

谷歌google adsense广告申请提示:网站已下线或无法访问

自己在运营网站时,想在网站上挂google adsense广告,但是申请很多次,收到的邮件都是您需要先纠正一些问,登陆google adsense后台显示,网站已下线或无法访问。 重新申请多次问题依旧,我在想为什么国外无法访…

Python命名空间和作用域,让你的代码逻辑更清晰!

关于Python,我们前面的基础部分,基本也说完了,包括我们也讲了高阶特性,面向对象编程。现在我来补充一个知识:命名空间和作用域。 这是Python两个重要的概念,它们决定了变量的可见性和访问范围。理解命名空…

2023新版mapinfo美化电子地图 新版2013Arcgis shp电子地图 下载

2023新版MapInfo和电子地图美化,以及2013版ArcGIS的SHP电子地图设计,是地理信息系统(GIS)领域中的两个重要话题。下面将分别对这两个主题进行描述。 样图: 链接:https://pan.baidu.com/s/1WB4AGsycyBGagVq5…

React Hooks全部总结

Hooks 概念理解 学习目标: 理解 Hooks 的概念及解决的问题 什么是 hooks hooks 的本质: 一套能够使函数组件更强大、更灵活的(钩子) React 体系里组件分为类组件和函数组件 多年使用发现,函数组件是一个更加匹配 Rea…

百度百科词条创作技巧分享,提高创建成功率

我们在百度引擎上搜索一些品牌,很快就能看到品牌的百科内容。我们也可以通过百科快速了解品牌的方方面面,也可以相信品牌有很强的实力。从这几点来看,朋友们可以知道百科词条的重要性,我们可以在以下时间继续了解相关的事情。 1、…

【OceanBase诊断调优】—— 敏捷诊断工具obdiag一键分析OB集群日志设计与实践

最近总结一些诊断OCeanBase的一些经验,出一个【OceanBase诊断调优】专题,也欢迎大家贡献自己的诊断OceanBase的方法。 1. 前言 obdiag定位为OceanBase敏捷诊断工具。1.2版本的obdiag支持诊断信息的一键收集,光有收集信息的能力,…

蓝桥杯单片机快速开发笔记——PCF8591电压信号探测器(可调电阻Rb2电压)和采样光敏电阻

一、原理图 此处考点分析:可能会在引用iic文件时需要自己在头文件定义SCL/SDA sbit sda P2^1; sbit scl P2^0; 二、思维导图 三、代码示例 #include "iic.h" #include "smg.h"unsigned int adc1_value 0; //AIN1的采样数据 float adc…

2024,这些优质可视化大屏素材,承包你一整年的可视化项目

可视化设计一直以来是个难题。如果不知道方法论、没有相关资源,那即使熬了几个大夜,掉了一地头发,设计出来了的东西也只会落个遭人嫌弃的下场。 所以,为了帮助大家提高可视化开发效率,快速制作出美观的可视化效果&…

luceda ipkiss教程 63:器件端口延伸ExtendPorts

案例分享:通过picazzo3库中的ExtendPorts函数实现器件的端口延伸 如: 所有代码如下: from si_fab import all as pdk from ipkiss3 import all as i3 from picazzo3.container.extend_ports import ExtendPorts# Building the MMI PCell wi…

C语言例:整型常量025,求解十进制和十六进制

1. 八进制数的每一位乘以对应的权值(8的幂),然后将结果相加,得到十进制数。 025 21 2.八进制先转二进制(一变三),再二进制转十六进制(四合一) 025 0001 0101 0…

Unity类银河恶魔城学习记录11-1 p103 Item源代码

Alex教程每一P的教程原代码加上我自己的理解初步理解写的注释,可供学习Alex教程的人参考 此代码仅为较上一P有所改变的代码 【Unity教程】从0编程制作类银河恶魔城游戏_哔哩哔哩_bilibili ItemData.cs using System.Collections; using System.Collections.Generi…

vue3+ts动态表单渲染,antd的useForm改造

let fieldList: any getFormFields(fieldInfo.coreNavigationList[0].list[0].list,fieldInfo.positionCodeRespVO,isCanBeUpdateProcess.value,isDetail.value 1); fieldInfo数据格式: {"name": "默认模板","status": "ENA…

03、判断和循环

三、判断与循环 文章目录 三、判断与循环顺序结构分支结构If语句在程序中就是用来判断的switch 循环结构forwhiledo while 顺序结构 顺序结构是Java程序默认的执行流程,按照代码的先后顺序,从上到下依次执行。 分支结构 If语句在程序中就是用来判断的 …

opc客户端

支持opc,da,ua通信(匿名登陆及用户登陆) 支持批量节点数据监听,当数据有变化时更新 支持单个节点读取和写入 KeepServer做为modbus server keepserver通信配置 https://blog.csdn.net/xiaochenXIHUA/article/detail…

高通推出第三代骁龙8s移动平台,首款终端预计将于3月面市

2024年3月18日,圣迭戈——高通技术公司今日宣布推出第三代骁龙8s移动平台,为更多Android旗舰智能手机带来骁龙8系平台上最广受欢迎的特性,实现非凡的顶级移动体验。这款全新旗舰级平台的主要特性包括支持强大的终端侧生成式AI功能、始终感知的…

操作系统核心知识点大梳理

计算机结构 现代计算机模型是基于-冯诺依曼计算机模型 计算机在运行时,先从内存中取出第一条指令,通过控制器的译码,按指令的要求,从存储器中取出数据进行指定的运算和逻辑操作等加工,然后再按地址把结果送到内存中去…

【Leetcode-21合并两个有序链表】

题目详情: 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例 1: 输入:l1 [1,2,4], l2 [1,3,4] 输出:[1,1,2,3,4,4]示例 2: 输入:l1 [], l2 […

由浅到深认识C语言(4):数组

该文章Github地址:https://github.com/AntonyCheng/c-notes 在此介绍一下作者开源的SpringBoot项目初始化模板(Github仓库地址:https://github.com/AntonyCheng/spring-boot-init-template & CSDN文章地址:https://blog.csdn…
最新文章