Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
iddie1994 authored Feb 16, 2022
1 parent b7fbd89 commit edf8bc7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions finish-timeseriesclustering_gas_vensim_NO_policy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import matplotlib.pyplot as plt
import seaborn as sns

from ema_workbench import load_results
from ema_workbench.analysis import clusterer, plotting, Density

# load data
fn = r'./data/500 gas cases no policy.tar.gz'
experiments, outcomes = load_results(fn)
data = outcomes['Cumulative profit']

# calcuate distances
distances = clusterer.calculate_cid(data)

# plot dedrog
# clusterer.plot_dendrogram(distances)

# do agglomerative clustering on the distances
clusters = clusterer.apply_agglomerative_clustering(distances,
n_clusters=5)

# show the clusters in the output space
x = experiments.copy()
x['clusters'] = clusters.astype('object')
plotting.lines(x, outcomes, group_by='clusters',
density=Density.VIOLIN)

# show the input space
# sns.pairplot(x, hue='clusters',
# vars=['Initial well productivity per year','Carbon price multiplier',
# 'Initial costs for well development','Operating costs per m3 NG', 'Societal urge to become carbon neutral',
# 'Subsidy provision factor', 'Factor onshore to offshore BoP costs',
# 'Competition constant offshore hydrogen production', 'Platform modification costs', 'Transitioning factor',
# 'Price volatility'],
# plot_kws=dict(s=13))
plt.show()

0 comments on commit edf8bc7

Please sign in to comment.