How to represent genre or artist name in a neural network I am writing a music recommendation system using machine learning. I'm attempting to make sense of ensemble networks to allow the system to learn from both the content-based features, as well as the global 'meta' features, such as the genre, year, artist etc.
However, I do not know how I should represent the genre and artist information. Making them integers would imply some sort of order. If Kanye West is 24, what should 25 be? 26?
Or is there something fundamentally wrong with my approach?
You can represent this kind of discrete information by means of embeddings.
An embedding is simply a table of vectors. It is defined by the number of vectors in the table and the length of each vector (i.e. dimensionality). You need to define a priori all the elements you want to support, e.g. for genres, you should list all the genres you will support, and list them. The index of each item is how you represent it.
You can have an embedding for each of the discrete features you need (genre, artist, etc).
In Keras, there is a layer for Embeddings.