def explore_scatter(self, X):
     feature_cols = [
         'age', 'job', 'marital', 'education', 'default', 'loan', 'housing',
         'contact', 'poutcome'
     ]
     age = X['age']
     job = X['job']
     marital = X['marital']
     education = X['education']
     housing = X['housing']
     contact = X['contact']
     loan = X['loan']
     plot_scatter(age, job, 'Age', 'Job', 'Age vs Job')
     plot_scatter(marital, education, 'marital', 'education',
                  'marital vs education')
     plot_scatter(housing, contact, 'housing', 'contact',
                  'housing vs contact')
     plot_scatter(loan, education, 'loan', 'education', 'loan vs education')
     plot_scatter(job, marital, 'job', 'marital', 'job vs marital')
 def explore_scatter(self):
     feature_cols = [
         "fixed acidity", "residual sugar", "chlorides",
         "total sulfur dioxide", "density", "alcohol"
     ]
     fa = self.data['fixed acidity']
     rs = self.data['residual sugar']
     c = self.data['chlorides']
     tso = self.data['total sulfur dioxide']
     d = self.data['density']
     a = self.data['alcohol']
     plot_scatter(fa, rs, 'Fixed Acidity', 'Residual Sugar',
                  'Fixed Acidity vs Residual Sugar')
     plot_scatter(c, tso, 'Chlorides', 'Total Sulfur Dioxide',
                  'Chlorides vs total sulfur dioxide')
     plot_scatter(d, a, 'Density', 'Alcohol', 'Density vs Alcohol')
     plot_scatter(fa, a, 'Fixed Acidity', 'Alcohol',
                  'Fixed Acidity vs Alcohol')
     plot_scatter(rs, a, 'Residual Sugar', 'Alcohol',
                  'Residual Sugar vs Alcohol')
Пример #3
0
def main():
    options = parser.parse_args()

    inputFile = options.inputFile

    df = pd.read_csv(inputFile, sep="|", index_col=COLUMNS[0])

    #check_limits(df)

    duplicateRowsDF = df[df.duplicated()]
    if len(duplicateRowsDF.index) > 0:
        print("Warning, there are some duplicates")

    points = np.column_stack([df[COLUMNS[2]].values, df[COLUMNS[3]].values])
    pareto_front = df.iloc[is_pareto_efficient(points, return_mask=False)]

    out_name = options.outputFile.split('.')[0]

    if options.render:
        plotter.plot_scatter(df[COLUMNS[3]].values,
                             df[COLUMNS[2]].values,
                             pareto_front=(pareto_front[COLUMNS[3]].values,
                                           pareto_front[COLUMNS[2]].values),
                             label=str(options.mrai_type) +
                             " MRAI experiments",
                             xlabel="Messages transmitted",
                             ylabel="Convergence time [s]",
                             title="Experiments efficency",
                             output_file_name=out_name + ".pdf")

        allowed_types = ["constant", "dpc", "dpc2", "reverse_dpcc"]
        if options.mrai_type in allowed_types:
            plotter.plot_messages_time_comparison(
                df[COLUMNS[1]].values,
                df[COLUMNS[2]].values,
                df[COLUMNS[3]].values,
                title="MRAI " + options.mrai_type + " performances",
                output_file_name=out_name + "_mrai_evolution.pdf",
                time_max=options.time_max,
                time_min=options.time_min,
                messages_max=options.messages_max,
                messages_min=options.messages_min,
                fs=options.font_size)

            plotter.plot_suppression(df[COLUMNS[1]].values,
                                     df[COLUMNS[4]].values,
                                     title="Suppression detected",
                                     output_file_name=out_name +
                                     "_suppression_evolution.pdf",
                                     sup_max=options.rfd_max,
                                     sup_min=options.rfd_min,
                                     fs=options.font_size)

            plotter.plot_messages_suppression_time_comparison(
                df[COLUMNS[1]].values,
                df[COLUMNS[2]].values,
                df[COLUMNS[3]].values,
                df[COLUMNS[4]].values,
                title="MRAI + RFD " + options.mrai_type + " performances",
                output_file_name=out_name + "_mrai_rfd_evolution.pdf",
                time_max=options.time_max,
                time_min=options.time_min,
                messages_max=options.messages_max,
                messages_min=options.messages_min,
                rfd_max=options.rfd_max,
                rfd_min=options.rfd_min,
                fs=options.font_size)

            plotter.plot_messages_time_comparison_error_bars(
                df[COLUMNS[1]].values,
                df[COLUMNS[2]].values,
                df[COLUMNS[3]].values,
                df[COLUMNS[6]].values,
                df[COLUMNS[9]].values,
                title="MRAI " + options.mrai_type + " performances " +
                "with Std deviation",
                output_file_name=out_name + "_mrai_evolution_std.pdf",
                time_max=options.time_max,
                time_min=options.time_min,
                messages_max=options.messages_max,
                messages_min=options.messages_min,
                fs=options.font_size)

            plotter.plot_messages_time_comparison_error_bars_alpha(
                df[COLUMNS[1]].values,
                df[COLUMNS[2]].values,
                df[COLUMNS[3]].values,
                df[COLUMNS[6]].values,
                df[COLUMNS[9]].values,
                title="MRAI " + options.mrai_type + " performances " +
                "with Std deviation",
                output_file_name=out_name + "_mrai_evolution_std_alpha.pdf",
                time_max=options.time_max,
                time_min=options.time_min,
                messages_max=options.messages_max,
                messages_min=options.messages_min,
                fs=options.font_size)
Пример #4
0
    sys.path.append('plotter/plotting_params')
    params_module = importlib.import_module(args.params_file)

    data_params = params_module.data_params

    if hasattr(params_module, 'list_of_experiments'):
        final_list_of_experiments = params_module.list_of_experiments
    else:
        final_list_of_experiments = list_of_experiments

    print('final_list_experiments', final_list_of_experiments)
    print('data params', data_params)
    print('process params', params_module.processing_params)
    print('plot params', params_module.plot_params)

    if args.erase_bad_validations:
        validations = [
            'Town01W1Noise', 'Town02W14Noise', 'Town01W1', 'Town02W14'
        ]
        erase_wrong_plotting_summaries(args.folder, validations)

    #if check_csv_ground_truths
    # Check if the validation folders already have the

    plot_scatter(args.folder,
                 final_list_of_experiments,
                 data_params,
                 params_module.processing_params,
                 params_module.plot_params,
                 out_folder=args.params_file)