Clustering
run_clust()
takes the full data
and gives a struct with the clustered data as the output.
The input parameter n_clust
determines the number of clusters,i.e., representative periods.
Supported clustering methods
The following combinations of clustering method and representations are supported by run_clust
:
Name | method | representation |
---|---|---|
k-means clustering | <kmeans> | <centroid> |
k-means clustering with medoid representation | <kmeans> | <medoid> |
k-medoids clustering (partitional) | <kmedoids> | <medoid> |
k-medoids clustering (exact) [requires Gurobi] | <kmedoids_exact> | <medoid> |
hierarchical clustering with centroid representation | <hierarchical> | <centroid> |
hierarchical clustering with medoid representation | <hierarchical> | <medoid> |
For use of DTW barycenter averaging (DBA) and k-shape clustering on single-attribute data (e.g. electricity prices), please use branch v0.1-appl_energy-framework-comp
.
ClustForOpt.run_clust
— Function.run_clust(data::ClustData;norm_op::String="zscore",norm_scope::String="full",method::String="kmeans",representation::String="centroid",n_clust::Int=5,n_init::Int=100,iterations::Int=300,save::String="",attribute_weights::Dict{String,Float64}=Dict{String,Float64}(),get_all_clust_results::Bool=false,kwargs...)
normop: "zscore", "01"(not implemented yet) normscope: "full","sequence","hourly" method: "kmeans","kmedoids","kmedoids_exact","hierarchical" representation: "centroid","medoid"
run_clust(data::ClustData,n_clust_ar::Array{Int,1};norm_op::String="zscore",norm_scope::String="full",method::String="kmeans",representation::String="centroid",n_init::Int=100,iterations::Int=300,save::String="",kwargs...)
This function is a wrapper function around runclust(). It runs multiple number of clusters k and returns an array of results. normop: "zscore", "01"(not implemented yet) normscope: "full","sequence","hourly" method: "kmeans","kmedoids","kmedoidsexact","hierarchical" representation: "centroid","medoid"
Example running clustering
using ClustForOpt
state="GER_1"
# laod ts-input-data
ts_input_data, = load_timeseries_data("CEP", state; K=365, T=24)
ts_clust_data = run_clust(ts_input_data).best_results
using Plots
plot(ts_clust_data.data["solar-germany"], legend=false, linestyle=:solid, width=3, xlabel="Time [h]", ylabel="Solar availability factor [%]")
savefig("clust.svg")
/home/travis/.julia/packages/GR/IVBgs/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?
GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS