0% found this document useful (0 votes)
10 views1 page

Optimizing Sparse Vectors in ML

Vectors can become extremely sparse as vocabularies increase, impacting machine learning performance. For large datasets, Scikit-Learn's HashingVectorizer is recommended as it uses hashing to map tokens to indices, uses low memory and scales well but provides no inverse transforms or weighting. Trees struggle with high-dimensional sparse data like tf-idf vectors. Adversarial machine learning aims to fool models by supplying deceptive input, exploiting vulnerabilities in models designed for consistent training and test data.

Uploaded by

DummY Name
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Optimizing Sparse Vectors in ML

Vectors can become extremely sparse as vocabularies increase, impacting machine learning performance. For large datasets, Scikit-Learn's HashingVectorizer is recommended as it uses hashing to map tokens to indices, uses low memory and scales well but provides no inverse transforms or weighting. Trees struggle with high-dimensional sparse data like tf-idf vectors. Adversarial machine learning aims to fool models by supplying deceptive input, exploiting vulnerabilities in models designed for consistent training and test data.

Uploaded by

DummY Name
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like