是否有一种方法可以提取seaborn.lmplot()
适合给定数据集的回归线参数?我已经查阅了文档,但在这方面没有发现任何可以帮助我的东西。
为了说明,我指的不是lmplot()
的功能参数,而是y = mx + b
的m
、
和b
。
seaborn使用scipy stats linregression,因此您可以直接从那里获得它。
from scipy import stats
slope, intercept, r_value, p_value, std_err = stats.linregress(df.x,df.y)