Ejemplo n.º 1
0
def predict(args):
    day = args[2]
    num_lineups = int(args[3])
    filename = FILENAME_USED_NN
    if len(args) == 5:
        filename = "trainedModels/" + args[4]
    day_x, playerList = getInputForDay(day, True)
    print(day_x.shape)
    print(len(playerList))
    N, M = day_x.shape
    day_X = np.ones((N, M + 1))
    day_X[:, 1:] = day_x
    model = NeuralNet(NeuralNet.load(filename))

    scores, predictedLineups = model.getPrediction(day_X, playerList,
                                                   num_lineups)
    print()
    print("No noise lineup : ")
    for i in range(len(scores)):
        predictedLineup = predictedLineups[i]

        print("player selected:")
        for player in predictedLineup:
            print(player.toString())
        print()
        print("Expected total score :" + str(scores[i]))
        print("---------------")