예제 #1
0
        sorted_results = results.sort_values(by=d).head(5000)
        print("Generating KDE plot")
        g = kde_plot(sorted_results,
                     params,
                     tolerance=tol,
                     n_ticks=4,
                     d=d,
                     median_file=os.path.join(figPath, "medians.txt"))
        g.fig.savefig(os.path.join(
            figPath, 'PLOS_experimental_{}_{}_kde.png'.format(
                str(tol).replace('.', '_'), d)),
                      bbox_inches='tight')
        print("Generating averaged time series plot")
        config["offset"] = {}
        for t in config["targets"]:
            config["offset"]["{}_offset".format(t)] = d0[t][0]
        fig = plot_repeated_outputs(results,
                                    n_repeats=25,
                                    tolerance=tol,
                                    distance=d,
                                    **config)
        fig.set_size_inches(18.5, 12.5)
        fig.savefig(os.path.join(
            figPath, 'PLOS_experimental_{}_{}_TS.png'.format(
                str(tol).replace('.', '_'), d)),
                    dpi=100)
        plt.close('all')

# TODO: Fix issue with plot formatting, cutting off axes etc
# TODO: Fix issue with time series cutting short.
예제 #2
0
                    figPath, 'tol_{}_histogram_{}.png'.format(str(lim).replace('.', '_'), DATASET)),
                bbox_inches='tight')
            print("Considering {} lowest values".format(lim))
            # print("Generating scatter plot")
            # scatter_dist_plot(results, params, tolerance=tol, n_ticks=4)
            print("Generating KDE plot")
            g = kde_plot(results, params, limit=lim, n_ticks=4, d=d,
                         median_file=os.path.join(figPath, "medians.txt"))
            g.fig.savefig(
                os.path.join(figPath, 'PLOS_{}_{}_{}_kde.png'
                             .format(DATASET, str(lim).replace('.', '_'), d)),
                bbox_inches='tight')
            print("Generating averaged time series plot")
            config["offset"] = {}
            # for t in config["targets"]:
            #     config["offset"]["{}_offset".format(t)] = d0[t][0]
            try:
                fig, ax = plot_repeated_outputs(results, n_repeats=25, limit=lim,
                                                distance=d, **config)
                fig.set_size_inches(18.5, 12.5)
                fig.savefig(
                    os.path.join(figPath, 'PLOS_{}_{}_{}_TS.png'
                                 .format(DATASET, str(lim).replace('.', '_'), d)),
                    dpi=100)
            except AttributeError:
                print("Failed to get TS on {}-{}-{}".format(MODEL_VERSION, DATASET, lim))
            plt.close('all')

# TODO: Fix issue with plot formatting, cutting off axes etc
# TODO: Fix issue with time series cutting short.
예제 #3
0
        # # scatter_dist_plot(results, params, tolerance=tol, n_ticks=4)
        sorted_results = results.sort_values(by=d).head(2000)
        # print("Generating KDE plot")
        # g = kde_plot(sorted_results, params, tolerance=tol, n_ticks=4, d=d,
        #              median_file=os.path.join(figPath, "medians.txt"), openopt_medians=openopt_medians)
        # g.fig.savefig(
        #     os.path.join(figPath, 'PLOS_filtered_{}_{}_kde.png'
        #                  .format(str(tol).replace('.', '_'), d)),
        #     bbox_inches='tight')
        print("Generating averaged time series plot")
        config["offset"] = {}
        for t in config["targets"]:
            config["offset"]["{}_offset".format(t)] = d0[t][0]
        fig, ax = plot_repeated_outputs(results,
                                        n_repeats=25,
                                        limit=lim,
                                        distance=d,
                                        openopt_path=openopt_run,
                                        **config)

        for i, label in enumerate([
                "{} (%)", "$\Delta${} ($\mu M$)", "$\Delta${} ($\mu M$)",
                "$\Delta${} ($\mu M$)"
        ]):
            ax[i].set_ylabel(label.format(ax[i].get_ylabel()))

        fig.set_size_inches(18.5, 12.5)
        # fig.savefig(
        #     os.path.join(figPath, 'PLOS_filtered_{}_{}_TS.png'
        #                  .format(str(lim).replace('.', '_'), d)))

        TIFF_exporter(fig,