October 2018
Beginner to intermediate
676 pages
18h 30m
English
Here are the steps to plot the required plots:
R, p = pearsonr(wine_quality['fixed acidity'], wine_quality.pH)g1 = sns.regplot(x='fixed acidity', y='pH', data=wine_quality, truncate=True, ci=99, marker='D', scatter_kws={'color': 'r'});textstr = '$\mathrm{pearson}\hspace{0.5}\mathrm{R}^2=%.2f$\n$\mathrm{pval}=%. 2e$' % (R**2, p)props = dict(boxstyle='round', facecolor='wheat', alpha=0.5)g1.text(0.55, 0.95, textstr, transform=ax.transAxes, fontsize=14, va='top', bbox=props)plt.title('1. Linear Regression', size=15, color='g', weight='bold')
g2 = sns.regplot(x='fixed acidity', y='pH', data=wine_quality, order=2, ...
Read now
Unlock full access