for paradigm, scores in split_paradigm_score( df, args.folder, path, category): statistics = fault_statistics(scores, statistics, category, name + paradigm) else: statistics = fault_statistics(df, statistics, category, name) if not statistics.empty: save_dataframe(statistics, folder, category, False) def fault_statistics(df, statistics, category, name): print(f'[{category}] Fault-statistics: {name}') total_rows = len(df) faulty_rows = len(df[df['faults'] > 0]) non_faulty_rows = len(df[df['faults'] == 0]) percentage_faulty = (faulty_rows / total_rows) * 100 result = { 'name': name, 'rows': total_rows, 'faulty_rows': faulty_rows, 'non_faulty_rows': non_faulty_rows, 'percentage_faulty': percentage_faulty } return statistics.append(result, ignore_index=True) if __name__ == '__main__': main(parse_args())
from analysis import descriptive, fault_statistics, univariate, multivariate, parse_args, multivariate_baseline, \ multivariate_baseline_hasdata, multivariate_baseline_control, fault_metric_statistics if __name__ == '__main__': args = parse_args() descriptive.main(args) fault_statistics.main(args) fault_metric_statistics.main(args) univariate.main(args) multivariate.main(args) if args.multivariate_baseline: multivariate_baseline.main(args) multivariate_baseline_hasdata.main(args) if args.multivariate_baseline_control: multivariate_baseline_control.main(args)