. . . . . . . . produce sparse matrices of real numbers that can be fed into any machine learning model.

DictVectorizer
FeatureHasher
Both A and B
None of the Mentioned

The correct answer is: B. FeatureHasher

A FeatureHasher is a transformer that converts a collection of features into a set of feature hashes. It does this by hashing each feature value and then converting the hash into a vector of binary values. This can be done very efficiently, and it can be used to create sparse matrices that can be fed into any machine learning model.

A DictVectorizer is a transformer that converts a collection of features into a sparse matrix. It does this by first converting each feature value into a vector of binary values. It then converts these vectors into a sparse matrix by only storing the non-zero values. This can be done very efficiently, and it can be used to create sparse matrices that can be fed into any machine learning model.

However, a DictVectorizer is not as efficient as a FeatureHasher, and it does not produce as sparse matrices. This is because a DictVectorizer stores the

74.6 75.5c-23.5 6.3-42 24.9-48.3 48.6-11.4 42.9-11.4 132.3-11.4 132.3s0 89.4 11.4 132.3c6.3 23.7 24.8 41.5 48.3 47.8C117.2 448 288 448 288 448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zm-317.5 213.5V175.2l142.7 81.2-142.7 81.2z"/> Subscribe on YouTube
entire vector for each feature value, even if only a few of the values are non-zero. A FeatureHasher, on the other hand, only stores the non-zero values, which makes it more efficient and produces sparser matrices.

Therefore, the correct answer is: B. FeatureHasher

Exit mobile version