cluster-analysis

How to make a graph of clustered boolean variables in R?

拈花ヽ惹草 提交于 2021-02-11 04:27:35
问题 I have a dataset which consists entirely of boolean variables. Exactly like the transformed animal dataset below, only with many more columns. # http://stats.stackexchange.com/questions/27323/cluster-analysis-of-boolean-vectors-in-r library(cluster) head(mona(animals)[[1]]) war fly ver end gro hai ant 0 0 0 0 1 0 bee 0 1 0 0 1 1 cat 1 0 1 0 0 1 cpl 0 0 0 0 0 1 chi 1 0 1 1 1 1 cow 1 0 1 0 1 1 The goal is to rearrange the rows in such a way that groupings of similar membership patterns are

How to make a graph of clustered boolean variables in R?

喜夏-厌秋 提交于 2021-02-11 04:26:19
问题 I have a dataset which consists entirely of boolean variables. Exactly like the transformed animal dataset below, only with many more columns. # http://stats.stackexchange.com/questions/27323/cluster-analysis-of-boolean-vectors-in-r library(cluster) head(mona(animals)[[1]]) war fly ver end gro hai ant 0 0 0 0 1 0 bee 0 1 0 0 1 1 cat 1 0 1 0 0 1 cpl 0 0 0 0 0 1 chi 1 0 1 1 1 1 cow 1 0 1 0 1 1 The goal is to rearrange the rows in such a way that groupings of similar membership patterns are

How to make a graph of clustered boolean variables in R?

眉间皱痕 提交于 2021-02-11 04:25:59
问题 I have a dataset which consists entirely of boolean variables. Exactly like the transformed animal dataset below, only with many more columns. # http://stats.stackexchange.com/questions/27323/cluster-analysis-of-boolean-vectors-in-r library(cluster) head(mona(animals)[[1]]) war fly ver end gro hai ant 0 0 0 0 1 0 bee 0 1 0 0 1 1 cat 1 0 1 0 0 1 cpl 0 0 0 0 0 1 chi 1 0 1 1 1 1 cow 1 0 1 0 1 1 The goal is to rearrange the rows in such a way that groupings of similar membership patterns are

fviz_cluster() not accepting for k-medoid (PAM) results

核能气质少年 提交于 2021-02-10 20:24:59
问题 Trying to visualize k-medoid (PAM) cluster results with fviz_cluster() , however function isn't accepting them. It states within ?fviz_clust "object argument = an object of class "partition" created by the functions pam() , clara() or fanny() in cluster package" I've tried accessing the clustering vector through other means; pam_gower_2$clustering pam_gower_2[[3]] but then I get a separate error: Error: $ operator is invalid for atomic vectors" The class of pam_gower_2 is partition? As the

How to avoid out of memory python?

半世苍凉 提交于 2021-02-10 05:33:08
问题 I'm new to python and ubuntu. i got killed after running python code. The file I'm using for the code is around 2.7 GB and I have 16 GB RAM with one tera hard ... what should I do to avoid this problem because I'm searching and found it seems to be out of memory problem I used this command free -mh I got total used free shared buff/cache available Mem: 15G 2.5G 9.7G 148M 3.3G 12G Swap: 4.0G 2.0G 2.0G the code link I tried Link import numpy as np import matplotlib.pyplot as plt class

partially define initial centroid for scikit-learn K-Means clustering

孤街醉人 提交于 2021-02-08 10:57:22
问题 Scikit documentation states that: Method for initialization: ‘k-means++’ : selects initial cluster centers for k-mean clustering in a smart way to speed up convergence. See section Notes in k_init for more details. If an ndarray is passed, it should be of shape (n_clusters, n_features) and gives the initial centers. My data has 10 (predicted) clusters and 7 features. However, I would like to pass array of 10 by 6 shape, i.e. I want 6 dimensions of centroid of be predefined by me, but 7th

partially define initial centroid for scikit-learn K-Means clustering

偶尔善良 提交于 2021-02-08 10:56:40
问题 Scikit documentation states that: Method for initialization: ‘k-means++’ : selects initial cluster centers for k-mean clustering in a smart way to speed up convergence. See section Notes in k_init for more details. If an ndarray is passed, it should be of shape (n_clusters, n_features) and gives the initial centers. My data has 10 (predicted) clusters and 7 features. However, I would like to pass array of 10 by 6 shape, i.e. I want 6 dimensions of centroid of be predefined by me, but 7th

partially define initial centroid for scikit-learn K-Means clustering

谁都会走 提交于 2021-02-08 10:56:35
问题 Scikit documentation states that: Method for initialization: ‘k-means++’ : selects initial cluster centers for k-mean clustering in a smart way to speed up convergence. See section Notes in k_init for more details. If an ndarray is passed, it should be of shape (n_clusters, n_features) and gives the initial centers. My data has 10 (predicted) clusters and 7 features. However, I would like to pass array of 10 by 6 shape, i.e. I want 6 dimensions of centroid of be predefined by me, but 7th

GMM/EM on time series cluster

你。 提交于 2021-02-08 10:07:40
问题 According to a paper, it is supposed to work. But as a learner of scikit-learn package.. I do not see how. All the sample codes cluster by ellipses or circles as here. I would really like to know how to cluster the following plot by different patterns... 0 -3 are the mean of power over certain time periods (divided into 4) while 4, 5, 6 each correspond to standard deviation of the year, variance in weekday/weekend, variance in winter/summer. So the ylabel does not necessarily meet with 4,5,6.

Is it possible to run a clustering algorithm with chunked distance matrices?

痞子三分冷 提交于 2021-02-08 08:20:21
问题 I have a distance/dissimilarity matrix (30K rows 30K columns) that is calculated in a loop and stored in ROM. I would like to do clustering over the matrix. I import and cluster it as below: Mydata<-read.csv("Mydata.csv") Mydata<-as.dist(Mydata) Results<-hclust(Mydata) But when I convert the matrix to dist object, I get RAM limitation error. How can I handle it? Can I run hclust algorithm in a loop/chunking? I mean I divide the distance matrix into chunks and run them in a loop? 回答1: You may