Created
August 23, 2017 17:27
-
-
Save Jian-Qiao/a015b6348bc14dcbfdcb6f670b622ab0 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
tf_vectorizer1 = CountVectorizer(max_df=0.95, min_df=2, max_features=400, | |
stop_words='english') | |
tf_vectorizer2 = CountVectorizer(max_df=0.95, min_df=2, max_features=200, | |
stop_words='english') | |
tf1 = tf_vectorizer1.fit_transform(np.array(Description_cleaned.replace(np.nan, ''))) | |
tf2 = tf_vectorizer2.fit_transform(np.array(Search_Term.replace(np.nan,''))) | |
TF = TfidfTransformer() | |
#tf_idf_Bullets = TF.fit_transform(tf1) | |
tf_idf_Description=TF.fit_transform(tf1) | |
tf_idf_Search_Term= TF.fit_transform(tf2) | |
Trans_Description=pd.DataFrame(tf_idf_Description.toarray()) | |
Trans_Description.index=Description_cleaned.index | |
Trans_Search_Term=pd.DataFrame(tf_idf_Search_Term.toarray()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment