Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[MRG+1] Add validation of vocabulary in get_feature_names #10908
I removed the check for a given custom vocabulary form
The above code throws an error as expected, as the vocabulary of
However, inverting a matrix generated by
@rth How can we deal with this case? Can we check that the vocabulary used to invert is the same as the one used to generate the matrix? How can we ensure that, without enforcing the user to first run
What I meant is that it does not explicitly say to use the same vocabulary, although this is obvious.
However given a custom vocabulary, the inverse transform can still work (if the vocabulary is larger than the one that generated the data). A safeguard could be to throw a warning if this happens to avoid obtaining rubbish results.
But again, maybe the use of the inverse transform is so obvious that maybe we don't really need a warning here.
LGTM but I suppose this deserves a small changelog entry.
Please add an entry to the change log at