Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.