@@ -0,0 +1,1647 @@
+import os%0Aimport time%0A%0Aimport pandas as pd%0Aimport numpy as np%0A%0Aimport tsam.timeseriesaggregation as tsam%0A%0A%0A%0Adef test_accuracyIndicators():%0A%0A    hoursPerPeriod = 24%0A%0A    noTypicalPeriods = 8%0A%0A    raw = pd.read_csv(os.path.join(os.path.dirname(__file__),'..','examples','testdata.csv'), index_col = 0)%0A%0A    starttime = time.time()%0A%0A    aggregation1 = tsam.TimeSeriesAggregation(raw, noTypicalPeriods=noTypicalPeriods, hoursPerPeriod=hoursPerPeriod,%0A                                              clusterMethod='hierarchical')%0A%0A    print('Clustering took ' + str(time.time() - starttime))%0A%0A    starttime = time.time()%0A%0A    aggregation2 = tsam.TimeSeriesAggregation(raw, noTypicalPeriods=noTypicalPeriods, hoursPerPeriod=hoursPerPeriod,%0A                                              clusterMethod='hierarchical', sortValues=True)%0A%0A    print('Clustering took ' + str(time.time() - starttime))%0A%0A    # make sure, that the sum of the attribute specific RMSEs is smaller for the normal time series clustering than for%0A    # the duration curve clustering%0A    np.testing.assert_array_less(aggregation1.accuracyIndicators().loc%5B:, 'RMSE'%5D.sum(),%0A                                 aggregation2.accuracyIndicators().loc%5B:, 'RMSE'%5D.sum())%0A%0A    # make sure, that the sum of the attribute specific duration curve RMSEs is smaller for the duration curve%0A    # clustering than for the normal time series clustering%0A    np.testing.assert_array_less(aggregation2.accuracyIndicators().loc%5B:, 'RMSE_duration'%5D.sum(),%0A                                 aggregation1.accuracyIndicators().loc%5B:, 'RMSE_duration'%5D.sum())%0A%0Aif __name__ == %22__main__%22:%0A    test_accuracyIndicators()

Test for accuracy indicators implemented