当前位置:网站首页>【seaborn】5、Matrix plots 矩阵图
【seaborn】5、Matrix plots 矩阵图
2022-07-16 19:00:00 【Enzo 想砸电脑】
heatmap(热力图)
利用热力图可以看数据表里多个特征两两的相似度,类似于色彩矩阵。具体参数如下:
seaborn.heatmap(data, vmin=None, vmax=None, cmap=None, center=None,
robust=False, annot=None, fmt='.2g', annot_kws=None,
linewidths=0, linecolor='white', cbar=True, cbar_kws=None,
cbar_ax=None, square=False, xticklabels='auto',
yticklabels='auto', mask=None, ax=None, **kwargs)
- data:矩阵数据集,可以使numpy的数组(array),如果是pandas的dataframe,则df的index/column信息会分别对应到heatmap的columns和rows;
- vmax,vmin:图例中最大值和最小值的显示值,没有该参数时默认不显示;
- cmap:从数字到色彩空间的映射,取值是matplotlib包里的colormap名称或颜色对象,或者表示颜色的列表;
- center:数据表取值有差异时,设置热力图的色彩中心对齐值。通过设置center值,可以调整生成的图像颜色的整体深浅;设置center数据时,如果有数据溢出,则手动设置的vmax、vmin会自动改变 ;
- robust:默认取值False;如果是False,且没设定vmin和vmax的值,热力图的颜色映射范围根据具有鲁棒性的分位数设定,而不是用极值设定;
- annot(annotate的缩写):默认取值False;如果是True,在热力图每个方格写入数据;如果是矩阵,在热力图每个方格写入该矩阵对应位置数据;
- fmt:字符串格式代码,矩阵上标识数字的数据格式,比如保留小数点后几位数字;
- annot_kws:默认取值False;如果是True,设置热力图矩阵上数字的大小颜色字体;
- square:设置热力图矩阵小块形状,默认值是False;
- xticklabels, yticklabels:控制每行列标签名的输出。默认值是auto,自动选择标签的标注间距,将标签名不重叠的部分(或全部)输出。如果是True,则以DataFrame的列名作为标签名;
- mask:控制某个矩阵块是否显示出来。默认值是None。如果是布尔型的DataFrame,则将DataFrame里True的位置用白色覆盖掉。
5.2 clustermap(聚类图)
clustermap() 可以将矩阵数据集绘制为层次聚类热图。具体参数如下:
seaborn.clustermap(data, pivot_kws=None, method='average', metric='euclidean',
z_score=None, standard_scale=None, figsize=None,
cbar_kws=None, row_cluster=True, col_cluster=True,
row_linkage=None, col_linkage=None, row_colors=None,
col_colors=None, mask=None, **kwargs))
边栏推荐
- MySQL --- 多表查询 - 表与表之间的关系
- [Huang ah code] Why do I suggest you choose go instead of PHP?
- Analysis of redis and MySQL double write consistency scheme
- Do you know the answers to the common questions in the interview of senior programmers? With answer
- [JS encapsulates a simple asynchronous API to obtain asynchronous operation results and process parsing]
- Figure execution engine (I)
- js将json数组导出为excel
- Unity about some possible reasons and solutions for using addforce of rigidbody but it doesn't work
- Leetcode high frequency question: image intersection and union ratio IOU calculation method and hand tearing code
- Technology cloud report: what is the core ability to build observability?
猜你喜欢

On learning relational operators in JS

Embedded development: seven techniques for accelerating firmware development

华为和荣耀手机升级鸿蒙系统之后与matebook无法多屏协同的问题

MySQL - multi table query - relationship between tables

On Relational operators in JS

Copy the contents of one folder to another folder

What is the event delegation in JS?

机器学习笔记 - 使用 GAN 进行数据增强以进行缺陷检测
![leetcode:1552. Magnetic force between two balls [maximum value of maximum value = two points]](/img/42/138282c12bf9972a9e92b6fe8e9b8b.png)
leetcode:1552. Magnetic force between two balls [maximum value of maximum value = two points]

Everything you need to know about cognitive analysis
随机推荐
What are the directions of voice signal processing in audio and video?
VMware recovery snapshot failed to create an anonymous paging file of 5040 MB: insufficient system resources to complete the requested service
Use of prettier code formatting tool
[enterprise wechat self built application development]
Different image patches are processed by different expert models! Nanyang Institute of Technology & Mila sparse fusion hybrid expert model SF MOE has super generalization ability! The code is open sou
Redis - detailed explanation of slot management commands
[C language brush leetcode] 1432 The maximum difference that can be obtained by changing an integer (m)
【黄啊码】为什么我建议您选择go,而不选择php?
Introduction to phabricator conduct API
专属资源池使用最佳实践-依赖服务使用简介
js将json数组导出为excel
图执行引擎那些事(一)
Blog migration from cloudbase to virtual machine
专属资源池使用最佳实践-Notebook与训练任务联动
[cache] introduction of a new cache caffeine cache
Unity about some possible reasons and solutions for using addforce of rigidbody but it doesn't work
【我的OpenGL学习进阶之旅】NDK开发中find_library查找的系统动态库在哪里?
New construction process of Hongmeng application development project and generation method of HAP package
How to deal with the security risks of the third party in the supply chain
Mysql——字符串函数