Exemplo n.º 1
0
 def do_corr(self):
     imageIO_vardist_all = vardistplot(self.df_sigtrain, self.df_bkgtrain,
                                       self.v_all, self.dirmlplot,
                                       self.p_binmin, self.p_binmax)
     imageIO_vardist_train = vardistplot(self.df_sigtrain, self.df_bkgtrain,
                                         self.v_train, self.dirmlplot,
                                         self.p_binmin, self.p_binmax)
     imageIO_scatterplot = scatterplot(self.df_sigtrain, self.df_bkgtrain,
                                       self.v_corrx, self.v_corry,
                                       self.dirmlplot, self.p_binmin,
                                       self.p_binmax)
     imageIO_corr_sig_all = correlationmatrix(self.df_sigtrain, self.v_all,
                                              "Signal", self.dirmlplot,
                                              self.p_binmin, self.p_binmax)
     imageIO_corr_bkg_all = correlationmatrix(self.df_bkgtrain, self.v_all,
                                              "Background", self.dirmlplot,
                                              self.p_binmin, self.p_binmax)
     imageIO_corr_sig_train = correlationmatrix(self.df_sigtrain,
                                                self.v_train, "Signal",
                                                self.dirmlplot,
                                                self.p_binmin,
                                                self.p_binmax)
     imageIO_corr_bkg_train = correlationmatrix(self.df_bkgtrain,
                                                self.v_train, "Background",
                                                self.dirmlplot,
                                                self.p_binmin,
                                                self.p_binmax)
     return imageIO_vardist_all, imageIO_vardist_train, imageIO_scatterplot, \
               imageIO_corr_sig_all, imageIO_corr_bkg_all, imageIO_corr_sig_train, \
               imageIO_corr_bkg_train
Exemplo n.º 2
0
def do_correlation(df_sig_train, df_bkg_train, var_all, var_corr_x, var_corr_y,
                   plotdir):
    imageIO_vardist = vardistplot(df_sig_train, df_bkg_train, var_all, plotdir)
    imageIO_scatterplot = scatterplot(df_sig_train, df_bkg_train, var_corr_x,
                                      var_corr_y, plotdir)
    imageIO_corr_sig = correlationmatrix(df_sig_train, plotdir, "signal")
    imageIO_corr_bkg = correlationmatrix(df_bkg_train, plotdir, "background")
    return imageIO_vardist, imageIO_scatterplot, imageIO_corr_sig, imageIO_corr_bkg
Exemplo n.º 3
0
 def do_corr(self):
     imageIO_vardist = vardistplot(self.df_sigtrain, self.df_bkgtrain,
                                   self.v_all, self.dirmlplot,
                                   self.p_binmin, self.p_binmax)
     imageIO_scatterplot = scatterplot(self.df_sigtrain, self.df_bkgtrain,
                                       self.v_corrx, self.v_corry,
                                       self.dirmlplot, self.p_binmin, self.p_binmax)
     imageIO_corr_sig = correlationmatrix(self.df_sigtrain, self.dirmlplot,
                                          "signal", self.p_binmin, self.p_binmax)
     imageIO_corr_bkg = correlationmatrix(self.df_bkgtrain, self.dirmlplot,
                                          "background", self.p_binmin, self.p_binmax)
     return imageIO_vardist, imageIO_scatterplot, imageIO_corr_sig, imageIO_corr_bkg
Exemplo n.º 4
0
    def do_corr(self):
        if self.step_done("distributions_correlations"):
            return

        self.logger.info("Make feature distributions and correlation plots")

        def make_plot_name(output, label, n_var, binmin, binmax):
            return f'{output}/CorrMatrix_{label}_nVar{n_var}_{binmin:.1f}_{binmax:.1f}.png'

        vardistplot(self.df_sigtrain, self.df_bkgtrain, self.v_all,
                    self.dirmlplot, self.p_binmin, self.p_binmax,
                    self.p_plot_options)

        if self.v_selected:
            vardistplot(self.df_sigtrain, self.df_bkgtrain, self.v_selected,
                        self.dirmlplot, self.p_binmin, self.p_binmax,
                        self.p_plot_options)

        vardistplot(self.df_sigtrain, self.df_bkgtrain, self.v_train,
                    self.dirmlplot, self.p_binmin, self.p_binmax,
                    self.p_plot_options)

        scatterplot(self.df_sigtrain, self.df_bkgtrain, self.v_corrx,
                    self.v_corry, self.dirmlplot, self.p_binmin, self.p_binmax)

        output = make_plot_name(self.dirmlplot, "Signal_all_vars",
                                len(self.v_all), self.p_binmin, self.p_binmax)
        correlationmatrix(self.df_sigtrain, self.v_all, "Signal", output,
                          self.p_binmin, self.p_binmax, self.p_plot_options)

        output = make_plot_name(self.dirmlplot, "Background_all_vars",
                                len(self.v_all), self.p_binmin, self.p_binmax)
        correlationmatrix(self.df_bkgtrain, self.v_all, "Background", output,
                          self.p_binmin, self.p_binmax, self.p_plot_options)

        if self.v_selected:
            output = make_plot_name(self.dirmlplot, "Signal_selected_vars",
                                    len(self.v_selected), self.p_binmin,
                                    self.p_binmax)
            correlationmatrix(self.df_sigtrain, self.v_selected, "Signal",
                              output, self.p_binmin, self.p_binmax,
                              self.p_plot_options)

            output = make_plot_name(self.dirmlplot, "Background_selected_vars",
                                    len(self.v_selected), self.p_binmin,
                                    self.p_binmax)
            correlationmatrix(self.df_bkgtrain, self.v_selected, "Background",
                              output, self.p_binmin, self.p_binmax,
                              self.p_plot_options)

        output = make_plot_name(self.dirmlplot, "Signal_features",
                                len(self.v_train), self.p_binmin,
                                self.p_binmax)
        correlationmatrix(self.df_sigtrain, self.v_train, "Signal", output,
                          self.p_binmin, self.p_binmax, self.p_plot_options)

        output = make_plot_name(self.dirmlplot, "Background_features",
                                len(self.v_train), self.p_binmin,
                                self.p_binmax)
        correlationmatrix(self.df_bkgtrain, self.v_train, "Background", output,
                          self.p_binmin, self.p_binmax, self.p_plot_options)