Answers for "plot multiplr linear regression model python"

0

plot multiplr linear regression model python

import matplotlib.pyplot as plt

plt.style.use('default')
plt.style.use('ggplot')

fig, ax = plt.subplots(figsize=(7, 3.5))

ax.plot(x_pred, y_pred, color='k', label='Regression model')
ax.scatter(X, y, edgecolor='k', facecolor='grey', alpha=0.7, label='Sample data')
ax.set_ylabel('Gas production (Mcf/day)', fontsize=14)
ax.set_xlabel('Porosity (%)', fontsize=14)
ax.legend(facecolor='white', fontsize=11)
ax.text(0.55, 0.15, '$y = %.2f x_1 - %.2f $' % (model.coef_[0], abs(model.intercept_)), fontsize=17, transform=ax.transAxes)

fig.tight_layout()
Posted by: Guest on December-14-2020
0

plot multiplr linear regression model python

from sklearn import linear_model

ols = linear_model.LinearRegression()
model = ols.fit(X, y)
Posted by: Guest on December-14-2020

Code answers related to "plot multiplr linear regression model python"

Python Answers by Framework

Browse Popular Code Answers by Language