Created
December 17, 2019 16:04
-
-
Save khanhnamle1994/670a6aed82286b48a50a05ff311c01ce to your computer and use it in GitHub Desktop.
Second Code Snippet For CatBoost Article
This file contains hidden or 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
| # Transform a count matrix to a normalized tf or tf-idf representation | |
| transformer = TfidfTransformer() | |
| # Fit to data matrices, then transform them | |
| data_1 = transformer.fit_transform(data_cor1) | |
| data_2 = transformer.fit_transform(data_cor2) | |
| # Create a new column from these values | |
| data['cor1_Tfidf'] = np.mean(data_1, 1) | |
| data['cor2_Tfidf'] = np.mean(data_2, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment