So I started playing with FANN (http://leenissen.dk/) in order to create a simple recommendation engine.
For example,
User X has relations to records with ids [1, 2, 3]
Other users have relations to following ids:
[1, 2, 3, 4]
[1, 2, 3, 4]
It would be natural, then, that there's some chance user X would be interested in record with id 4
as well and that it should be the desired output of the recommendation engine.
It feels like this would be something a neural network could accomplish. However, from trying out FANN and googling around, it seems there seems to need to be some mathematical relation with the data and results. Here with ids there's none; the ids could just as well be any symbols.
Question: Is it possible to solve this kind of problem with a neural network and where should I begin to search for a solution?
What you are looking for is some kind of recurrent neural network; a network that stores 'context' in some way or another. Examples of such networks would be LSTM and GRU. So basically, you have to input your data sequentially. Based on the context and the current input, the network will predict which label is most likely.
it seems there seems to need to be some mathematical relation with the data and results. Here with ids there's none; the ids could just as well be any symbols.
There is a definitely relation between the data and the results, and this can be expressed through weights and biases.
So how would it work? First you one-hot encoding your inputs and outputs. So basically, you want to predict which label is most likely after a set of labels that a user has already interacted with.
If you have 5 labels: A, B, C, D, E that means you will have 5 inputsand outputs: [0, 0, 0, 0, 0]
.
If your label is A, the array will be [1, 0, 0, 0, 0]
, if it's D, it will be [0, 0, 0, 1, 0]
.
So the key to LSTM's and GRU's that the data should be sequential. So basically, you input all the labels watched one by one. So if a user has watched A, B and C:
activate: [1,0,0,0,0]
activate: [0,1,0,0,0]
// the output of this activation will be the next predicted label
activate: [0,0,1,0,0]
// output: [0.1, 0.3, 0.2, 0.7, 0.5], so the next label is D
And you should always train the network so that the output of INt is INt+1