@@ -1047,20 +1047,21 @@ def fit(self,
10471047 logging .info (f'RMSE/MAE before fitting: { stats_before .rmse :.2f} /{ stats_before .mae :.2f} kcal/mol' )
10481048 logging .info (f'RMSE/MAE after fitting: { stats_after .rmse :.2f} /{ stats_after .mae :.2f} kcal/mol' )
10491049
1050- rmse_before = [test_data .calculate_stats ().rmse for test_data in test_data_results ]
1051- mae_before = [test_data .calculate_stats ().mae for test_data in test_data_results ]
1052- rmse_after = [test_data .calculate_stats (for_bac_data = True ).rmse for test_data in test_data_results ]
1053- mae_after = [test_data .calculate_stats (for_bac_data = True ).mae for test_data in test_data_results ]
1050+ num_test_data = sum (len (test_data ) for test_data in test_data_results )
1051+ rmse_before = np .sqrt (np .sum ([test_data .calculate_stats ().rmse ** 2 * len (test_data ) for test_data in test_data_results ]) / num_test_data )
1052+ mae_before = np .sum ([test_data .calculate_stats ().mae * len (test_data ) for test_data in test_data_results ]) / num_test_data
1053+ rmse_after = np .sqrt (np .sum ([test_data .calculate_stats (for_bac_data = True ).rmse ** 2 * len (test_data ) for test_data in test_data_results ]) / num_test_data )
1054+ mae_after = np .sum ([test_data .calculate_stats (for_bac_data = True ).mae * len (test_data ) for test_data in test_data_results ]) / num_test_data
10541055
10551056 logging .info ('\n Cross-validation results:' )
1056- logging .info (f'Testing RMSE before fitting (mean +- 1 std) : '
1057- f'{ np . average ( rmse_before ):.2f } +- { np . std ( rmse_before ) :.2f} kcal/mol' )
1058- logging .info (f'Testing MAE before fitting (mean +- 1 std) : '
1059- f'{ np . average ( mae_before ):.2f } +- { np . std ( mae_before ) :.2f} kcal/mol' )
1060- logging .info (f'Testing RMSE after fitting (mean +- 1 std) : '
1061- f'{ np . average ( rmse_after ):.2f } +- { np . std ( rmse_after ) :.2f} kcal/mol' )
1062- logging .info (f'Testing MAE after fitting (mean +- 1 std) : '
1063- f'{ np . average ( mae_after ):.2f } +- { np . std ( mae_after ) :.2f} kcal/mol' )
1057+ logging .info (f'Testing RMSE before fitting: '
1058+ f'{ rmse_before :.2f} kcal/mol' )
1059+ logging .info (f'Testing MAE before fitting: '
1060+ f'{ mae_before :.2f} kcal/mol' )
1061+ logging .info (f'Testing RMSE after fitting: '
1062+ f'{ rmse_after :.2f} kcal/mol' )
1063+ logging .info (f'Testing MAE after fitting: '
1064+ f'{ mae_after :.2f} kcal/mol' )
10641065
10651066
10661067def get_confidence_intervals (x : np .ndarray ,
0 commit comments