title: Why does the AI model give random results instead of the same ones each time I run the script again?
body: <p>The thing that I completely don't understand is that when I run this script/model over and over again - I get completely different results each time - (sometimes 100% accuracy, sometimes 50% and sometimes 0%...) so it seems that the results are just random. Could someone explain to me why? (Note: I get random output with the same data! Test/train data are not shuffled/randomized)</p>
  <p>I tried to simplify my model very much, including the dataset, so that it could be inserted here. The goal is to predict the outcome of a sports match from various statistical data. The outcome y should be either 1 (favorit wins), 0 (draw) or 2 (underdog wins).</p>
  <pre><code>import numpy as np
  import tensorflow as tf
  from keras.models import Sequential
  from keras.layers import Dense
  
  data = np.array ([ 
  [2.0, 1.7, 4.82, 3.77, 23.0, 19.0, 21.0, 28.0, 3.0, 1.0, 23.0, 19.0, 21.0, 28.0, 3.0, 1.0, 16.0, 25.0, 14.0, 23.0, 23.0, 28.0, 23.0, 28.0, 28.0, 27.0, 17.0, 24.0, 29.0, 1.0, 10.0, 0.0, 29.0, 29.0, 0.0, 16.0, 12.0, 8.0, 8.0, 12.0, 5.0, 11.0, 8.0, 5.0, 11.0, 12.0, 11.0, 9.0, 11.0], 
  [1.0, 1.83, 4.73, 3.31, 8.0, 3.0, 3.0, 8.0, 12.0, 13.0, 8.0, 3.0, 3.0, 8.0, 12.0, 13.0, 10.0, 13.0, 12.0, 10.0, 23.0, 21.0, 23.0, 28.0, 28.0, 26.0, 17.0, 24.0, 29.0, 28.0, 13.0, 24.0, 5.0, 5.0, 24.0, 10.0, 12.0, 6.0, 8.0, 12.0, 5.0, 11.0, 8.0, 5.0, 11.0, 12.0, 11.0, 9.0, 11.0],
  [0.0, 2.19, 3.5, 3.15, 14.0, 9.0, 10.0, 15.0, 20.0, 20.0, 14.0, 9.0, 10.0, 15.0, 20.0, 20.0, 13.0, 18.0, 13.0, 16.0, 23.0, 25.0, 23.0, 28.0, 28.0, 27.0, 17.0, 24.0, 29.0, 0.0, 13.0, 27.0, 2.0, 2.0, 27.0, 13.0, 12.0, 7.0, 8.0, 12.0, 5.0, 11.0, 8.0, 5.0, 11.0, 12.0, 11.0, 9.0, 11.0], 
  [1.0, 1.84, 4.68, 3.3, 20.0, 22.0, 29.0, 4.0, 4.0, 28.0, 20.0, 22.0, 29.0, 4.0, 4.0, 28.0, 25.0, 4.0, 3.0, 1.0, 21.0, 25.0, 20.0, 24.0, 24.0, 0.0, 19.0, 24.0, 2.0, 26.0, 4.0, 8.0, 21.0, 21.0, 8.0, 25.0, 2.0, 4.0, 8.0, 2.0, 5.0, 2.0, 8.0, 5.0, 11.0, 1.0, 11.0, 9.0, 12.0], 
  [1.0, 1.51, 6.1, 4.3, 17.0, 19.0, 27.0, 3.0, 2.0, 26.0, 17.0, 19.0, 27.0, 3.0, 2.0, 26.0, 0.0, 20.0, 2.0, 8.0, 22.0, 2.0, 19.0, 24.0, 24.0, 1.0, 19.0, 24.0, 2.0, 28.0, 2.0, 14.0, 15.0, 15.0, 14.0, 0.0, 3.0, 6.0, 8.0, 2.0, 5.0, 3.0, 8.0, 5.0, 11.0, 1.0, 11.0, 9.0, 12.0], 
  [1.0, 1.3, 11.52, 4.95, 22.0, 28.0, 10.0, 16.0, 13.0, 4.0, 22.0, 28.0, 10.0, 16.0, 13.0, 4.0, 23.0, 16.0, 4.0, 29.0, 21.0, 23.0, 20.0, 24.0, 24.0, 0.0, 19.0, 24.0, 2.0, 26.0, 17.0, 7.0, 22.0, 22.0, 7.0, 23.0, 2.0, 3.0, 8.0, 1.0, 5.0, 2.0, 8.0, 5.0, 11.0, 1.0, 11.0, 9.0, 12.0], 
  [1.0, 1.82, 5.11, 3.18, 25.0, 25.0, 5.0, 16.0, 17.0, 9.0, 25.0, 25.0, 5.0, 16.0, 17.0, 9.0, 14.0, 22.0, 7.0, 22.0, 21.0, 11.0, 20.0, 25.0, 25.0, 0.0, 19.0, 24.0, 2.0, 22.0, 15.0, 27.0, 2.0, 2.0, 27.0, 14.0, 2.0, 10.0, 8.0, 1.0, 5.0, 2.0, 8.0, 5.0, 11.0, 1.0, 11.0, 9.0, 12.0], 
  [2.0, 2.54, 2.97, 3.04, 18.0, 21.0, 28.0, 4.0, 4.0, 27.0, 18.0, 21.0, 28.0, 4.0, 4.0, 27.0, 5.0, 19.0, 1.0, 16.0, 22.0, 8.0, 19.0, 23.0, 23.0, 1.0, 19.0, 24.0, 2.0, 0.0, 20.0, 18.0, 11.0, 11.0, 18.0, 5.0, 3.0, 8.0, 8.0, 2.0, 5.0, 3.0, 8.0, 5.0, 11.0, 1.0, 11.0, 9.0, 12.0], 
  [1.0, 1.62, 2.26, 0.0, 21.0, 27.0, 23.0, 15.0, 9.0, 10.0, 21.0, 27.0, 23.0, 15.0, 9.0, 10.0, 9.0, 8.0, 11.0, 12.0, 28.0, 16.0, 10.0, 10.0, 10.0, 9.0, 21.0, 26.0, 7.0, 15.0, 24.0, 22.0, 7.0, 7.0, 22.0, 9.0, 6.0, 12.0, 10.0, 6.0, 7.0, 7.0, 9.0, 4.0, 10.0, 1.0, 11.0, 9.0, 12.0], 
  [1.0, 1.53, 2.46, 0.0, 25.0, 0.0, 26.0, 18.0, 12.0, 13.0, 25.0, 0.0, 26.0, 18.0, 12.0, 13.0, 11.0, 4.0, 11.0, 16.0, 28.0, 16.0, 10.0, 9.0, 9.0, 8.0, 21.0, 26.0, 7.0, 16.0, 18.0, 24.0, 5.0, 5.0, 24.0, 11.0, 6.0, 1.0, 10.0, 6.0, 7.0, 7.0, 9.0, 4.0, 10.0, 1.0, 11.0, 9.0, 12.0],
  ])
  
  trainSize = int(len(data) * 0.8)
  testSize = len(data) - trainSize
  trainData, testData = data[0:trainSize], data[trainSize:]
  
  xTrain, yTrain = trainData.T[1:].T, trainData.T[0]
  xTest, yTest = testData.T[1:].T, testData.T[0]
      
      
  
  model = Sequential()
  model.add (tf.keras.layers.Dense(3, activation=&quot;softmax&quot;))
  model.compile(
          optimizer='adam',
          loss = 'mse',
          metrics=['accuracy'],
  )
  model.fit(xTrain, yTrain, epochs=200, verbose=0)
  val_loss, val_acc = model.evaluate(xTest, yTest)
  print (val_loss, val_acc)
  
  </code></pre>
  <pre><code>1/1 [==============================] - 0s 181ms/step - loss: 0.6667 - accuracy: 1.0000
  0.6666609048843384 1.0
  
  1/1 [==============================] - 0s 186ms/step - loss: 0.6667 - accuracy: 0.0000e+00
  0.6666666865348816 0.0
  
  1/1 [==============================] - 0s 230ms/step - loss: 0.6667 - accuracy: 1.0000
  0.6666666865348816 1.0
  
  1/1 [==============================] - 0s 263ms/step - loss: 0.6632 - accuracy: 0.5000
  0.6631913781166077 0.5
  
  1/1 [==============================] - 0s 196ms/step - loss: 0.6667 - accuracy: 0.0000e+00
  0.6666661500930786 0.0
  
  1/1 [==============================] - 0s 157ms/step - loss: 0.6667 - accuracy: 1.0000
  0.6666666865348816 1.0
  
  1/1 [==============================] - 0s 217ms/step - loss: 0.6589 - accuracy: 0.5000
  0.6589114665985107 0.5
  </code></pre>