当前位置:网站首页>5-4 Seaborn 线性回归绘图
5-4 Seaborn 线性回归绘图
2022-08-09 00:29:00 【刚入门的小仙女】
Seaborn 线性回归绘图
Seaborn是基于 Matplotlib 的图形可视化库。该库提前定义好了一套自己的风格,也封装了一系列的方便的绘图函数,之前通过 matplotlib 需要很多代码才能完成的绘图,使用 seaborn 可能就是一行代码的事情。总结一句话:使用 seaborn 绘图比 matplotlib 更美观、简单。
4. 线性回归绘图
线性回归绘图看到数据的关系趋势。在 Seaborn 中可以通过 regplot 和 lmplot 两个函数来实现。regplot 的 x 和 y 可以为 Numpy 数组、Series 等变量,而 lmplot 的 x 和 y 则必须为字符串,并且 data 的值不能为空
- regplot( x , y , data=None)
- lmplot( x , y , data)
import seaborn as sns
import pandas as pd
tips = pd.read_csv("dataset/tips.csv")
sns.lmplot(x="total_bill",y="tip",data=tips)

#sns.regplot(x=tips["total_bill"],y=tips["tip"],data=tips)结果一致
sns.regplot(x="total_bill",y="tip",data=tips)

边栏推荐
- Risk Control Modeling IV: Logistic Regression Scorecard Development
- 求所有子串的最大值之和
- GaN图腾柱无桥 Boost PFC(单相)二 (公式推到理解篇)
- 在Ubuntu/Linux环境下使用MySQL:解决com.mysql.jdbc.PacketTooBigException: Packet for query is too large的问题
- 线程与线程池
- GaN图腾柱无桥 Boost PFC(单相)三(预测模型)
- 【科研-学习-pytorch】3-分类问题
- 2021 icpc 上海 H. Life is a Game
- 经典卷积神经网络ZFNet--解卷积可视化
- VsCode configures your favorite fonts and backgrounds. Mom no longer worries about my boring code writing.
猜你喜欢

Unity3D小白学习日记(01):如何把物体移动到鼠标点击处

Using MySQL on Windows: Automatic Scheduled Backups

GaN图腾柱无桥 Boost PFC(单相)三(预测模型)

笔记&代码 | 统计学——基于R(第四版) 第二章数据可视化

Dapr学习(4)之eShopOnDapr部署(Rancher2.63&k3s)
Sencha Touch延迟加载模块中的小类提高程序进入每个模块时性能

注意:服务器

手把手教你云服务器如何搭建typecho博客网站(包括配置免费SSL证书)

Sencha Touch页面跳转创建返回上一级按钮的设计思路

Using MySQL in Ubuntu/Linux environment: Solve the problem of com.mysql.jdbc.PacketTooBigException: Packet for query is too large
随机推荐
Use Ehcache distributed cache to easily create commercial-grade high-concurrency, high-performance API interfaces!
求按位或的最小生成树
桌面内容整理,用时高效
全新Swagger3.0教程,OAS3快速配置指南,实现API接口文档自动化!
笔记&代码 | 统计学——基于R(第四版) 第十一章 时间序列预测
无代码平台邮箱入门教程
年初离职,学习半年源码,终于拿到了蚂蚁 Offer,分享面试过程
STM32H750VBT6 Keil5 error :flash download failed cortex-M7
<力扣刷题>965. 单值二叉树
数学建模美赛题型分类
整流十—双二阶广义积分锁相
京东三面惨遭被虐,关于 redis,高并发,分布式,问懵了
NodeJs连接mysql数据库
【科研-学习-pytorch】5-boardcasting、合并分割
架构组学习总结
Unified identity management platform IAM single sign-on process and third-party interface design scheme
pycharm开启鼠标滚动调节字体大小
node工具之nodemon
最优化问题——线性规划模型
渐变纹理(光照渐变)