I am testing the clustering methods against each other for a reduced unit commitment model by producing single results for each method:
# cluster data
methods = ['k_means', 'hierarchical', 'k_medoids']
for m in methods:
aggregation = tsam.TimeSeriesAggregation(normalized, noTypicalPeriods=4,
hoursPerPeriod=24*7,
clusterMethod=m)
typPeriods = aggregation.createTypicalPeriods()
typPeriods.shape
typPeriods.to_csv('clustered_' + str(m) + '.csv')
predictedPeriods = aggregation.predictOriginalData()
predictedPeriods.shape
predictedPeriods.to_csv('clustered_predicted_' + str(m) + '.csv')
Traceback (most recent call last):
File "cluster.py", line 36, in <module>
typPeriods = aggregation.createTypicalPeriods()
File "/some/path/tsam/tsam/timeseriesaggregation.py", line 757, in createTypicalPeriods
clusterMethod=self.clusterMethod)
File "/some/path/tsam/tsam/timeseriesaggregation.py", line 113, in aggregatePeriods
from tsa.utils.k_medoids_exact import KMedoids
ImportError: No module named 'tsa'
methods = ['k_means', 'hierarchical']