Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Feb 3, 2025
1 parent e7eefc4 commit bbbf949
Show file tree
Hide file tree
Showing 136 changed files with 284 additions and 4,780 deletions.
2 changes: 1 addition & 1 deletion .devel/roxygen2-patch.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyleft (C) 2021-2024, Marek Gagolewski <https://www.gagolewski.com>
# Copyleft (C) 2021-2025, Marek Gagolewski <https://www.gagolewski.com>
# Adding author and other metadata to every Rd file;
# There is one and only one official manual. Ad- and tracker-free.
# Enjoy the free internet.
Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* --------------------------------------------------------------------------
Copyleft (C) 2021-2024, Marek Gagolewski <https://www.gagolewski.com/>
Copyleft (C) 2021-2025, Marek Gagolewski <https://www.gagolewski.com/>
-------------------------------------------------------------------------- */

@import url("fonts/Alegreya-fontspec.css");
Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/alphamarek.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyleft (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com/>
# Copyleft (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com/>

# based on https://bitbucket.org/pybtex-devs/pybtex/src/HEAD/pybtex/style/formatting/unsrt.py

Expand Down
4 changes: 2 additions & 2 deletions .devel/sphinx/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ @book{datawranglingpy
publisher = {Zenodo},
address = {Melbourne},
url = {https://datawranglingpy.gagolewski.com/},
year = {2024}
year = {2025}
}

@book{deepr,
author = {M. Gagolewski},
title = {Deep {R} Programming},
url = {https://deepr.gagolewski.com/},
year = {2024},
year = {2025},
doi = {10.5281/zenodo.7490464},
isbn = {978-0-6455719-2-9},
publisher = {Zenodo},
Expand Down
4 changes: 2 additions & 2 deletions .devel/sphinx/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyleft (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com>
# Copyleft (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com>
# Configuration file for the Sphinx documentation builder.

import sys, os
Expand All @@ -12,7 +12,7 @@
pkg_name = "genieclust"
pkg_title = "genieclust"
pkg_version = genieclust.__version__
copyright_year = "2018–2024"
copyright_year = "2018–2025"
html_baseurl = "https://genieclust.gagolewski.com/"
html_logo = "https://www.gagolewski.com/_static/img/genieclust.png"
html_favicon = "https://www.gagolewski.com/_static/img/genieclust.png"
Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/fix-html.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com/>
# Copyright (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com/>

set -e

Expand Down
5 changes: 5 additions & 0 deletions .devel/sphinx/news.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.x.x (2025-xx-xx)

* ...


## 1.1.6 (2024-08-22)

* [PYTHON] The package now works with *numpy* 2.0.
Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/weave/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2024, Marek Gagolewski <https://www.gagolewski.com>
# Copyright (c) 2013-2025, Marek Gagolewski <https://www.gagolewski.com>

FILES_RMD = \
basics.Rmd \
Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/weave/Rmd2md-patch.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com/>
# Copyright (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com/>

# I only want ```{r...``` and ```{python...``` to be recognised as
# chunks to-be processed by knitr so that they can be placed within
Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/weave/Rmd2md.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com/>
# Copyright (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com/>

set -e

Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/weave/extract-code-comments.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com>
# Copyright (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com>

# Moves #> comments inside Markdown *highlighted* code blocks outside

Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/weave/options.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com>
# Copyright (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com>

options(encoding="UTF-8")
set.seed(666)
Expand Down
2 changes: 1 addition & 1 deletion .devel/sphinx/weave/pweave_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ########################################################################## #
# Marek's output hooks hacks #
# Copyleft (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com> #
# Copyleft (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com> #
# ########################################################################## #


Expand Down
Binary file modified .devel/sphinx/weave/r-figures/ssi-map-1.pdf
Binary file not shown.
Binary file modified .devel/sphinx/weave/r-figures/ssi-map-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .devel/sphinx/weave/r-figures/ssi-oecd-dendrogram-1.pdf
Binary file not shown.
Binary file modified .devel/sphinx/weave/r-figures/ssi-oecd-dendrogram-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions .devel/sphinx/weave/r.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ library("genieclust")




Let's consider the [Sustainable Society Indices](http://www.ssfindex.com/)
dataset that measures the Human, Environmental, and Economic Wellbeing
in each country. There are seven categories on the scale $[0, 10]$.
Expand Down Expand Up @@ -95,7 +94,7 @@ plot(as.dendrogram(h_oecd), horiz=TRUE)



Final notes:
Conclusion:

* If we are only interested in a specific partition,
calling `genie()` directly will be slightly faster than referring to
Expand Down
33 changes: 14 additions & 19 deletions .devel/sphinx/weave/r.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,26 @@ The latest stable release of the R package `genieclust` is available from the
We can install it by calling:



```r
``` r
install.packages("genieclust")
```


Below are a few basic examples of how to interact with the package.




```r
``` r
library("genieclust")
```




Let's consider the [Sustainable Society Indices](http://www.ssfindex.com/)
dataset that measures the Human, Environmental, and Economic Wellbeing
in each country. There are seven categories on the scale $[0, 10]$.



```r
``` r
# see https://github.com/gagolews/genieclust/tree/master/devel/sphinx/weave
ssi <- read.csv("ssi_2016_categories.csv", comment.char="#")
X <- as.matrix(ssi[,-1]) # everything except the Country (1st) column
Expand Down Expand Up @@ -63,8 +58,7 @@ with the input matrix directly:




```r
``` r
# faster than gclust(dist(X)):
h <- gclust(X) # default: gini_threshold=0.3, distance="euclidean"
print(h)
Expand All @@ -80,8 +74,7 @@ print(h)
In order to extract a desired *k*-partition, we can call `stats::cutree()`:



```r
``` r
y_pred <- cutree(h, k=3)
sample(y_pred, 25) # preview
## Iran Slovenia Morocco
Expand All @@ -108,8 +101,7 @@ This gives the cluster IDs allocated to each country.
Let's depict the obtained partition using the `rworldmap` package:



```r
``` r
library("rworldmap") # see the package's manual for details
mapdata <- data.frame(Country=dimnames(X)[[1]], Cluster=y_pred)
mapdata <- joinCountryData2Map(mapdata, joinCode="NAME", nameJoinColumn="Country")
Expand All @@ -127,8 +119,7 @@ Countries grouped w.r.t. the SSI categories.
We can compute, e.g., the average indicators in each identified group:



```r
``` r
t(aggregate(as.data.frame(X), list(Cluster=y_pred), mean))[-1, ]
## [,1] [,2] [,3]
## BasicNeeds 9.0679 5.2689 9.8178
Expand All @@ -146,15 +137,19 @@ For greater readability, we will restrict ourselves to a smaller sample;
namely, to the 37 members of the [OECD](https://en.wikipedia.org/wiki/OECD):



```r
``` r
oecd <- c("Australia", "Austria", "Belgium", "Canada", "Chile", "Colombia",
"Czech Republic", "Denmark", "Estonia", "Finland", "France", "Germany",
"Greece", "Hungary", "Iceland", "Ireland", "Israel", "Italy", "Japan",
"Korea, South", "Latvia", "Lithuania", "Luxembourg", "Mexico", "Netherlands",
"New Zealand", "Norway", "Poland", "Portugal", "Slovak Republic", "Slovenia",
"Spain", "Sweden", "Switzerland", "Turkey", "United Kingdom", "United States")
X_oecd <- X[dimnames(X)[[1]] %in% oecd, ]
```



``` r
h_oecd <- gclust(X_oecd)
plot(as.dendrogram(h_oecd), horiz=TRUE)
```
Expand All @@ -166,7 +161,7 @@ Cluster dendrogram for the OECD countries.



Final notes:
Conclusion:

* If we are only interested in a specific partition,
calling `genie()` directly will be slightly faster than referring to
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: genieclust
Type: Package
Title: Fast and Robust Hierarchical Clustering with Noise Points Detection
Version: 1.1.6
Date: 2025-01-31
Version: 1.1.6.9001
Date: 2025-02-03
Authors@R: c(
person("Marek", "Gagolewski",
role = c("aut", "cre", "cph"),
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
genieclust package for R and Python
Copyleft (C) 2018-2024, Marek Gagolewski <https://www.gagolewski.com/>
Copyleft (C) 2018-2025, Marek Gagolewski <https://www.gagolewski.com/>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyleft (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com/>
# Copyleft (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com/>
# pip3 install pweave tabulate hdbscan mlpack nmslib pytest rpy2 scanpy

# R: rworldmap [gdal-devel geos-devel proj-devel udunits2-devel gdal proj]

.PHONY: python py-test py-check r r-check r r-build html docs clean

Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.x.x (2025-xx-xx)

* ...


## 1.1.6 (2024-08-22)

* [PYTHON] The package now works with *numpy* 2.0.
Expand Down
2 changes: 1 addition & 1 deletion R/gclust.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ############################################################################ #
# #
# Copyleft (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com> #
# Copyleft (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com> #
# #
# #
# This program is free software: you can redistribute it and/or modify #
Expand Down
2 changes: 1 addition & 1 deletion R/genieclust-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ############################################################################ #
# #
# Copyleft (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com> #
# Copyleft (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com> #
# #
# #
# This program is free software: you can redistribute it and/or modify #
Expand Down
2 changes: 1 addition & 1 deletion R/mst.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ############################################################################ #
# #
# Copyleft (C) 2020-2024, Marek Gagolewski <https://www.gagolewski.com> #
# Copyleft (C) 2020-2025, Marek Gagolewski <https://www.gagolewski.com> #
# #
# #
# This program is free software: you can redistribute it and/or modify #
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Any contributions are welcome (e.g., Julia, Matlab, ...).

## License

Copyright (C) 2018–2024 Marek Gagolewski <https://www.gagolewski.com/>
Copyright (C) 2018–2025 Marek Gagolewski <https://www.gagolewski.com/>

This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License Version 3, 19
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/genieclust_plots-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/genieclust_plots-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/genieclust_plots-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/genieclust_plots-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/ssi-map-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_images/ssi-oecd-dendrogram-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* --------------------------------------------------------------------------
Copyleft (C) 2021-2024, Marek Gagolewski <https://www.gagolewski.com/>
Copyleft (C) 2021-2025, Marek Gagolewski <https://www.gagolewski.com/>
-------------------------------------------------------------------------- */

@import url("fonts/Alegreya-fontspec.css");
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '1.1.6',
VERSION: '1.1.6.9001',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
10 changes: 5 additions & 5 deletions docs/genieclust.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=fd3f3429" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=36a5483c" />
<link rel="stylesheet" type="text/css" href="_static/css/custom.css?v=5282ffc2" />
<link rel="stylesheet" type="text/css" href="_static/css/custom.css?v=1981fb80" />



Expand Down Expand Up @@ -222,7 +222,7 @@
<a class="sidebar-brand" href="index.html">genieclust</a>
</span>
<div class="sidebar-brand">
1.1.6
1.1.6.9001
</div>
<form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down Expand Up @@ -451,11 +451,11 @@ <h1>Python Package <cite>genieclust</cite> Reference<a class="headerlink" href="
<div class="copyright">


Copyright &#169; 2018–2024 by <a href="https://www.gagolewski.com">Marek Gagolewski</a>.
Copyright &#169; 2018–2025 by <a href="https://www.gagolewski.com">Marek Gagolewski</a>.
Some rights reserved. Licensed under <a href='https://creativecommons.org/licenses/by-nc-nd/4.0/'>CC BY-NC-ND 4.0</a>.
Built with <a href="https://sphinx-doc.org/">Sphinx</a>
and a customised <a href="https://github.com/pradyunsg/furo">Furo</a> theme.
Last updated on 2024-11-20T12:33:00+0100.
Last updated on 2025-02-03T16:58:47+0100.
This site will never display any ads: it is a non-profit project.
It does not collect any data.
</div>
Expand All @@ -470,7 +470,7 @@ <h1>Python Package <cite>genieclust</cite> Reference<a class="headerlink" href="

</aside>
</div>
</div><script src="_static/documentation_options.js?v=937269b5"></script>
</div><script src="_static/documentation_options.js?v=c547bfba"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/scripts/furo.js?v=4e2eecee"></script>
Expand Down
Loading

0 comments on commit bbbf949

Please sign in to comment.