# TF-IDF Regression & Machine Learning

I would like to take a set of documents where each document already has an assigned popularity change value ("trending", i.e. -10%, +25%, etc.), and create a machine learning model that would be able to predict a "trending" value for a new document.

After creating TF-IDFs for all documents, dropping some of the rarest words that only appear in 1 document, possibly removing stop words, etc., I'm a little lost. Is it the right approach to use some kind of sentiment analysis model that would train the TF-IDF vectors on the popularity change values? I am also thinking about how to train a regular regression model for this task, but it doesn't seem like an easy choice to integrate with TD-IDF data.

I would tackle it as a multi-class problem if your output is categorical, hence indeed only $10\%$, $25\%$ and so on. If you want to treat it as a regression problem, I'd say you need continuous deltas of popularity, so you need all kinds of values as the delta, and not only a fixed number of them. The training data should dictate how you approach the problem. Note that you can always reduce the regression to a multi-class problem (which asks for an instance which of the deltas it should assign) by bucketing to intervals.
For argument's sake let's assume you have multi-class data. One document has one of the classes, i.e. $10\%$. You then go ahead and encode these classes into a binary vector, which probably even is a part of the library you're using.