, seaborn
- .
import seaborn as sns
sns.regplot(x='motifScore', y='expression', data=motif)
![sns.regplot](https://fooobar.com/undefined)
statsmodels.regression.linear_model.OLS
.
import statsmodels.api as sm
model = sm.OLS(motif.expression, sm.add_constant(motif.motifScore))
p = model.fit().params
x = np.arange(1, 3)
ax = df.plot(x='motifScore', y='expression', kind='scatter')
ax.plot(x, p.const + p.motifScore * x)
ax.set_xlim([1, 2])
![manual](https://fooobar.com/undefined)
- statsmodels.graphics.regressionplots.abline_plot
, .
import statsmodels.api as sm
from statsmodels.graphics.regressionplots import abline_plot
model = sm.OLS(motif.expression, sm.add_constant(motif.motifScore))
ax = df.plot(x='motifScore', y='expression', kind='scatter')
abline_plot(model_results=model.fit(), ax=ax)
![abline_plot](https://fooobar.com/undefined)