1

Is there a way to extract the parameters of the regression line(s) that seaborn.lmplot() fits for a given set of data? I have looked up the documentation and haven't been able to spot anything that would help me in this regard.

Just to be clear, I don't mean the lmplot()'s function parameters, but the m,
and b of y = mx + b.

navneethc
  • 1,234
  • 8
  • 17

1 Answers1

2

seaborn uses scipy stats linregress, so you could get it directly from there.

from scipy import stats
slope, intercept, r_value, p_value, std_err = stats.linregress(df.x,df.y)
supercooler8
  • 503
  • 2
  • 7
  • Thank you. Technically, the source code uses matrix multiplication using numpy for the case of bare-bones least squares that I was after, but your answer was helpful nevertheless. – navneethc Feb 26 '21 at 17:07