Session Ready
Exercise

Removing sparse terms

Running classification models on sparse matrices can be a computational nightmare. Without access to GPUs or cloud compute resources, you might run into time and memory issues on your local computer. You have been given a document-term matrix and plan on running several different algorithms to find the best classification model. In this exercise, you will remove some of the sparse terms from the provided matrix, matrix, at different sparsity levels.

For each level of sparsity, note the number of remaining terms in the matrix.

Instructions 1/4
undefined XP
  • 1
    • Remove sparse terms from the document-term matrix, matrix, using a value of .50.
    • 2
      • Remove sparse terms from the document-term matrix, matrix, using a value of .90.
    • 3
      • Remove sparse terms from the document-term matrix, matrix, using a value of .99.
    • 4
      • Remove sparse terms from the document-term matrix, matrix, using a value of .9999.