Last active
July 13, 2020 09:13
-
-
Save aniruddha27/b05d3d25a5f9c955316bfa6fa1ae9117 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Top features and SalePrice | |
numeric_cols = ['GrLivArea','GarageArea','TotalBsmtSF','1stFlrSF','YearBuilt'] | |
nominal_cols = ['OverallQual','GarageCars','FullBath','TotRmsAbvGrd'] | |
fig,ax=plt.subplots(nrows=9,ncols=1,figsize=(6,30)) | |
for i in range(len(top_features)): | |
ax[i].scatter(x=train[top_features[i]], y=train['SalePrice']) | |
ax[i].set_xlabel('%s'%(top_features[i])) | |
ax[i].set_ylabel('SalePrice') | |
plt.tight_layout() | |
plt.savefig('./Top_featuresvsSalePrice.jpg',dpi=300,bbox_inches='tight') | |
plt.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am getting this error while running this code.
KeyError: 0.7909816005838047
and if I replace 5th line of code to this <ax[i].scatter(x=top_features[i], y=train['SalePrice'])> getting error of ValueError: x and y must be the same size