Skip to content

Instantly share code, notes, and snippets.

@mempirate
Created April 4, 2018 15:17
Show Gist options
  • Save mempirate/f9260d774b06cc4c86812d61f3528046 to your computer and use it in GitHub Desktop.
Save mempirate/f9260d774b06cc4c86812d61f3528046 to your computer and use it in GitHub Desktop.
# Visualizing the training set results
plt.figure(figsize = (12, 6))
plt.scatter(X_train, y_train, alpha = 0.4, label = 'Observation Points')
plt.plot(X_train, regressor.predict(X_train), color = 'green', lw = 0.7, alpha = 0.8, label = 'Best Fit Line')
plt.title('Linear Regression (Training Set)')
plt.xlabel('Years of Experience')
plt.ylabel('Salary')
plt.legend()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment