Training Artificial Neural Networks – Resturant Case

My friend has a #restaurant, and he wanted to have a why to anticipate what their #customers are going to order. An #Artificial #Intelligence can help to #suggest #dishes based on what the customers have been ordering.

Imagine we are serving 5 dishes, and our #AI must to forecast the next dish. We have been training a 5 inputs #neural #network with 5 outputs with a #history of 260 entries. In the database, the 5 first columns belong to the dishes that have been ordered already (1 ordered, 0 not yet ordered), and the 5 last columns indicate what was the next ordered dish (1 marks which of the 5 available dishes). Then after the network was #trained, we #query it:

For 0 0 0 1 0 (our customers have just ordered dish number 4) we got:
0.312345415353775
0.19600684940814972
0.3541507124900818
-0.0949629694223404
0.16669832170009613
The highest values are the suggestions from our network: Dishes number 1 and 3.

You can play with the test network in here https://fann.ehehdada.com/Yp17ildLWDT-8FKVTCfL7XaWvHys

This is the training database:
260 5 5
1 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 1 0 0 0
1 0 0 0 0 0 1 0 0 0
1 0 0 0 0 0 1 0 0 0
1 0 0 0 0 0 0 1 0 0
1 0 0 0 0 0 0 1 0 0
1 0 0 0 0 0 0 1 0 0
1 0 0 0 0 0 0 1 0 0
1 0 0 0 0 0 0 0 1 0
1 0 0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
0 1 0 0 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0
0 1 0 0 0 1 0 0 0 0
0 1 0 0 0 0 0 1 0 0
0 1 0 0 0 0 0 1 0 0
0 1 0 0 0 0 0 0 1 0
0 1 0 0 0 0 0 0 1 0
0 1 0 0 0 0 0 0 1 0
0 1 0 0 0 0 0 0 1 0
0 1 0 0 0 0 0 0 1 0
0 1 0 0 0 0 0 0 1 0
0 1 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0
1 1 0 0 0 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