日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

鲜活数据数据可视化指南_数据可视化实用指南

發布時間:2023/11/29 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 鲜活数据数据可视化指南_数据可视化实用指南 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

鮮活數據數據可視化指南

Exploratory data analysis (EDA) is an essential part of the data science or the machine learning pipeline. In order to create a robust and valuable product using the data, you need to explore the data, understand the relations among variables, and the underlying structure of the data. One of the most effective tools in EDA is data visualization.

探索性數據分析(EDA)是數據科學或機器學習管道的重要組成部分。 為了使用數據創建強大而有價值的產品,您需要瀏覽數據,了解變量之間的關系以及數據的基礎結構。 數據可視化是EDA中最有效的工具之一。

Data visualizations tell us much more than plain numbers. They are also more likely to stick to your head. In this post, we will try to explore a customer churn dataset using the power of visualizations.

數據可視化告訴我們的不僅僅是單純的數字。 他們也更有可能堅持你的想法。 在本文中,我們將嘗試使用可視化功能探索客戶流失數據集 。

We will create many different visualizations and, on each one, try to introduce a feature of Matplotlib or Seaborn library.

我們將創建許多不同的可視化,并在每一個上嘗試引入Matplotlib或Seaborn庫的功能。

We start with importing related libraries and reading the dataset into a pandas dataframe.

我們首先導入相關的庫,然后將數據集讀取到pandas數據框中。

import pandas as pd
import numpy as npimport matplotlib.pyplot as plt
import seaborn as sns
sns.set(style='darkgrid')
%matplotlib inlinedf = pd.read_csv("/content/Churn_Modelling.csv")df.head()

The dataset contains 10000 customers (i.e. rows) and 14 features about the customers and their products at a bank. The goal here is to predict whether a customer will churn (i.e. exited = 1) using the provided features.

該數據集包含10000個客戶(即行)和銀行中有關客戶及其產品的14個特征。 這里的目標是使用提供的功能預測客戶是否會流失(即退出= 1)。

Let’s start with a catplot which is a categorical plot of the Seaborn library.

讓我們從圖開始,這是Seaborn庫的分類圖。

sns.catplot(x='Gender', y='Age', data=df, hue='Exited', height=8, aspect=1.2)

Finding: People between the ages of 45 and 60 are more likely to churn (i.e. leave the company) than other ages. There is not a considerable difference between females and males in terms of churning.

發現 :45至60歲的人比其他年齡段的人更容易流失(即離開公司)。 男性和女性在攪動方面沒有顯著差異。

The hue parameter is used to differentiate the data points based on a categorical variable.

hue參數用于基于分類變量來區分數據點。

The next visualization is the scatter plot which shows the relationship between two numerical variables. Let’s see if the estimated salary and balance of a customer are related.

下一個可視化是散點圖 ,它顯示了兩個數值變量之間的關系。 讓我們看看客戶的估計工資和余額是否相關。

plt.figure(figsize=(12,8))plt.title("Estimated Salary vs Balance", fontsize=16)sns.scatterplot(x='Balance', y='EstimatedSalary', data=df)

We first used matplotlib.pyplot interface to create a Figure object and set the title. Then, we drew the actual plot on this figure object with Seaborn.

我們首先使用matplotlib.pyplot接口創建一個Figure對象并設置標題。 然后,我們使用Seaborn在此圖形對象上繪制了實際圖。

Finding: There is not a meaningful relationship or correlation between the estimated salary and balance. Balance seems to have a normal distribution (excluding the customers with zero balance).

調查結果 :估計的薪水和余額之間沒有有意義的關系或相關性。 余額似乎具有正態分布(不包括余額為零的客戶)。

The next visualization is the boxplot which shows the distribution of a variable in terms of median and quartiles.

下一個可視化效果是箱線圖 ,它以中位數和四分位數的形式顯示了變量的分布。

plt.figure(figsize=(12,8))ax = sns.boxplot(x='Geography', y='Age', data=df)ax.set_xlabel("Country", fontsize=16)
ax.set_ylabel("Age", fontsize=16)

We also adjusted the font sizes of x and y axes using set_xlabel and set_ylabel.

我們還使用set_xlabelset_ylabel調整了x和y軸的字體大小

Here is the structure of boxplots:

這是箱線圖的結構:

Image source)圖像來源 )

Median is the point in the middle when all points are sorted. Q1 (first or lower quartile) is the median of the lower half of the dataset. Q3 (third or upper quartile) is the median of the upper half of the dataset.

中點是對所有點進行排序時中間的點。 Q1(第一個或下一個四分位數)是數據集下半部分的中位數。 Q3(第三或上四分位數)是數據集上半部分的中位數。

Thus, boxplots give us an idea about the distribution and outliers. In the boxplot we created, there are many outliers (represented with dots) on top.

因此,箱線圖使我們對分布和異常值有了一個了解。 在我們創建的箱線圖中,頂部有許多離群值(以點表示)。

Finding: The distribution of the age variable is right-skewed. The mean is greater than the median due to the outliers on the upper side. There is not a considerable difference between countries.

結果 :年齡變量的分布右偏。 由于上側的異常值,平均值大于中位數。 各國之間沒有顯著差異。

Right-skewness can also be observed in the univariate distribution of a variable. Let’s create a distplot to observe the distribution.

右偏度也可以在變量的單變量分布中觀察到。 讓我們創建一個distplot來觀察分布。

plt.figure(figsize=(12,8))plt.title("Distribution of Age", fontsize=16)sns.distplot(df['Age'], hist=False)

The tail on the right side is heavier than the one on the left. The reason is the outliers as we also observed on the boxplot.

右側的尾巴比左側的尾巴重。 原因是離群值,正如我們在箱線圖上所觀察到的。

The distplot also provides a histogram by default but we changed it using the hist parameter.

默認情況下,distplot還提供直方圖,但我們使用hist參數對其進行了更改。

Seaborn library also provides different types of pair plots which give an overview of pairwise relationships among variables. Let’s first take a random sample from our dataset to make the plots more appealing. The original dataset has 10000 observations and we will take a sample with 100 observations and 4 features.

Seaborn庫還提供了不同類型的成對圖,概述了變量之間的成對關系。 首先,我們從數據集中隨機抽取一個樣本,使圖更具吸引力。 原始數據集具有10000個觀測值,我們將抽取一個具有100個觀測值和4個特征的樣本。

subset=df[['CreditScore','Age','Balance','EstimatedSalary']].sample(n=100)g = sns.pairplot(subset, height=2.5)

On the diagonal, we can see the histogram of variables. The other part of the grid represents pairwise relationships.

在對角線上,我們可以看到變量的直方圖。 網格的另一部分表示成對關系。

Another tool to observe pairwise relationships is the heatmap which takes a matrix and produces a color encoded plot. Heatmaps are mostly used to check correlations between features and the target variable.

觀察成對關系的另一個工具是熱圖 ,它采用矩陣并生成彩色編碼圖。 熱圖通常用于檢查要素與目標變量之間的相關性。

Let’s first create a correlation matrix of some features using the corr function of pandas.

首先,我們使用熊貓的corr函數創建一些要素的相關矩陣。

corr_matrix = df[['CreditScore','Age','Tenure','Balance',
'EstimatedSalary','Exited']].corr()

We can now plot this matrix.

現在我們可以繪制該矩陣。

plt.figure(figsize=(12,8))sns.heatmap(corr_matrix, cmap='Blues_r', annot=True)

Finding: The “Age” and “Balance” columns are positively correlated with customer churn (“Exited”).

結果 :“年齡”和“平衡”列與客戶流失(“退出”)呈正相關。

As the amount of data increases, it gets trickier to analyze and explore it. There comes the power of visualizations which are great tools in exploratory data analysis when used efficiently and appropriately. Visualizations also help to deliver a message to your audience or inform them about your findings.

隨著數據量的增加,分析和探索數據變得更加棘手。 可視化的強大功能是有效和適當使用探索性數據分析的重要工具。 可視化還有助于向您的聽眾傳達信息或告知他們您的發現。

There is no one-fits-all kind of visualization method so certain tasks require different kinds of visualizations. Depending on the task, different options may be more suitable. What all visualizations have in common is that they are great tools for exploratory data analysis and the storytelling part of data science.

沒有一種萬能的可視化方法,因此某些任務需要不同類型的可視化。 根據任務,不同的選項可能更合適。 所有可視化的共同點在于,它們是探索性數據分析和數據科學講故事部分的出色工具。

Thank you for reading. Please let me know if you have any feedback.

感謝您的閱讀。 如果您有任何反饋意見,請告訴我。

翻譯自: https://towardsdatascience.com/a-practical-guide-for-data-visualization-9f1a87c0a4c2

鮮活數據數據可視化指南

總結

以上是生活随笔為你收集整理的鲜活数据数据可视化指南_数据可视化实用指南的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 污污视频网站 | 国产毛片一区二区三区 | 桃谷绘里香番号 | 亚洲欧美国产一区二区 | 日日人人 | 人人妻人人澡人人爽久久av | 色射视频 | 91精品国产综合久久久久 | 中文无码日韩欧 | 亚洲欧美一区二区三区在线观看 | av大片在线观看 | 三级视频国产 | 亚洲视频在线一区 | 国产日韩欧美一二三区 | 国产人免费人成免费视频 | 日韩av网站大全 | 99r热 | 亚洲第一视频 | 日噜 | 在线看av网址 | 免费黄在线 | 99在线观看免费视频 | 精品一性一色一乱农村 | a片在线免费观看 | 久久久久久久久免费 | 日本阿v视频在线观看 | 日日摸天天爽天天爽视频 | 色欲av永久无码精品无码蜜桃 | 国产高清一区二区 | 黑白配在线观看免费观看 | 中文字幕国产日韩 | 黄色午夜| 人人妻人人藻人人爽欧美一区 | 国产成人精品一区二区三区视频 | 射进来av影视网 | а√天堂8资源在线官网 | 亚洲色图综合网 | 成人三级视频 | 麻豆69| 夫妻自拍偷拍 | 高清一区二区三区视频 | 国产伦精品一区二区三区高清版禁 | 日韩av在线播放观看 | 国产视频123 | 日韩av一卡 | 成年人免费网站在线观看 | 亚洲成人一区二区三区 | 宅男av在线 | 国内精品视频在线观看 | 公侵犯一区二区三区 | av高清| 国产一级在线视频 | 人人超碰人人 | 殴美黄色大片 | 黄色网址在线免费 | 日韩精品无码一区二区三区 | 小泽玛利亚一区二区三区 | 麻豆网| 韩国三级hd中文字幕的背景音乐 | 久久亚洲aⅴ无码精品 | 国产人澡人澡澡澡人碰视频 | 91成人在线观看高潮 | 96视频在线 | 免费看黄色aaaaaa 片 | 国产毛片久久久 | а 天堂 在线 | 国产懂色av | 欧美在线天堂 | 最新不卡av| 免费看的av| 久久人妻一区二区 | 日韩成人午夜影院 | 久久综合久久综合久久综合 | 欧美一级夜夜爽 | 青青草av| 永久看看免费大片 | 成人激情在线 | 久草最新视频 | www.伊人网| 麻豆porn| 成人性视频免费网站 | 黑人玩弄人妻一区二区三区四 | aa黄色大片| 亚洲国产精品成人无久久精品 | 青娱乐国产在线视频 | 顶级毛片 | 丰满岳妇乱一区二区三区 | 中文字幕一区二区三区人妻电影 | 日韩av在线影院 | 在线观看黄色av网站 | 美女av在线免费观看 | 免费黄色片子 | 日韩精品人妻一区二区中文字幕 | 亚洲我射av| 在线看黄色网 | 国产精品亚洲一区二区无码 | 在线观看av中文字幕 | 精品人伦一区二区三 | 精品一区二区三区三区 |