Skip to content

Instantly share code, notes, and snippets.

@grohith327
Created May 12, 2018 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grohith327/9cc4d71ea0bc7ac7f2cf6016465b1c7e to your computer and use it in GitHub Desktop.
Save grohith327/9cc4d71ea0bc7ac7f2cf6016465b1c7e to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
f,(ax1,ax2) = plt.subplots(1,2,figsize=(30,10))
# Linear Regression
ax1.scatter(range(len(y_test)),y_test,label='data')
ax1.plot(range(len(y_test)),y_pred_lr,color='green',label='LR model')
ax1.legend()
# Support Vector Machine
ax2.scatter(range(len(y_test)),y_test,label='data')
ax2.plot(range(len(y_test)),y_pred_svr,color='orange',label='SVM-RBF model')
ax2.legend()
f1,(ax3,ax4) = plt.subplots(1,2,figsize=(30,10))
# Random Forest Regressor
ax3.scatter(range(len(y_test)),y_test,label='data')
ax3.plot(range(len(y_test)),y_pred_rf,color='red',label='RF model')
ax3.legend()
# Gradient Boosting Regressor
ax4.scatter(range(len(y_test)),y_test,label='data')
ax4.plot(range(len(y_test)),y_pred_gb,color='black',label='GB model')
ax4.legend()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment