Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cluster Analysis

License

NotificationsYou must be signed in to change notification settings

okgreece/Cluster.OBeu

Repository files navigation

Kleanthis Koupidis, Charalampos Bratsas, Jaroslav KucharNovember 9, 2016

R-CMD-checkCRAN_Status_BadgeProject Status: Active – The project has reached a stable, usable state and is being actively developed.LicenceDOI

#Cluster.OBeuΕstimate and return the necessary parameters for cluster analysisvisualizations, used inOpenBudgets.eu. Itinvolves a set of techniques and algorithms used to find and divide intogroups the Budget data of municipalities across Europe, described by theOpenBudgets.eu data model.

The available clustering algorithms are hierarchical, kmeans from Rbase, pam, clara, fuzzy fromclusterpackage and model basedalgorithms frommclustpackage. It can be used tofind the appropriate clustering algorithm and/or the appropriateclustering number of the input data according to the internal andstability measures fromclValidpackage.

This package can generally be used to estimate clustering parameters,extract and convert them to JSON format and use them as input in adifferent graphical interface and also can be used in data that are notdescribed by theOpenBudgets.eu datamodel.

You can see detailed informationhere.

# install Cluster.OBeu- cran stable versioninstall.packages(Cluster.OBeu)# or# alternatively install the development version from githubdevtools::install_github("okgreece/Cluster.OBeu")

Load libraryCluster.OBeu

library(Cluster.OBeu)

#Cluster Analysis in a call

cl.analysis can be used to estimate clustering model parameters and/ornumber of clusters needed for visualization of clusters and otherclustering measures as list object.

cluster_data= cl.analysis(city_data,cl.aggregate="sum",cl.meth="pam",clust.numb=NULL,dist="euclidean",tojson=T)# json string formatjsonlite::prettify(cluster_data)# use prettify of jsonlite library to add indentation to the returned JSON string

#Cluster Analysis on OpenBudgets.eu platform

open_spending.cl is designed to estimate and return the clusteringmodel measures ofOpenBudgets.eu datasets.

The input data must be a JSON link according to theOpenBudgets.eu datamodel. There are differentparameters that a user could specify, e.g. dimensions,measured.dimensions andamounts should be defined by the user, toform the dimensions of the dataset.open_spending.cl estimates andreturns the json data that are described with theOpenBudgets.eu datamodel, usingcl.analysisfunction.

#Store the link in a variablejson_link='http://ws307.math.auth.gr/rudolf/public/api/3/cubes/budget-athens-revenue-2007__93458/aggregate?drilldown=budgetPhase.prefLabel%7CadministrativeClassification.prefLabel&aggregates=amount.sum'clustering= open_spending.cl(json_data=json_link,dimensions="administrativeClassification.prefLabel",measured.dimensions="budgetPhase.prefLabel",amounts="amount.sum",cl.method="fanny",cl.num=3  )# Pretty output using prettify of jsonlite libraryjsonlite::prettify(clustering,indent=2)

[8]ページ先頭

©2009-2025 Movatter.jp