-
-
Save amankharwal/66e2d3d44518d09ad0646264abccecf7 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
fig, axes = plt.subplots(1, 2, figsize=(20,8),) | |
fig.suptitle('Before and After Manually removing outliers') | |
axes[0].set_title('Before') | |
axes[1].set_title('After') | |
g = sns.regplot(x=train['GrLivArea'], y=train['SalePrice'], ax = axes[0]) | |
g.text(4500, 400000, "Outliers", horizontalalignment='left', size='large', color='black', weight='semibold') | |
g.axvline(4000, ls='--', color = 'red') | |
idx_manual = np.where(train['GrLivArea']>4000)[0] | |
train_NoOutlier = train.drop(idx_manual) | |
g = sns.regplot(x=train_NoOutlier['GrLivArea'], y=train_NoOutlier['SalePrice'], ax = axes[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment