当前位置:网站首页>Machine learning Seaborn visualization
Machine learning Seaborn visualization
2022-07-05 07:14:00 【RS&Hydrology】
Main records seaborn Visual learning notes ( Understand which functions to draw images are available ).
List of articles
- One 、seaborn principle
- Two 、 Variable distribution
- 1.sns.boxplot(): View the value range of numeric variables
- 2.sns.displot(): View the distribution of variables
- 3.sns.jointplot(): Plot the joint distribution and respective distribution of two variables
- 4.sns.pairplot(): Plot the joint distribution of all numerical variables in pairs
- Reference material
One 、seaborn principle
picture source :https://www.bilibili.com/video/BV1VX4y1F76x/
- boxenplot: Suitable for big data
- Distribution diagram of numerical variables in different categories :stripplot;swarmplot;violinplot
- FaceGrid,PairGrid You can customize the drawing function
see seaborn edition :sns.__version__
Version update :pip install —upgrade seaborn
Two 、 Variable distribution
1.sns.boxplot(): View the value range of numeric variables
sns.boxplot(): View the value range of numeric variables , Whether there are outliers .
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
print(sns.__version__)
# print(sns.get_dataset_names())
df = pd.read_excel('D:/1.xlsx')
sns.boxplot(data=df,x="Height")
plt.show()
2.sns.displot(): View the distribution of variables
- sns.displot(kind = hist) # Draw histogram
Histogram :sns.histplot(bins,hue,shrink)
bins: change bin numbers
hue: Category variable
shrink: Zoom factor - sns.displot(kind = kde) # Plotting kernel density estimates (kernel density estimate (KDE)), It is a method to visualize the distribution of observations in data sets , Similar to histogram .KDE Use a continuous probability density curve of one or more dimensions to represent data .
- sns.displot(kind = ecdf) # Represents the proportion or count of observations below each unique value in the dataset . Compare with histogram or density diagram , Its advantage is that each observation is directly visualized , This means that there is no need to adjust the box dividing or smoothing parameters .
penguins = sns.load_dataset("penguins")
sns.ecdfplot(data=penguins, x="flipper_length_mm")
- sns.countplot(data=df,x=“class”) Number of Statistics
3.sns.jointplot(): Plot the joint distribution and respective distribution of two variables
sns.jointplot(dataset,x,y,kind)
sns.jointplot() Function upgrade :
JoinGrid, Can pass g.plot() Custom function .g = sns.JoinGrid(); g.plot(sns.histplot,sns.boxplot)
4.sns.pairplot(): Plot the joint distribution of all numerical variables in pairs
sns.pairplot() Function upgrade :
PairGrid, Can pass g.map() Custom drawing function
Reference material
边栏推荐
- [nvidia] CUDA_ VISIBLE_ DEVICES
- [software testing] 02 -- software defect management
- The SQL implementation has multiple records with the same ID, and the latest one is taken
- Target detection series - detailed explanation of the principle of fast r-cnn
- GPIO port bit based on Cortex-M3 and M4 with operation macro definition (can be used for bus input and output, STM32, aducm4050, etc.)
- MySQL setting trigger problem
- 氫氧化鈉是什麼?
- [node] differences among NPM, yarn and pnpm
- Docker installs MySQL and uses Navicat to connect
- SOC_SD_DATA_FSM
猜你喜欢
Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
【软件测试】02 -- 软件缺陷管理
IPage能正常显示数据,但是total一直等于0
[idea] efficient plug-in save actions to improve your work efficiency
Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4
Mathematical analysis_ Notes_ Chapter 8: multiple integral
ROS2——ROS2对比ROS1(二)
Ros2 - first acquaintance with ros2 (I)
C#学习笔记
Ros2 - ros2 vs. ros1 (II)
随机推荐
ROS2——配置开发环境(五)
[software testing] 04 -- software testing and software development
NPM and package common commands
Logical structure and physical structure
二分查找(折半查找)
Literacy Ethernet MII interface types Daquan MII, RMII, smii, gmii, rgmii, sgmii, XGMII, XAUI, rxaui
Unity UGUI不同的UI面板或者UI之间如何进行坐标匹配和变换
【Node】npm、yarn、pnpm 区别
Ros2 - Service Service (IX)
SD_CMD_RECEIVE_SHIFT_REGISTER
PHY drive commissioning --- mdio/mdc interface Clause 22 and 45 (I)
ModuleNotFoundError: No module named ‘picamera‘
[OBS] x264 Code: "buffer_size“
2022年中纪实 -- 一个普通人的经历
PHY drive commissioning - phy controller drive (II)
ROS2——node节点(七)
[vscode] recommended plug-ins
Initialization of global and static variables
[software testing] 06 -- basic process of software testing
Mid 2022 documentary -- the experience of an ordinary person