Vectors can become extremely sparse, particularly as vocabularies get larger, which can have a
significant impact on the speed and performance of machine learning models. For very large corpora,
it is recommended to use the Scikit-Learn HashingVectorizer, which uses a hashing trick to find the
token string name to feature index mapping. This means it uses very low memory and scales to large
datasets as it does not need to store the entire vocabulary and it is faster to pickle and fit since there
is no state. However, there is no inverse transform (from vector to text), there can be collisions, and
there is no inverse document frequency weighting.
The [Link]() method is optional; it converts the sparse matrix representation to a dense one.
In corpora with large vocabularies, the sparse matrix representation is much better.
Trees are known to have difficulties in handling high-dimensional sparse data like tf-idf vectors.
Adversarial machine learning
Adversarial machine learning is a machine learning technique that attempts to fool models by
supplying deceptive input. The most common reason is to cause a malfunction in a machine learning
model.
Most machine learning techniques were designed to work on specific problem sets in which the
training and test data are generated from the same statistical distribution (IID). When those models
are applied to the real world, adversaries may supply data that violates that statistical assumption.
This data may be arranged to exploit specific vulnerabilities and compromise the results.