方差偏差權衡_偏差偏差權衡:快速介紹

方差偏差權衡

The bias-variance tradeoff is one of the most important but overlooked and misunderstood topics in ML. So, here we want to cover the topic in a simple and short way as possible.

偏差-方差折衷是機器學習中最重要但被忽視和誤解的主題之一。 因此,在這里我們想以一種簡單而簡短的方式涵蓋這個主題。

Let’s start with basics and see why it is important and how this concept is to be used. We want to keep this crisp so we’ll talk in pointers at times. By the end of this, you would know:

讓我們從基礎開始,看看為什么它很重要以及如何使用此概念。 我們希望保持清晰,因此我們有時會談指針。 到此為止,您將知道:

  • Bias

    偏壓
  • Variance

    方差
  • Their relationship

    他們的關系
  • importance of their tradeoff

    權衡的重要性
  • how to analyze the model condition and take necessary steps

    如何分析模型條件并采取必要步驟

So what this Bias- Variance tradeoff exactly has to do with performance?

那么,這種偏差與偏差的權衡與性能究竟有什么關系呢?

You build a model. The model doesn’t perform well. You want to improve the performance but don’t know where to start.

您建立模型。 該模型的效果不佳。 您想提高性能,但不知道從哪里開始。

A diagnosis is important as it pin-points the areas of improvement. You need to clearly identify the components which are leading to a poor model.

診斷很重要,因為它可以指出需要改進的地方。 您需要清楚地識別導致模型不良的組件。

Issue: Bad model performance

問題 :模型性能不佳

Focus area for the fix: Prediction error

修復的重點領域:預測錯誤

Before jumping to the topic, just know this.

在跳到主題之前,請先知道這一點。

Total Error = Bias^2 + Variance + Irreducible error

Total Error = Bias^2 + Variance + Irreducible error

a. Total error = Prediction error that we are trying to minimize

一個。 總誤差 =我們試圖最小化的預測誤差

b. Bias error = Difference between the average prediction of model and the correct prediction

b。 偏差誤差 =模型的平均預測與正確預測之間的差異

c. Variance = Variability of a model prediction for a given data point (difference in results for the same data point if training data is changed).

C。 方差 =給定數據點的模型預測的方差 (如果更改訓練數據,則同一數據點的結果差異)。

d. Irreducible error = It is the inherent error of data which is caused by the distribution of data and other specification. It is just the way the data is and basically nothing can be done about it.

d。 不可減少的錯誤 =這是由數據的分布和其他規范引起的數據固有的錯誤。 這只是數據的方式,基本上它無法做任何事情。

Okay, these are formal definitions. How to visualize them and understand them in normal terms.

好的,這些是正式的定義。 如何可視化它們并以常規術語理解它們。

Goal — Low Bias, Low Variance

目標—低偏見,低方差

Image for post
Fig 1: Bias-Variance representation
圖1:偏差-方差表示

Let’s see each of the possible combinations and understand each of them practically with the above representation.

讓我們看一下每種可能的組合,并通過上述表示實際理解它們。

a. High Bias, high Variance: Worst Case- Results not close to the target(High Bias) and not even consistent in any direction(High variance).

一個。 高偏差,高方差: 最壞的情況-結果不接近目標(高偏差),甚至在任何方向上都不一致(高偏差)。

b. High Bias, low variance: Results not close to the target (High Bias) but consistent in one direction(Low Variance).

b。 高偏差,低方差:結果不接近目標(高偏差),但在一個方向上一致(低方差)。

c. Low Bias, high Variance: Results close to the target (Low Bias) but not consistent around the target(High Variance).

C。 低偏差,高方差:結果接近目標(低偏差),但在目標周圍(高方差)不一致。

d.Low Bias, low variance: Best Case- Results close to the target (Low Bias) and consistent around the target(Low Variance).

d。 低偏差,低方差: 最佳情況-結果接近目標(低偏差),并且在目標附近(低方差)保持一致。

Now the question is why it is a tradeoff. Why not simply go and get low bias low variance. This is because of the way bias and variance are related, each comes at the cost of other. When you try to improve one, the other gets worse. Like if you cook on low flame, it takes forever. You increase the flame, food starts burning. You have to find a point where both are balanced.

現在的問題是,為什么要進行權衡。 為什么不簡單地去獲得低偏差低方差。 這是因為偏差和方差之間是相關的,每個都以其他為代價。 當您嘗試改善一個時,另一個會變得更糟。 就像您在低火上烹飪一樣,它需要永遠。 您增加火焰,食物開始燃燒。 您必須找到一個平衡點。

Image for post
Fig. 2
圖2

Ideal model: Learns the underlying patterns in training data just optimally and creates a generalized algorithm that can work with similar unseen data as well.

理想模型:以最佳方式學習訓練數據中的基礎模式,并創建一種通用算法,該算法也可以處理相似的看不見的數據。

Overfitting: The model makes a very highly fitting algorithm tailored for the training data specifically. Thus, it cannot stand variations that come with unseen data.

過度擬合:模型針對訓練數據制定了非常適合的算法。 因此,它無法忍受看不見的數據帶來的變化。

An overfitting model can be understood as a “Frog in the well” who became too comfortable in the present scenario(training data) but its present understanding won’t help to survive a different surrounding(test data).

過度擬合模型可以理解為“井中的青蛙”,他在當前場景(訓練數據)中變得太自在了,但其目前的理解無助于在不同的環境中生存(測試數據)。

Underfitting: The model makes a very loose-fitting algorithm that can’t even work for the training data as it couldn’t learn the patterns as it oversimplified everything. Thus it cannot give correct answers.

欠擬合:模型提出了一種非常寬松的算法,該算法甚至不能用于訓練數據,因為它過于簡化了所有操作,因此無法學習模式。 因此,它不能給出正確的答案。

An underfitting model is a person who thinks he learned a skill by just taking the intro session and learning buzz words or he became a cricket player just because he knows how to hit a ball.

不稱職的模特是一個人,他認為自己只是通過參加入門課程并學習流行語來學習技能,或者僅僅因為他知道如何擊球而成為板球運動員。

You can read the detailed explanation below:

您可以閱讀以下詳細說明:

https://medium.com/analytics-vidhya/understanding-how-machine-learning-is-just-like-the-human-learning-process-801a0bca3e56

https://medium.com/analytics-vidhya/understanding-how-machine-learning-is-just-like-the-human-learning-process-801a0bca3e56

The goal was to build a model that gives-

目的是建立一個模型,使-

  • Right results most of the times.

    在大多數情況下,正確的結果。

Models with Overfitting have high variance and ones with Underfitting have a high bias.

具有過度擬合的模型具有較高的方差,而具有欠擬合的模型具有較高的偏差。

What do I keep in mind regarding these to solve them in real-time?

我要牢記這些以實時解決這些問題?

  • Identify whether your model suffers from overfitting or underfitting. Use the train-test accuracy of the model for this.

    確定您的模型是過度擬合還是擬合不足。 為此,請使用模型的訓練測試精度。
Image for post
  • Take measures as follows once the issue is identified.

    一旦發現問題,請采取以下措施。

a. Problem: High Variance(This will be solved the way overfitting is solved)

一個。 問題:高方差(將通過解決過度擬合的方式解決)

Let’s see each solution and how exactly it is solving the issue.

讓我們看看每種解決方案以及它如何解決問題。

  • Add more training data: You have learned very data specific. Here’s more data for increasing your general understanding so that it is no longer data specific.

    添加更多培訓數據 :您已經學到了非常具體的數據。 這里有更多數據可用于增強您的一般理解,從而不再是特定于數據的數據。

  • Data augmentation: I don’t have much data. Let me modify current data to create more variations and present them to you for your better understanding.

    數據擴充 :我沒有太多數據。 讓我修改當前數據以創建更多變體,然后將其呈現給您,以使您更好地理解。

  • Reduce the complexity of the model: You have learned unnecessary stuff. These specific details are not required. Retain only what can be applied everywhere and let go of rest to simplify.

    降低模型的復雜性 :您已經學到了不必要的東西。 這些特定的細節不是必需的。 僅保留可以在任何地方應用的內容,并放手休息以簡化操作。

  • Bagging(stands for Bootstrap Aggregating): You are giving different answers every time I change the training data a little. Let me randomly sample the data and give to you all the samples. You create predictors and train on each sample and get all the different results you can. Put together all learning by aggregating all the results and give me one final answer which will remain consistent.

    Bagging(代表B ootstrap Agg的注冊) :每次我稍微改變訓練數據,您都會給出不同的答案。 讓我隨機抽樣數據,然后給您所有樣本。 您可以創建預測變量并對每個樣本進行訓練,并獲得所有不同的結果。 通過匯總所有結果來匯總所有學習內容,并給我一個最終答案,它將保持一致。

Note: The different predictors need to have minimum correlation so that they make “different errors”(not to be confused with the model, we have 1 model having different predictors that gives results of different samples).

注意:不同的預測變量需要具有最小的相關性,以使它們產生“不同的誤差”(不要與模型混淆,我們有1個具有不同預測變量的模型可以得出不同樣本的結果)。

b. Problem: High Bias(This will be solved the way underfitting is solved).

b。 問題 :高偏差(這將通過解決欠擬合的方式解決)。

  • Add features: You gave a result that Person A won’t be able to repay the loan because he is old(feature). You are saying this because an old Person B couldn’t repay it. But you also need to see their annual income, past history, etc(other features) and then decide.

    添加功能:您得出的結果是,人A由于年齡大(功能)而無法償還貸款。 您之所以這樣說,是因為老人B無法償還。 但是,您還需要查看他們的年收入,過去的歷史記錄等(其他功能),然后做出決定。

  • Use a model with higher complexity: We need to replace you with someone who can understand the relation between different parts of data and how they work together better than you.

    使用具有更高復雜性的模型:我們需要以能夠理解數據不同部分之間的關??系以及它們如何更好地協同工作的人來代替您。

  • Boosting: I don’t trust you. You create predictors and ask them each to answer. We’ll ask each predictor about the logic they used to get their partially right answers. Whenever we get some part right, we’ll add that logic in the rule. Each one will have their shortcoming but together, they will cover up for each other. They’ll work as a team to finally create a well-fitting complex rule.

    提振:我不相信你。 您創建預測變量,并要求它們各自回答。 我們將詢問每個預測變量有關他們用來獲得部分正確答案的邏輯。 每當我們得到正確的部分時,我們都會在規則中添加該邏輯。 每個人都會有自己的缺點,但是他們會互相掩蓋。 他們將作為一個團隊工作,以最終創建一個合適的復雜規則。

Note: The team of weak learners should have a minimum correlation between them, otherwise everyone would have the right answers for the same sections and some sections will be left answered incorrectly.

注意:弱學習者團隊之間的相關性應最低,否則每個人對相同部分的回答都是正確的,而某些部分的回答將不正確。

Hope this helped to understand the topic and gave the understanding to leverage the concept as well.

希望這有助于理解該主題,并給予理解以利用該概念。

Let us know your feedback. Thanks for reading!

讓我們知道您的反饋。 謝謝閱讀!

Sources:

資料來源:

Fig 1, Fig 2: http://scott.fortmann-roe.com/docs/BiasVariance.html

圖1,圖2: http : //scott.fortmann-roe.com/docs/BiasVariance.htm

翻譯自: https://medium.com/analytics-vidhya/bias-variance-tradeoff-a-quick-introduction-a4b55e56fa24

方差偏差權衡

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/391343.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/391343.shtml
英文地址,請注明出處:http://en.pswp.cn/news/391343.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

win10 uwp 讓焦點在點擊在頁面空白處時回到textbox中

原文:win10 uwp 讓焦點在點擊在頁面空白處時回到textbox中在網上 有一個大神問我這樣的問題:在做UWP的項目,怎么能讓焦點在點擊在頁面空白處時回到textbox中? 雖然我的小伙伴認為他這是一個 xy 問題,但是我還是回答他這個問題。 首…

python:當文件中出現特定字符串時執行robot用例

#coding:utf-8 import os import datetime import timedef execute_rpt_db_full_effe_cainiao_city():flag Truewhile flag:# 判斷該文件是否存在# os.path.isfile("/home/ytospid/opt/docker/jsc_spider/jsc_spider/log/call_proc.log")# 存在則獲取昨天日期字符串…

MySQL分庫分表方案

1. MySQL分庫分表方案 1.1. 問題:1.2. 回答: 1.2.1. 最好的切分MySQL的方式就是:除非萬不得已,否則不要去干它。1.2.2. 你的SQL語句不再是聲明式的(declarative)1.2.3. 你招致了大量的網絡延時1.2.4. 你失去…

linux創建sudo用戶_Linux終極指南-創建Sudo用戶

linux創建sudo用戶sudo stands for either "superuser do" or "switch user do", and sudo users can execute commands with root/administrative permissions, even malicious ones. Be careful who you grant sudo permissions to – you are quite lit…

重學TCP協議(1) TCP/IP 網絡分層以及TCP協議概述

1. TCP/IP 網絡分層 TCP/IP協議模型(Transmission Control Protocol/Internet Protocol),包含了一系列構成互聯網基礎的網絡協議,是Internet的核心協議,通過20多年的發展已日漸成熟,并被廣泛應用于局域網和…

分節符縮寫p_p值的縮寫是什么?

分節符縮寫pp是概率嗎? (Is p for probability?) Technically, p-value stands for probability value, but since all of statistics is all about dealing with probabilistic decision-making, that’s probably the least useful name we could give it.從技術…

Spring-----AOP-----事務

xml文件中&#xff1a; 手動處理事務&#xff1a; 設置數據源 <bean id"dataSource" class"com.mchange.v2.c3p0.ComboPooledDataSource"> <property name"driverClass" value"com.mysql.jdbc.Driver"></property…

[測試題]打地鼠

Description 小明聽說打地鼠是一件很好玩的游戲&#xff0c;于是他也開始打地鼠。地鼠只有一只&#xff0c;而且一共有N個洞&#xff0c;編號為1到N排成一排&#xff0c;兩邊是墻壁&#xff0c;小明當然不可能百分百打到&#xff0c;因為他不知道地鼠在哪個洞。小明只能在白天打…

在PHP服務器上使用JavaScript進行緩慢的Loris攻擊[及其預防措施!]

Forget the post for a minute, lets begin with what this title is about! This is a web security-based article which will get into the basics about how HTTP works. Well also look at a simple attack which exploits the way the HTTP protocol works.暫時忘掉這個帖…

三星為什么要賣芯片?手機干不過華為小米,半導體好掙錢!

據外媒DigiTimes報道&#xff0c;三星有意向其他手機廠商出售自家的Exynos芯片以擴大市場份額。知情人士透露&#xff0c;三星出售自家芯片旨在提高硅晶圓工廠的利用率&#xff0c;同時提高它們在全球手機處理器市場的份額&#xff0c;尤其是中端市場。 三星為什么要賣芯片&…

重學TCP協議(2) TCP 報文首部

1. TCP 報文首部 1.1 源端口和目標端口 每個TCP段都包含源端和目的端的端口號&#xff0c;用于尋找發端和收端應用進程。這兩個值加上IP首部中的源端IP地址和目的端IP地址唯一確定一個TCP連接 端口號分類 熟知端口號&#xff08;well-known port&#xff09;已登記的端口&am…

linux:vim中全選復制

全選&#xff08;高亮顯示&#xff09;&#xff1a;按esc后&#xff0c;然后ggvG或者ggVG 全部復制&#xff1a;按esc后&#xff0c;然后ggyG 全部刪除&#xff1a;按esc后&#xff0c;然后dG 解析&#xff1a; gg&#xff1a;是讓光標移到首行&#xff0c;在vim才有效&#xf…

機器學習 預測模型_使用機器學習模型預測心力衰竭的生存時間-第一部分

機器學習 預測模型數據科學 &#xff0c; 機器學習 (Data Science, Machine Learning) 前言 (Preface) Cardiovascular diseases are diseases of the heart and blood vessels and they typically include heart attacks, strokes, and heart failures [1]. According to the …

程序2:word count

本程序改變自&#xff1a;http://blog.csdn.net/zhixi1050/article/details/72718638 語言&#xff1a;C 編譯環境&#xff1a;visual studio 2015 運行環境&#xff1a;Win10 做出修改的地方&#xff1a;在原碼基礎上修改了記錄行數的功能&#xff0c;刪去了不完整行數的記錄&…

重學TCP協議(3) 端口號及MTU、MSS

1. 端口相關的命令 1.1 查看端口是否打開 使用 nc 和 telnet 這兩個命令可以非常方便的查看到對方端口是否打開或者網絡是否可達。如果對端端口沒有打開&#xff0c;使用 telnet 和 nc 命令會出現 “Connection refused” 錯誤 1.2 查看監聽端口的進程 使用 netstat sudo …

Diffie Hellman密鑰交換

In short, the Diffie Hellman is a widely used technique for securely sending a symmetric encryption key to another party. Before proceeding, let’s discuss why we’d want to use something like the Diffie Hellman in the first place. When transmitting data o…

高效能程序猿的修煉

下載地址&#xff1a;http://download.csdn.net/detail/xiaole0313/8931785 高效能程序猿的修煉 《高效能程序猿的修煉是人民郵電出版社出版的圖書。本書是coding horror博客中精華文章的集合。全書分為12章。涉及邁入職業門檻、高效能編程、應聘和招聘、團隊協作、高效工作環境…

Spring 中的 LocalSessionFactoryBean和LocalContainerEntityManagerFactoryBean

Spring和Hibernate整合的時候我們經常會有如下的配置代碼 1&#xff0c;非JPA支持的配置 <!-- 配置 Hibernate 的 SessionFactory 實例: 通過 Spring 提供的 LocalSessionFactoryBean 進行配置 --> <!-- FacotryBean 配置的時候返回的不是本身而是返回的FactoryBean 的…

如何通過建造餐廳來了解Scala差異

I understand that type variance is not fundamental to writing Scala code. Its been more or less a year since Ive been using Scala for my day-to-day job, and honestly, Ive never had to worry much about it. 我了解類型差異并不是編寫Scala代碼的基礎。 自從我在日…

linux的/etc/passwd、/etc/shadow、/etc/group和/etc/gshadow

1./etc/passwd 存儲用戶信息 [rootoldboy ~]# head /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin 一行記錄對應著一個用戶&#xff0c;每行記錄被冒號:分隔為7個字段&#xff0c;這7個字段的具體含…