数据探索性分析_探索性数据分析

数据探索性分析

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.mzph.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.队头阻塞:允许一次发送一组请求,但是只能按照…