<p>Treating the genres as tokens, and training a vector-per-genre, should be possible. </p>

<p>For training, you'd need "texts" that use the different genres together - these could be the multiple genres users have assigned to a single track, or the sequences-of-genres within a certain user's listening-history, or the sequences-of-genres within a certain artist's works, etc. </p>

<p>And, I suspect this approach could work fairly well, successfully placing genres into a coordinate space where their relative distances/directions to each other resemble human judgements. These "dense embeddings" could then be used as inputs to other downstream ML techniques. </p>

<p>Some thoughts that may help:</p>

<ul>
<li><p>For a good dense embedding, you'll want the space dimensionality to be much smaller than the count of unique tokens. That is, much smaller in number-of-continuous dimensions than the "one-hot" encoding would be. So you probably <strong>don't</strong> want to collapse related genres (like <code>low-fi trap</code> into <code>trap</code>) - that'd be throwing away potentially useful subtleties in the data, even if they're noisy, when the point of *2vec training is to be able to learn/numerically-model such subtleties (as long as there are enough examples of contextual use). </p></li>
<li><p>When training on data that isn't truly natural language, and for specific predictive purposes, it becomes more likely that training parameters far from the usual defaults may be optimal – once you have a repeatable way to score different models for your purposes. (For example, there's a exponentiation parameter used in the negative-sampling that was fixed at <code>0.75</code> in most word2vec implementations - but a <a href="https://arxiv.org/abs/1804.04212" rel="nofollow noreferrer">recent paper</a> suggests very-different values may be noticeably better in recommendation-applications. So, it's been made specifiable in recent versions of the Python <code>gensim</code> library.)</p></li>
</ul>
Lack of ideas for vectorization of text feature (music genre)
<p>I'm in the process of creating a predictive model of track popularity. One of the features that I have is music genre. The variable contains many unique, but similar values, for instance: 'contemporary country', 'country pop', 'trap', 'lo-fi trap'. <strong>I'm looking for a ways to represent that column numerically</strong>.</p>

<p>I would like to create 1D embeddings for my the music genre variable based on audio features of tracks belonging to a particular genre. Is that actually possible ?</p>

<p>I'd be super grateful for any kind of assistance with the problem.</p>