예제 #1
0
 print(
     " - Plotting the cumulative rewards, and saving the plot to {} ..."
     .format(savefig))
 savefig = mainfig
 evaluation.plotRegrets(envId, savefig=savefig,
                        moreAccurate=True)  # XXX To save the figure
 savefig = mainfig.replace('main', 'main_LessAccurate')
 evaluation.plotRegrets(
     envId, savefig=savefig,
     moreAccurate=False)  # XXX To save the figure
 savefig = mainfig.replace('main', 'main_BestArmPulls')
 print(
     " - Plotting the probability of picking the best arm, and saving the plot to {} ..."
     .format(savefig))
 # --- Also plotting the probability of picking the best arm
 evaluation.plotBestArmPulls(
     envId, savefig=savefig)  # XXX To save the figure
 # if configuration['horizon'] >= 1000:
 #     savefig = mainfig.replace('main', 'main_semilogx')
 #     evaluation.plotRegrets(envId, savefig=savefig, semilogx=True)  # XXX To save the figure
 savefig = mainfig.replace('main', 'main_semilogy')
 evaluation.plotRegrets(envId, savefig=savefig,
                        semilogy=True)  # XXX To save the figure
 if configuration['horizon'] >= 1000:
     savefig = mainfig.replace('main', 'main_loglog')
     evaluation.plotRegrets(envId, savefig=savefig,
                            loglog=True)  # XXX To save the figure
 if configuration['repetitions'] > 1:
     if plotSTD:
         savefig = savefig.replace('main', 'main_STD')
         evaluation.plotRegrets(
             envId,
    evaluation.printLastRegrets(envId)
    print("\nGiving the final ranking ...")
    evaluation.printFinalRanking(envId)

    print("\n\n- Plotting the last regrets...")
    evaluation.plotLastRegrets(envId, boxplot=True)

    print("\nGiving the mean and std running times ...")
    evaluation.printRunningTimes(envId)
    evaluation.plotRunningTimes(envId)

    print("\nGiving the mean and std running times ...")
    evaluation.printMemoryConsumption(envId)
    evaluation.plotMemoryConsumption(envId)

    print("\n\n- Plotting the mean reward...")
    evaluation.plotRegrets(envId, meanReward=True)

    print("\n\n- Plotting the regret...")
    evaluation.plotRegrets(envId)

    print("\n- Plotting the probability of picking the best arm of time...")
    evaluation.plotBestArmPulls(envId)

    print("\n- Plotting the histograms of regrets...")
    evaluation.plotLastRegrets(envId, sharex=True, sharey=True)

# Done
print("Done for simulations example_of_main_singleplayer ...")
notify("Done for simulations example_of_main_singleplayer ...")