Analysing European data from CIA

Clustering

wdir ← “C:/Users/batagelj/work/clamix/relC”

Analyses

Hierarchical clustering without constraints

Reading constraints in R

Clustering with relational constraint based on the class dist

> idx <- function(i,j) {if (i<j) return(n*(i-1) - i*(i-1)/2 + j-i) else
+   return(n*(j-1) - j*(j-1)/2 + i-j)}
>     
> d <- vector("list",length(R))
> names(d)<-names(R)
> for(i in 1:length(R)) for(j in R[[i]])
+   d[[i]] <- append(d[[i]],list(ind=j,dis=DD[idx(i,j)]))
> sd <- d
> source("C:\\Users\\batagelj\\work\\R\\RelCon\\relConH.R")
> Ri <- sRi; Ro <- sRo
> n <- nrow(D); np <- n+1; hD <- new.env()
> for(i in 1:length(R)) for(j in R[[i]])  assign(key(i,j),DD[idx(i,j)],envir=hD)
> attr(hD,"Size") <- n; attr(hD,"Labels") <- names(R)
> res <- relConH(strategy="tolerant")
Clustering with relational constraint based on a dictionary
by Vladimir Batagelj, March 2018
Method: max   Strategy: tolerant 
[1] "Started: 2018-04-06 23:24:09"
Error in if (node[q] == 0) m[k, 2] <- -q else m[k, 2] <- node[q] : 
  missing value where TRUE/FALSE needed

Hierarchical clustering without constraints

To do

  • make read_Pajek in eurdc more robust (initial space in each line)


notes/da/euana.txt · Last modified: 2018/04/11 12:29 by vlado
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki