fuzzy c-means cluster analysis

5373
6
12-30-2010 03:11 PM
ClintCabanero
Occasional Contributor
Hello,

Does ArcGIS Desktop 10 with Geostatistical Analyst perform fuzzy c-means cluster analysis?  I am currently working with a procedure that requires I export tables to the R environment to do this. Would be nice if I can stay inside ArcGIS.

Thank you,
Clint
0 Kudos
6 Replies
LaurenRosenshein
New Contributor III
Hi Clint,

This is a great question!  Actually, we've got a great sample script that shows using R from inside of ArcGIS to do cluster analysis!  The sample script has several options for the cluster method, including cmeans, which may be just what you're looking for!  🙂  Even if it isn't the same method that you are currently using, the sample shows the use of python scripting within ArcGIS to connect to R.  It may be a useful template for you moving forward so that you can avoid jumping in and out of ArcGIS and R. 

Additionally, we are currently working on an implementation of K-Means ++ Clustering, with optional space/time constraints.  We're calling it Group Similar Features, and it will be in the Spatial Statistics toolbox in ArcGIS 10.1.  I know that 10.1 is still a ways off, but we're really excited about it and hopefully you will find it valuable in the future.

Hope this helps!

Lauren Rosenshein
Geoprocessing Product Engineer
0 Kudos
HuangleiPan1
New Contributor II

Hello Lauren,

I would like to ask what's the name of "Group Similar Features" in geoprocessing tools in final edition of ArcGIS 10.6 or ArcGIS Pro. I need to use it now.

Thanks

0 Kudos
RyanRuthart1
New Contributor II

Hello Huanglei Pan,

In ArcMap 10.6 the tool is called Grouping Analysis (Grouping Analysis—Help | ArcGIS Desktop)

In ArcGIS Pro we have split Grouping Analysis into non spatial (Multivariate Clustering—ArcGIS Pro | ArcGIS Desktop )  and spatial (Spatially Constrained Multivariate Clustering—ArcGIS Pro | ArcGIS Desktop) versions.

I hope this helps,

Ryan

0 Kudos
HuangleiPan1
New Contributor II

Thanks a lot, Ryan.

I would like to ask one more question, is there any tool in ArcGIS Pro that can process fuzzy c-means clustering or other kinds of clustering?

0 Kudos
RyanRuthart1
New Contributor II

In ArcGIS Pro we do not have a tool for fuzzy c-means clustering method. Spatially Constrained Multivariate Clustering can return frequency based probabilities of cluster membership if you use the Permutations to Calculate Membership Probabilities setting. Density Based Clustering (http://pro.arcgis.com/en/pro-app/tool-reference/spatial-statistics/densitybasedclustering.htm) using the HDBScan Clustering Method will also return frequency based Membership Probabilities.

0 Kudos
JeffreyEvans
Occasional Contributor III
Here is an R script for performing fuzzy C-Means clustering. It accepts a point shapefile and assumes that the variables that you want to use for the analysis are in sequential columns. If you want to cluster polygons just change the sp class read/write functions to "readShapePoly" and "writePolyShape".

#### START ####

if (!require(maptools)) stop("maptools PACKAGE MISSING")
if (!require(e1071)) stop("e1071 PACKAGE MISSING")

inshape = "C:/ANALYSIS/points"                    # NAME OF POINT SHAPEFILE
outshape = "C:/ANALYSIS/cmeans_points"      # NAME OF CLUSTERED SHAPEFILE
ID = "FID"                                                 # UNIQUE ID IN POINT SHAPEFILE

# READ POINT SHAPEFILE AS SP CLASS OBJECT
shape = readShapePoints(paste(inshape), proj4string=CRS(as.character(NA)), verbose=FALSE)

## FUZZY C-MEAN'S CLUSTERING ##
nc=4  # NUMBER OF CLUSTERS

# C-MEAN'S
sclust <- cmeans(shape@data[,2:ncol(shape@data)], nc, iter.max=100, method="cmeans",
                        weights=1, dist="euclidean")

# CLUSTER RESULTS WITH CLASSES AND PROBS FOR EACH CLASS
Zi <- as.data.frame(cbind(shape@data[,ID], sclust$cluster, sclust$membership))
      names(Zi) <- c("FID", "CLASS", "p1", "p2", "p3", "p4")

# JOIN CLUSTER RESULTS TO SHAPEFILE AND WRITE OUT NEW SHAPEFILE
shape@data = data.frame(shape@data, Zi[match(shape@data[,ID], Zi[,ID]),])
   writePointsShape(shape, paste(outshape))

#### END ####
0 Kudos