Topic categorization is performed by analyzing the term-by-document matrix and using the singular value decomposition from linear algebra to extract key information from this matrix. The term-by-document matrix is generated by counting which terms in the term tables are present in which documents. Each column in the term-by-document matrix is a complete document, with nonzero entries for each term present in the document. In this example, no term-weighting is used, so a document gets a 1 for terms present in the document and a 0 for terms absent from the document. Frequency weights, which are often called local weights, are the first step in transforming the raw cell counts. The weights are No weighting (raw frequency), Binary (1 if term i is in document j), and Log (log base 2 with a correction for zero frequency). Term weights, often called global weights in the literature, modify frequency weights to adjust for document size and term distribution. Term weights can be calculated by Entropy, Inverse Document Frequency, Mutual Information, and No weighting adjustment. As an example, using the inverse document frequency statistics weighs rare terms higher than common terms because it's expected that rare terms contain more information. Regardless of how we choose to weigh the term-by-document matrix, we are left with a large and sparse matrix. This example is a small matrix, but text analytics projects generally use thousands of documents and will have even more terms. Most terms won't appear in most documents, so most of the entries in the term-by-document matrix will be zero. All these zeros indicate that the information contained in the term-by-document matrix can be compressed into matrices of smaller dimensionality. The dimensionality and sparseness problems are addressed by projecting the document and term vector spaces into a lower-dimensional space using singular value decomposition (or SVD). We don't want to lose important information, so instead of just chopping off arbitrary rows and columns, we want to transform the matrix so that the information is more densely packed in the matrix. This is done by performing a singular value decomposition on the term-by-document matrix, yielding a left and right transformation matrix as well as a matrix of singular values. These singular values represent the semantic information in the text, so only the largest singular values are kept. In this example, the 11x3 term-by-document matrix A is decomposed into the 11x3 matrix of left singular vectors U and the 3x3 matrix of right singular vectors V, with the singular values in the 3x3 diagonal matrix D. The first diagonal element of D is the largest singular value, and subsequent diagonal elements are the rest of the singular values in decreasing order. The lower dimensional projection is created by truncating the column of U, selecting only the first three. The calculation U-transpose multiplied by d_1, projects the vector corresponding to document 1 from 11 dimensions into 3 dimensions. The original document vector has rows corresponding to terms from the term-by-document matrix, so the compressed document vector now has rows corresponding to some compressed versions of the terms, which we identify as topics. We label these topics with the terms that have the highest weight in calculating the topic vectors. In addition to being interpreted as topics, these compressed document vectors can be used to generate numeric features to be fed into predictive models.