python - 如何从 Seaborn lmplot() 中提取线性模型参数?
问题描述
seaborn.lmplot()
有没有办法提取适合给定数据集的回归线的参数?我查阅了文档,但在这方面没有发现任何对我有帮助的东西。
为了清楚起见,我不是指lmplot()
' 函数参数,而是m
,
和b
of y = mx + b
。
解决方案
seaborn 使用 scipy stats linregress,所以你可以直接从那里得到它。
from scipy import stats
slope, intercept, r_value, p_value, std_err = stats.linregress(df.x,df.y)
推荐阅读
- linux - 如何让我的 Rflink (Arduino Mega) 端口显示在我的 Raspberry pi 3 上的 /dev 中?
- optimization - F# 和 ILNumerics
- regex - 重复正则表达式优化
- node.js - 我们计算的请求签名与您提供的签名不匹配。检查您的 Google 密钥和签名方法
- yq - 如何在搜索中将通配符与环境变量结合起来?
- python - 如何堆叠不均匀的numpy数组?
- sympy - SYMPY:如何用指数函数简化表达式?
- sql-server - VBA宏Excel - 从RecordSet获取所有记录的问题
- javascript - 在具有回调的外部库中获取异步函数以同步工作
- .net - 当 Windows 用户不是管理员时,ReadXml 的不同行为