Created
March 5, 2023 02:41
-
-
Save parulnith/081898c0ea8c8c6b31d1595404864fc5 to your computer and use it in GitHub Desktop.
chapter11_page_359
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
corr = pd.DataFrame(train[features + | |
[target]].corr(method='spearman')[target]).iloc[:-1] | |
corr.columns = ['Spearman Correlation Coefficient'] | |
values = [int(i) for i in np.sign(corr.values)] | |
mono_constraints = dict(zip(corr.index, values)) | |
mono_constraints |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment