數據探索性分析_探索性數據分析

數據探索性分析

When we hear about Data science or Analytics , the first thing that comes to our mind is Modelling , Tuning etc. . But one of the most important and primary steps before all of these is Exploratory Data Analysis or EDA.

當我們聽到有關數據科學或分析的知識時,想到的第一件事就是建模,調整等。 但是,在所有這些步驟中最重要和最主要的步驟之一是探索性數據分析或EDA。

Image for post
Exploratory data analysis (Machine learning process steps)
探索性數據分析(機器學習過程步驟)

為什么選擇EDA (Why EDA)

In Data Science one of the Major problem Data Scientists/Analysts are facing today is the Data Quality . Since we rely on multiple sources for data , data quality is often compromised.The quality of Data determines the quality of models which we are building on it .As the adage goes,Garbage in , garbage out . The above statement holds very true in the case of Data science.

在數據科學領域,數據科學家/分析師當今面臨的主要問題之一是數據質量。 由于我們依賴于多個數據源,因此數據質量常常受到損害。數據的質量決定了我們在其上構建的模型的質量。 上面的陳述在數據科學領域非常正確。

We cannot build Empire State Building or Burj Khalifa on a shaky foundation !

我們不能在搖搖欲墜的基礎上建造帝國大廈或哈利法塔!

And that explains why 60–80% of time of Data Scientists are being spent on Data gathering and Data preparation.

這就解釋了為什么將60-80%的數據科學家的時間都花在數據收集和數據準備上。

When we are working with Data , EDA or Exploratory Data Analysis is the most important step .It is very important to gather as much information and insights from data as we could before processing it . This could be done by EDA. EDA Also help us to analyse the underlying trends and patterns in data and also help us to formulate our problem statement in a better way .

當我們處理數據時,EDA或探索性數據分析是最重要的步驟。在處理數據之前,從數據中收集盡可能多的信息和見解非常重要。 這可以由EDA完成。 EDA還可以幫助我們分析數據的潛在趨勢和模式,還可以幫助我們更好地制定問題陳述。

Well begun is half done”

好的開始已經完成了一半”

Exploratory Data Analysis helps to understand the data better and also it helps to understand what Data speaks.This could be done both by visual analysis as well as with few other analysis.Also EDA helps to distinguish between what to be pursued further and what is not worth following up.

探索性數據分析有助于更好地理解數據,也有助于理解數據的含義,這既可以通過可視化分析也可以通過很少的其他分析來完成,此外EDA有助于區分需要進一步追求的目標和不追求的目標值得跟進。

Exploratory Data Analysis

探索性數據分析

Let’s explore steps of Exploratory data analysis using Bank loan Data set

讓我們探索使用銀行貸款數據集進行探索性數據分析的步驟

Import the Libraries:

導入庫:

To perform initial analysis , we would need libraries like Numpy, Pandas,Seaborn and Matplotlib. Numpy is an array processing package.Its a library for numerical computations .Pandas is used for data manipulation and analysis. Matplotlib and Seaborn are statistical libraries used for data visualization

為了進行初步分析,我們需要Numpy,Pandas,Seaborn和Matplotlib之類的庫。 Numpy是一個數組處理程序包,它是一個用于數值計算的庫.Pandas用于數據處理和分析。 Matplotlib和Seaborn是用于數據可視化的統計庫

Image for post

Import Dataset:

導入數據集:

Data is stored in csv file format, hence we are importing it using pd.read_csv

數據以csv文件格式存儲,因此我們使用pd.read_csv導入數據

Image for post

Imported data from the file is stored in bankloan_df dataframe

從文件導入的數據存儲在bankloan_df數據框中

Information of data set:

數據集信息:

.info() will display information about the data frames

.info()將顯示有關數據幀的信息

Image for post

It shows the column names,number of rows and columns, data types etc.It gives an idea about what type of data it is .It is very important to understand whether a column represents categorical or numerical variable , if categorical we should understand whether its ordinal or nominal .We need to treat each of these data types differently which I will explain in another post.You can use .astype to change the datatype of a column

它顯示列名,行數和列數,數據類型等。它給出有關數據類型的信息。了解列是表示類別變量還是數值變量非常重要,如果是類別變量,則應了解其類型順序或標稱。我們需要對每種數據類型進行不同的處理,這將在另一篇文章中進行解釋。您可以使用.astype更改列的數據類型

Image for post

If need to know only the number of rows and columns .shape can be used

如果只需要知道行數和列數,可以使用.shape

Image for post

To see the data type , bankloan_df.dtypes can be used

要查看數據類型,可以使用bankloan_df.dtypes

To check the null values bankloan_df.isnull().sum() can be used

要檢查空值,可以使用bankloan_df.isnull()。sum()

Image for post

Descriptive Analysis :

描述性分析:

.describe() is used for descriptive analysis , it provides details like count, mean, standard deviation, Inter Quartile Range etc.This analysis helps to understand the skewness of data.

.describe()用于描述性分析,它提供了諸如計數,均值,標準差,四分位數間距等詳細信息。此分析有助于理解數據的偏度。

Image for post

In the case of categorical variables,to check the representation of different groups , we use groupby. This is used to analyze whether any group is over represented than other . If such under representation is there for target variable, we need to treat it with certain techniques like SMOTE.

對于分類變量,為了檢查不同組的表示形式,我們使用groupby。 這用于分析是否有任何一個組比另一個組高。 如果目標變量存在這種表示不足的情況,則需要使用某些技術(例如SMOTE)對其進行處理。

Image for post

Graphical analysis:

圖形分析:

Graphs are very important tool to understand the data distribution .We use different graphs for analyzing data. We use it for Univariate, Bi Variate and Multi Variate Analysis. Seaborn is a very good library to explore different graphs. I will explain few very common graphs in the analysis here and will write a post in detail about graphs later.

圖是了解數據分布的非常重要的工具。我們使用不同的圖來分析數據。 我們將其用于單變量,雙變量和多變量分析。 Seaborn是一個很好的圖書館,可以探索不同的圖形。 在這里的分析中,我將解釋一些非常常見的圖形,稍后將詳細撰寫有關圖形的文章。

Uni variate Analysis — Analysis where we consider only one variable. Few uni variate graphs are Count Plot, Box Plot etc.

單變量分析-僅考慮一個變量的分析。 很少有單變量圖是計數圖,箱形圖等。

Countplot:-Countplot shows the counts of observations in each category using bars

Countplot:-Countplot使用條形圖顯示每個類別中的觀察計數

Image for post
Image for post

Boxplot:-A box plot (or box-and-whisker plot) shows the distribution of quantitative data.The box shows the quartiles of the dataset while the whiskers extend to show the rest of the distribution, except for points that are determined to be “outliers” using a method that is a function of the inter-quartile range.

Boxplot:-箱形圖(或箱須圖)顯示定量數據的分布。框顯示數據集的四分位數,而晶須延伸以顯示其余分布,確定點除外使用四分位間距范圍的函數的“異常值”。

Image for post

To identify outliers also we use boxplots

為了識別異常值,我們還使用箱線圖

Image for post

Bi Variate Analysis is where relationship between two variables are plotted in the graph and in Multi variate Analysis , relationship between different variables represented using graphs.

雙變量分析是在圖中繪制兩個變量之間的關系的地方,而在多變量分析中,則是使用圖表表示的不同變量之間的關系的地方。

Pairplot is a Bi Variate graph which is used to analyse the relationship between different variables in a dataset. This is very important step for Model building.

Pairplot是Bi Variate圖,用于分析數據集中不同變量之間的關系。 這對于模型構建非常重要。

Image for post

Correlation

相關性

Correlation is another important step of EDA. While building a model, its important to understand whether any correlation exists between the independent variables and also with independent variable and dependent variable. This also helps in feature selection/elimination.

關聯是EDA的另一個重要步驟。 在構建模型時,重要的是要了解自變量之間以及自變量和因變量之間是否存在任何關聯。 這也有助于特征選擇/消除。

Values closer to +1 and -1 are considered as maximum correlated variables.The values in diagonal is the correlation of variable with itself and it will always be +1.

接近+1和-1的值被視為最大相關變量。對角線的值是變量與其自身的相關性,它將始終為+1。

Image for post

Correlation graphs can be designed using the below code snippet

可以使用以下代碼片段設計相關圖

Image for post
Image for post

These are initial few steps of Exploratory data analysis. Based on the findings of each step ,one can take appropriate action to improve data quality ,analyse the trend or to treat missing variables/Outliers or anomaly appropriately.

這些是探索性數據分析的最初幾個步驟。 根據每個步驟的發現,可以采取適當的措施來改善數據質量,分析趨勢或適當地處理缺失的變量/異常值或異常。

“Information is the oil of the 21st century, and analytics is the combustion engine.” — Peter Sondergaard,Gartner Research

“信息是21世紀的石油,分析是內燃機。” -Peter Sondergaard,Gartner研究

翻譯自: https://medium.com/@viveksmenon/exploratory-data-analysis-d464f3adb777

數據探索性分析

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

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

相關文章

5930. 兩棟顏色不同且距離最遠的房子

5930. 兩棟顏色不同且距離最遠的房子 街上有 n 棟房子整齊地排成一列,每棟房子都粉刷上了漂亮的顏色。給你一個下標從 0 開始且長度為 n 的整數數組 colors ,其中 colors[i] 表示第 i 棟房子的顏色。 返回 兩棟 顏色 不同 房子之間的 最大 距離。 第 …

一起了解原型模式

原型模式 原型模式,用起來其實就是做clone操作,clone一個對象,越過構造器,在特定使用場景下增加效率。 UML 使用場景: 類初始化需要消耗很多資源,比較耗時。new方式非常繁瑣,還涉及到權限之類的…

c++與c語言的區別部分

1.new <malloc> delete <free> 2.多態&#xff1a; 重載 <函數 操作符> 類似于c中的變化參數 虛函數3.模板 4.class類<面向對象> 繼承 5.名空間 &#xff08;防止數據沖突問題 &#xff0c; 數據安全&#xff09; 6.引用 &a…

stata中心化處理_帶有stata第2部分自定義配色方案的covid 19可視化

stata中心化處理This guide will cover an important, yet, under-explored part of Stata: the use of custom color schemes. In summary, we will learn how to go from this graph:本指南將涵蓋Stata的一個重要但尚未充分研究的部分&#xff1a;自定義配色方案的使用。 總而…

5201. 給植物澆水

5201. 給植物澆水 你打算用一個水罐給花園里的 n 株植物澆水。植物排成一行&#xff0c;從左到右進行標記&#xff0c;編號從 0 到 n - 1 。其中&#xff0c;第 i 株植物的位置是 x i 。x -1 處有一條河&#xff0c;你可以在那里重新灌滿你的水罐。 每一株植物都需要澆特定…

Anaconda配置和使用

為什么80%的碼農都做不了架構師&#xff1f;>>> 原來一直使用原生python和pip的方式&#xff0c;換了新電腦&#xff0c;準備折騰下Anaconda。 安裝過程就不說了&#xff0c;全程可視化安裝&#xff0c;很簡單。 安裝后用“管理員權限”打開“Anaconda Prompt”命令…

qml: C++調用qml函數

C調用qml函數&#xff0c;是通過下面的函數實現的&#xff1a; bool QMetaObject::invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0 QGenericArgument( Q_NULLPTR ), QGenericArgument val1 QG…

python 插補數據_python 2020中缺少數據插補技術的快速指南

python 插補數據Most machine learning algorithms expect complete and clean noise-free datasets, unfortunately, real-world datasets are messy and have multiples missing cells, in such cases handling missing data becomes quite complex.大多數機器學習算法期望完…

5186. 區間內查詢數字的頻率

5186. 區間內查詢數字的頻率 請你設計一個數據結構&#xff0c;它能求出給定子數組內一個給定值的 頻率 。 子數組中一個值的 頻率 指的是這個子數組中這個值的出現次數。 請你實現 RangeFreqQuery 類&#xff1a; RangeFreqQuery(int[] arr) 用下標從 0 開始的整數數組 ar…

NIO 學習筆記

0. 介紹 參考 關于Java IO與NIO知識都在這里 &#xff0c;在其基礎上進行修改與補充。 1. NIO介紹 1.1 NIO 是什么 Java NIO 是 java 1.4, 之后新出的一套IO接口. NIO中的N可以理解為Non-blocking&#xff0c;不單純是New。 1.2 NIO的特性/NIO與IO區別 IO是面向流的&#x…

[原創]java獲取word里面的文本

需求場景 開發的web辦公系統如果需要處理大量的Word文檔&#xff08;比如有成千上萬個文檔&#xff09;&#xff0c;用戶一定提出查找包含某些關鍵字的文檔的需求&#xff0c;這就要求能夠讀取 word 中的文字內容&#xff0c;而忽略其中的文字樣式、表格、圖片等信息。 方案分析…

ab 模擬_Ab測試第二部分的直觀模擬

ab 模擬In this post, I would like to invite you to continue our intuitive exploration of A/B testing, as seen in the previous post:在本文中&#xff0c;我想邀請您繼續我們對A / B測試的直觀探索&#xff0c;如前一篇文章所示&#xff1a; Resuming what we saw, we…

1886. 判斷矩陣經輪轉后是否一致

1886. 判斷矩陣經輪轉后是否一致 給你兩個大小為 n x n 的二進制矩陣 mat 和 target 。現 以 90 度順時針輪轉 矩陣 mat 中的元素 若干次 &#xff0c;如果能夠使 mat 與 target 一致&#xff0c;返回 true &#xff1b;否則&#xff0c;返回 false 。 示例 1&#xff1a; 輸…

samba登陸密碼不正確

win7訪問Linux Samba的共享目錄提示“登錄失敗&#xff1a;用戶名或密碼錯誤”解決方法 解決辦法&#xff1a;修改本地安全策略 通過Samba服務可以實現UNIX/Linux主機與Windows主機之間的資源互訪&#xff0c;由于實驗需要&#xff0c;輕車熟路的在linux下配置了samba服務&…

Java構造函數的深入理解

我們人出生的時候&#xff0c;有些人一出生之后再起名字的&#xff0c;但是有些人一旦出生就已經起好名字的。那么我們在 java 里面怎么在對象一旦創建就賦值呢&#xff1f; public class Person {String name; // 姓名int age; // 年齡public static void main(String[]…

1967. 作為子字符串出現在單詞中的字符串數目

1967. 作為子字符串出現在單詞中的字符串數目 給你一個字符串數組 patterns 和一個字符串 word &#xff0c;統計 patterns 中有多少個字符串是 word 的子字符串。返回字符串數目。 子字符串 是字符串中的一個連續字符序列。 示例 1&#xff1a;輸入&#xff1a;patterns [&…

判斷IE版本與各瀏覽器的語句

---恢復內容開始--- 一.IE下判斷IE版本的語句 <!--[if lte IE 6]><![endif]-->IE6及其以下版本可見<!--[if lte IE 7]><![endif]-->IE7及其以下版本可見<!--[if IE 6]><![endif]-->只有IE6版本可見<![if !IE]><![endif]>除了I…

各類軟件馬斯洛需求層次分析_需求的分析層次

各類軟件馬斯洛需求層次分析When I joined Square, I was embedded on a product that had been in-market for a year but didn’t have dedicated analytics support.當我加入Square時&#xff0c;我被嵌入了已經上市一年但沒有專門的分析支持的產品。 As you might expect,…

384. 打亂數組

384. 打亂數組 給你一個整數數組 nums &#xff0c;設計算法來打亂一個沒有重復元素的數組。 實現 Solution class: Solution(int[] nums) 使用整數數組 nums 初始化對象int[] reset() 重設數組到它的初始狀態并返回int[] shuffle() 返回數組隨機打亂后的結果 示例&#xf…

HTTP/2 學習筆記

創建連接TCP三次握手:包括客戶端想服務端發起一個SYN包,接著服務端返回對應SYN的ACK響應以及新的SYN包,然后客戶端返回對應的ACK.如果客戶端發起HTTPS連接,它還需要進行傳輸層安全協議(TLS)協商;TLS用來取代安全套接層.HTTP1的問題1.隊頭阻塞:允許一次發送一組請求,但是只能按照…