diff --git a/machineLearning/Predictor.py b/machineLearning/Predictor.py index 0fa20c6..31df3b1 100644 --- a/machineLearning/Predictor.py +++ b/machineLearning/Predictor.py @@ -4,6 +4,7 @@ import operator # prepare data +dataFile = 'previousGames.csv' usersInput = [] enemyHistory = [] playerHistory = [] @@ -143,10 +144,12 @@ def doPredictions(enemyStrategy): result = predictTitForTat() elif enemyStrategy == "Grudger": result = predictUnforgiving() + if result == False: + print("Opponents next move (prediction) - silence") + elif result == True: + print("Opponents next move (prediction) - betray") - print(result) - -loadDataset('previousGames.csv', trainingSet) +loadDataset(dataFile , trainingSet) print('Train set: ' + repr(len(trainingSet))) while finished == False: @@ -164,7 +167,3 @@ def doPredictions(enemyStrategy): print('>predicted player strategy = ' + playerStrategy) doPredictions(enemyStrategy) - - - -