def _save_montecarlo_log(self, iterations, dataset_name, num_classes, polar_mode, dataset_size, features_size, epochs, batch_size):
    max_epoch = self.pandas_full_data['epoch'].max()
    epoch_filter = (self.pandas_full_data['epoch'] == max_epoch)
    complex_filter = (self.pandas_full_data['network'] == self.models[0].name)
    real_filter = (self.pandas_full_data['network'] == self.models[1].name)
    complex_last_epochs = self.pandas_full_data[(epoch_filter & complex_filter)]
    real_last_epochs = self.pandas_full_data[(epoch_filter & real_filter)]
    complex_median_train = complex_last_epochs['accuracy'].median()
    real_median_train = real_last_epochs['accuracy'].median()
    complex_median = complex_last_epochs['val_accuracy'].median()
    real_median = real_last_epochs['val_accuracy'].median()
    complex_err = median_error(complex_last_epochs['accuracy'].quantile(0.75), complex_last_epochs['accuracy'].quantile(0.25), iterations)
    real_err = median_error(real_last_epochs['val_accuracy'].quantile(0.75), real_last_epochs['val_accuracy'].quantile(0.25), iterations)
    fieldnames = ['iterations', 'dataset', '# Classes', 'Dataset Size', 'Feature Size', 'Polar Mode', 'Optimizer', 'Loss', 'epochs', 'batch size', 'Winner', 'CVNN val median', 'RVNN val median', 'CVNN err', 'RVNN err', 'CVNN train median', 'RVNN train median', 'path', 'cvnn version']
    row_data = [iterations, dataset_name, num_classes, dataset_size, features_size, polar_mode, str(tf.keras.losses.serialize(self.models[0].loss)), str(tf.keras.optimizers.serialize(self.models[0].optimizer)), epochs, batch_size, ('CVNN' if (complex_median > real_median) else 'RVNN'), complex_median, real_median, complex_err, real_err, complex_median_train, real_median_train, str(self.monte_carlo_analyzer.path), cvnn.__version__]
    percentage_cols = ['P', 'Q', 'L', 'M']
    _create_excel_file(fieldnames, row_data, './log/rvnn_vs_cvnn_monte_carlo_summary.xlsx', percentage_cols=percentage_cols)
def _save_montecarlo_log(self, iterations, dataset_name, num_classes, polar_mode, dataset_size, features_size, epochs, batch_size):
    max_epoch = self.pandas_full_data['epoch'].max()
    epoch_filter = (self.pandas_full_data['epoch'] == max_epoch)
    complex_filter = (self.pandas_full_data['network'] == self.models[0].name)
    real_filter = (self.pandas_full_data['network'] == self.models[1].name)
    complex_last_epochs = self.pandas_full_data[(epoch_filter & complex_filter)]
    real_last_epochs = self.pandas_full_data[(epoch_filter & real_filter)]
    complex_median_train = complex_last_epochs['accuracy'].median()
    real_median_train = real_last_epochs['accuracy'].median()
    complex_median = complex_last_epochs['val_accuracy'].median()
    real_median = real_last_epochs['val_accuracy'].median()
    complex_err = median_error(complex_last_epochs['accuracy'].quantile(0.75), complex_last_epochs['accuracy'].quantile(0.25), iterations)
    real_err = median_error(real_last_epochs['val_accuracy'].quantile(0.75), real_last_epochs['val_accuracy'].quantile(0.25), iterations)
    fieldnames = ['iterations', 'dataset', '# Classes', 'Dataset Size', 'Feature Size', 'Polar Mode', 'Optimizer', 'Loss', 'epochs', 'batch size', 'Winner', 'CVNN val median', 'RVNN val median', 'CVNN err', 'RVNN err', 'CVNN train median', 'RVNN train median', 'path', 'cvnn version']
    row_data = [iterations, dataset_name, num_classes, dataset_size, features_size, polar_mode, str(tf.keras.losses.serialize(self.models[0].loss)), str(tf.keras.optimizers.serialize(self.models[0].optimizer)), epochs, batch_size, ('CVNN' if (complex_median > real_median) else 'RVNN'), complex_median, real_median, complex_err, real_err, complex_median_train, real_median_train, str(self.monte_carlo_analyzer.path), cvnn.__version__]
    percentage_cols = ['P', 'Q', 'L', 'M']
    _create_excel_file(fieldnames, row_data, './log/rvnn_vs_cvnn_monte_carlo_summary.xlsx', percentage_cols=percentage_cols)