How to find categorical features from a vector representation of text?

The context of the question: I have a pandas dataframe where one column has text values and others have categorical values. I trained a word2vec model with tensorflow with some sample data. And I convert my text column into the vector representation. But I want to feed these data to Catboost for regression task. But I can't feed those data to catboost because of catboost only accept the Categorical variable.

I found a tutorial on Catboost Github page for this. But this example is for the classification task. It finds cosine and other types of relationship between two vector representation of text. But in my case, I have only one text field. So how can calculate cosine or other types relationship?

So my question is how to extract categorical features from the vector representation of text data?

• Could you describe what the text column looked like? It might be an idea to just convert it using bag-of-words in binary form – S van Balen Feb 26 '18 at 19:49

You could try a clustering algorithm on the vector representation of your text data to see what clusters exist. Then once you have discovered the unique clusters, assign a cluster identity (for example, a single digit value indicating cluster identity (1, 2, 3, 4 etc)). Then you can use Keras's to_categorical function to convert the cluster identity to categorical values.
That's not true. Actually CatBoost uses continuous variables by default, and to use categorical ones you'd need to tell your estimators which features are categorical with cat_features parameter.