Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding docs for .get_feature_names() inside TfidfVectorizer #4226

12 changes: 11 additions & 1 deletion python/cuml/feature_extraction/_tfidf_vectorizer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020, NVIDIA CORPORATION.
# Copyright (c) 2021, NVIDIA CORPORATION.
mayankanand007 marked this conversation as resolved.
Show resolved Hide resolved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -256,3 +256,13 @@ def transform(self, raw_documents):
"""
X = super().transform(raw_documents)
return self._tfidf.transform(X, copy=False)

def get_feature_names(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just after approving remembered that I forgot to ask, could you add a very simple pytest so that this method is covered?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

"""
Array mapping from feature integer indices to feature name.
Returns
-------
feature_names : Series
A list of feature names.
"""
return super().get_feature_names()