cluster-analysis

Hierarchical clustering with R

妖精的绣舞 提交于 2021-01-28 05:24:33
问题 Consider several points: A = (1, 2.5), B = (5, 10), C = (23, 34), D = (45, 47), E = (4, 17), F = (18, 4) How can I perform hierarchical clustering on them with R? I've read this example Cluster Analysis but I'm not sure how to enter these values as points rather than just regular numbers. When I do x <- c(...) #x values y <- c(...) #y values I can plot them using plot(x,y) But how can I specify those values like in the example: mydata <- scale(mydata) Doing mydata <- scale(x,y) I get the

Clustering with Mclust results in an empty cluster

断了今生、忘了曾经 提交于 2021-01-05 07:23:05
问题 I am trying to cluster my empirical data using Mclust. When using the following, very simple code: library(reshape2) library(mclust) data <- read.csv(file.choose(), header=TRUE, check.names = FALSE) data_melt <- melt(data, value.name = "value", na.rm=TRUE) fit <- Mclust(data$value, modelNames="E", G = 1:7) summary(fit, parameters = TRUE) R gives me the following result: ---------------------------------------------------- Gaussian finite mixture model fitted by EM algorithm ------------------

Plotting the KMeans Cluster Centers for every iteration in Python

送分小仙女□ 提交于 2021-01-05 07:22:45
问题 I created a dataset with 6 clusters and visualize it with the code below, and find the cluster center points for every iteration, now i want to visualize demonstration of update of the cluster centroids in KMeans algorithm. This demonstration should include first four iterations by generating 2×2-axis figure. I found the points but i cant plot them, can you please check out my code and by looking that, help me write the algorithm to scatter plot? Here is my code so far: import seaborn as sns

Plotting the KMeans Cluster Centers for every iteration in Python

六月ゝ 毕业季﹏ 提交于 2021-01-05 07:22:26
问题 I created a dataset with 6 clusters and visualize it with the code below, and find the cluster center points for every iteration, now i want to visualize demonstration of update of the cluster centroids in KMeans algorithm. This demonstration should include first four iterations by generating 2×2-axis figure. I found the points but i cant plot them, can you please check out my code and by looking that, help me write the algorithm to scatter plot? Here is my code so far: import seaborn as sns

R: plot larger components (clarifying another stackoverflow post)

点点圈 提交于 2021-01-05 07:16:05
问题 I am looking at this stackoverflow plot over here: How to plot only large communities/clusters in R library(igraph) set.seed(1) g1 <- erdos.renyi.game(100, 1 / 70) cls <- clusters(g1) g2 <- delete_vertices(g1, V(g1)[cls$membership %in% which(cls$csize <= 10)]) plot(g2) It seems that first a random graph is created (called "g1"). Then the "cluster()" function is used to find out "isolated subgraphs" of "g1". All the "isolated subgraphs of g1" are stored in another object called "cls". The user

How to find Local maxima in Kernel Density Estimation?

橙三吉。 提交于 2020-12-30 08:18:05
问题 I'm trying to make a filter (to remove outlier and noise) using kernel density estimators(KDE). I applied KDE in my 3D (d=3) data points and that gives me the probability density function (PDF) f(x). Now as we know local maxima of density estimation f(x) defined the centers of the clusters of data points. So my idea is to define the appropriate f(x) which will determine those clusters. My question is how and what method will be better suited for this purpose of finding local maxima in f(x).

Clustering similar time series?

ⅰ亾dé卋堺 提交于 2020-12-30 08:14:23
问题 I have somewhere between 10-20k different time-series (24 dimensional data -- a column for each hour of the day) and I'm interested in clustering time series that exhibit roughly the same patterns of activity. I had originally started to implement Dynamic Time Warping (DTW) because: Not all of my time series are perfectly aligned Two slightly shifted time series for my purposes should be considered similar Two time series with the same shape but different scales should be considered similar

R: Are “node attributes” and “edge attributes” used during Network Graph Clustering (Community Detection)?

会有一股神秘感。 提交于 2020-12-13 03:12:36
问题 I am trying to find out if node attributes and edge attributes are used during graph network clustering (i.e. community detection algorithms) in R. I could not find an answer, so I decided to write some code for this problem and compare the differences. I first created a file of node attributes and edge attributes - then I created a graph network. On this graph network, I performed the clustering/community detection algorithm. In Method 1, I use the full information from the edges and nodes

Formatting Graphs in R

我的未来我决定 提交于 2020-11-29 09:52:05
问题 I am trying to figure out how to easily access and manipulate graphs created in R. If I start with the following data. I create a graph, run some graph clustering and then plot the first cluster: #libraries library(igraph) library(igraphdata) data(karate) #cluster cfg <- cluster_fast_greedy(karate) plot(cfg, karate) cfg IGRAPH clustering fast greedy, groups: 3, mod: 0.43 + groups: $`1` [1] "Actor 9" "Actor 10" "Actor 15" "Actor 16" "Actor 19" "Actor 21" "Actor 23" "Actor 24" "Actor 25" "Actor

(R language) Understanding what is a “weighted” graph

泄露秘密 提交于 2020-11-24 17:19:03
问题 I am using R and the igraph library to learn about network graph data. In particular, I am trying to understand the concept of a "weighted graph" - from what I have read, the "weights" are generally associated with the "Edges" in the graph. But can the "weights" ever be associated with the "nodes"? (sometimes, I see that "nodes" are also referred to as "vertexes") Suppose I have two datasets : one for the nodes and one for the edges. library(igraph) library(visNetwork) Nodes <-data.frame(