**Cluster.OBeu v1.2.1 release on CRAN**

We are very pleased to announce Cluster.OBeu v1.2.1 on CRAN!

`Cluster.OBeu`

is used on OpenBudgets.eu data mininig tool platform with OpenCPU integration of R and JavaScript to estimate and return the necessary parameters for cluster analysis visualizations for budget or expenditure datasets of Municipality across Europe.

The vignette shows the way `Cluster.OBeu`

(in R and OpenCPU environment) is fitted with datasets of OpenBudgets.eu according to the OpenBudgets.eu data model. Detailed documentation about OpenBudgets.eu data model can be found here

The input and the resulted object are in json format.

First install Cluster.OBeu

`install.packages('Cluster.OBeu')`

and start using the library

`# load Cluster.OBeulibrary(Cluster.OBeu)`

`open_spending.cl`

is designed to estimate and return the clustering model measures of OpenBudgets.eu datasets.

The available clustering algorithms are hierarchical, kmeans from R base, pam, clara, fuzzy from cluster package and model based algorithms from mclust package. It can be used to find the appropriate clustering algorithm and/or the appropriate clustering number of the input data according to the internal and stability measures from clValid package.

The input data must be a JSON link according to the OpenBudgets.eu data model. There are different parameters that a user could specify, e.g. `dimensions`

, `measured.dimensions`

and `amounts`

should be defined by the user, to form the dimensions of the dataset. `open_spending.cl`

estimates and returns the json data that are described with the OpenBudgets.eu data model, using `cl.analysis`

function.

Input | Description |
---|---|

json_data |
The json string, URL or file from Open Spending API |

dimensions |
The dimensions of the input data |

amounts |
The amounts of the input data |

measured.dimensions |
The dimensions to which correspond amount/numeric variables |

cl.aggregate |
Aggregate function of the input data |

cl.method |
clustering algorithm |

cl.num |
Number of clusters |

cl.dist |
Distance metric |

The following table shows a sort description of the `open_spending.cl`

return components:

Component | Description |
---|---|

cluster.method | Label of the clustering algorithm |

raw.data | Input data |

data.pca | Principal components |

modelparam | Clustering model specifications |

compare | Clustering measures |

The dataset in the following example is being used in OpenBudgets.eu platform and concerns the income of Aragon. in 2007.

`open_spending.cl`

function’s input are data as json link and described with OpenBudgets.eu data model.

`aragon_income = "https://apps.openbudgets.eu//api/3/cubes/aragon-2007-income__3209b/aggregate?drilldown=fundingClassification.prefLabel%7CeconomicClassification.prefLabel&aggregates=amount.sum"`

`results = open_spending.cl(`

json_data = aragon_income,

dimensions ="economicClassification.prefLabel",

amounts = "amount.sum",

measured.dimensions = "fundingClassification.prefLabel",

cl.method="kmeans"

)

# Pretty output using prettify of jsonlite library

jsonlite::prettify(results)

Go to: yourserver/ocpu/test

Copy and paste the following function to the endpoint

`../library/Cluster.OBeu/R/open_spending.cl# library/ {name of the library} /R/ {function}`

**Select Method**:`Post`

Click **add parameters** every time you want to add a new parameters and values.

Define the input data:

**Param Name**:`json_data`

**Param Value**(*URL*of json data):(or any other json URL with the data)`"https://apps.openbudgets.eu//api/3/cubes/aragon-2007-income__3209b/aggregate?drilldown=fundingClassification.prefLabel%7CeconomicClassification.prefLabel&aggregates=amount.sum"`

Define the

*dimensions*parameter:**Param Name**:`dimensions`

**Param Value**:`"economicClassification.prefLabel"`

Define the

*amount*parameter:**Param Name**:`amounts`

**Param Value**:`"amount.sum"`

Define the

*measured dimension*parameter:**Param Name**:`measured.dimensions`

**Param Value**:`"fundingClassification.prefLabel"`

You add likewise further parameters and change the default parameters of `cl.method`

, `cl.num`

, `cl.dist`

, see Cluster.OBeu *reference manual* for further details.

- Ready! Click on
**Ajax request**!

copy the

**/ocpu/tmp/{this_id_number}/R/.val**(second on the right panel)finally, paste

on a new tab.`yourserver/ocpu/tmp/{this_id_number}/R/.val`

© 2019 Data Science Central ® Powered by

Badges | Report an Issue | Privacy Policy | Terms of Service

**Most Popular Content on DSC**

To not miss this type of content in the future, subscribe to our newsletter.

- Book: Statistics -- New Foundations, Toolbox, and Machine Learning Recipes
- Book: Classification and Regression In a Weekend - With Python
- Book: Applied Stochastic Processes
- Long-range Correlations in Time Series: Modeling, Testing, Case Study
- How to Automatically Determine the Number of Clusters in your Data
- New Machine Learning Cheat Sheet | Old one
- Confidence Intervals Without Pain - With Resampling
- Advanced Machine Learning with Basic Excel
- New Perspectives on Statistical Distributions and Deep Learning
- Fascinating New Results in the Theory of Randomness
- Fast Combinatorial Feature Selection

**Other popular resources**

- Comprehensive Repository of Data Science and ML Resources
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- 100 Data Science Interview Questions and Answers
- Cheat Sheets | Curated Articles | Search | Jobs | Courses
- Post a Blog | Forum Questions | Books | Salaries | News

**Archives:** 2008-2014 |
2015-2016 |
2017-2019 |
Book 1 |
Book 2 |
More

**Most popular articles**

- Free Book and Resources for DSC Members
- New Perspectives on Statistical Distributions and Deep Learning
- Time series, Growth Modeling and Data Science Wizardy
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- Comprehensive Repository of Data Science and ML Resources
- Advanced Machine Learning with Basic Excel
- Difference between ML, Data Science, AI, Deep Learning, and Statistics
- Selected Business Analytics, Data Science and ML articles
- How to Automatically Determine the Number of Clusters in your Data
- Fascinating New Results in the Theory of Randomness
- Hire a Data Scientist | Search DSC | Find a Job
- Post a Blog | Forum Questions

## You need to be a member of Data Science Central to add comments!

Join Data Science Central