1 首先针对数据进行分析,回答下面的问题: 1 )想用聚类方法解决什么问题。是想看数据的结构,还是想把数据分为很多类,还是有其他的目的。 2 )数据本身的分布。针对样本聚类还是针对变量聚类?样本可能符合怎样的分布?变量又会符合怎样的分布? 2 选择合适的聚类方法 针对聚类目的和数据的分布,选择合适的方法。一般来说,层次聚类比较适合用来分析数据的结构,因此可以用来做初步的聚类,从而对数据的结构有一个初步的了解。 k-means 聚类需要指定类别数。还有很多其他的聚类方法。针对数据分布,需要选择合理的方法计算聚类对象之间的相似性,一般采用基于距离或者基于相关性的方法。 3 确定聚类数 这个问题很难确定,除非已经有了很好的先验知识。这和下面的问题很相关。 4 评估聚类效果好坏 如果有金标准,则用它们来判断聚类效果是最合适的。如果没有的话,则首先要考虑聚类的目的,然后聚类结果应该与已有先验知识相吻合。 此外,还有一些方法可以用来判断聚类效果。一个是聚类结果是否稳定,即如果聚类方法涉及到参数的选择,可能有的结果对于参数很敏感;另外一个是不同聚类方法的一致性如何。如果不同的方法得到的聚类都很一致,则效果较好。 在R中有很多包可以做聚类分析,下面是CRAN上总结的用于聚类的包: 见( http://cran.r-project.org/web/views/Cluster.html ) Hierarchical Clustering: Functionshclust()from package stats andagnes()from cluster are the primary functions for agglomerative hierarchical clustering, functiondiana()can be used for divisive hierarchical clustering. Faster alternatives tohclust()are provided by the packages fastcluster and flashClust . Functiondendrogram()from stats and associated methods can be used for improved visualization for cluster dendrograms. Package dynamicTreeCut contains methods for detection of clusters in hierarchical clustering dendrograms. hybridHclust implements hybrid hierarchical clustering via mutual clusters. Package isopam uses an algorithm which is based on the classification of ordination scores from isometric feature mapping. The classification is performed either as a hierarchical, divisive method or as non-hierarchical partitioning. Package LLAhclust provides likelihood linkage analysis hierarchical clustering. The package protoclust implements a form of hierarchical clustering that associates a prototypical element with each interior node of the dendrogram. Using the package'splot()function, one can produce dendrograms that are prototype-labeled and are therefore easier to interpret. pvclust is a package for assessing the uncertainty in hierarchical cluster analysis. It provides approximately unbiased p-values as well as bootstrap p-values. Package sparcl provides clustering for a set of n observations when p variables are available, where p n . It adaptively chooses a set of variables to use in clustering the observations. Sparse K-means clustering and sparse hierarchical clustering are implemented. Partitioning Clustering: Functionkmeans()from package stats provides several algorithms for computing partitions with respect to Euclidean distance. Functionpam()from package cluster implements partitioning around medoids and can work with arbitrary distances. Functionclara()is a wrapper topam()for larger data sets. Silhouette plots and spanning ellipses can be used for visualization. Package apcluster implements Frey's and Dueck's Affinity Propagation clustering. The algorithms in the package are analogous to the Matlab code published by Frey and Dueck. Package bayesclust allows to test and search for clusters in a hierarchical Bayes model. Package clues provides a clustering method based on local shrinking. Package clusterSim allows to search for the optimal clustering procedure for a given dataset. Package flexclust provides k-centroid cluster algorithms for arbitrary distance measures, hard competitive learning, neural gas and QT clustering. Neighborhood graphs and image plots of partitions are available for visualization. Some of this functionality is also provided by package cclust . Package kernlab provides a weighted kernel version of the k-means algorithm bykkmeansand spectral clustering byspecc. Packages kml and kml3d provide k-means clustering specifically for longitudinal (joint) data. Package optpart contains a set of algorithms for creating partitions and coverings of objects largely based on operations on similarity relations (or matrices). Package pdfCluster provides tools to perform cluster analysis via kernel density estimation. Clusters are associated to the maximally connected components with estimated density above a threshold. Package skmeans allows spherical k-Means Clustering, i.e. k-means clustering with cosine similarity. It features several methods, including a genetic and a simple fixed-point algorithm and an interface to the CLUTO vcluster program for clustering high-dimensional datasets. Package trimcluster provides trimmed k-means clustering. Package tclust also allows for trimmed k-means clustering. In addition using this package other covariance structures can also be specified for the clusters. Model-based Clustering: ML estimation: Package mclust fits mixtures of Gaussians using the EM algorithm. It allows fine control of volume and shape of covariance matrices and agglomerative hierarchical clustering based on maximum likelihood. It provides comprehensive strategies using hierarchical clustering, EM and the Bayesian Information Criterion (BIC) for clustering, density estimation, and discriminant analysis. Please note the license under which this package is distributed. Except for strict academic use, use of mclust (by itself or through other packages) requires payment of an annual license fee and completion of a license agreement. Package HDclassif provides functionhddcto fit Gaussian mixture model to high-dimensional data where it is assumed that the data lives in a lower dimension than the original space. mritc provides tools for classification using normal mixture models and (higher resolution) hidden Markov normal mixture models fitted by various methods. prabclus clusters a presence-absence matrix object by calculating an MDS from the distances, and applying maximum likelihood Gaussian mixtures clustering to the MDS points. Package MetabolAnalyze fits mixtures of probabilistic principal component analysis with the EM algorithm. Fitting finite mixtures of uni- and multivariate scale mixtures of skew-normal distributions with the EM algorithm is provided by package mixsmsn . Package movMF fits finite mixtures of von Mises-Fisher distributions with the EM algorithm. Package MFDA implements model-based functional data analysis. For grouped conditional data package mixdist can be used. Package mixRasch estimates mixture Rasch models, including the dichotomous Rasch model, the rating scale model, and the partial credit model with joint maximum likelihood estimation. Package pmclust allows to use unsupervised model-based clustering for high dimensional (ultra) large data. The package uses Rmpi to perform a parallel version of the EM algorithm for mixtures of Gaussians. Bayesian estimation: Bayesian estimation of finite mixtures of multivariate Gaussians is possible using package bayesm . The package provides functionality for sampling from such a mixture as well as estimating the model using Gibbs sampling. Additional functionality for analyzing the MCMC chains is available for averaging the moments over MCMC draws, for determining the marginal densities, for clustering observations and for plotting the uni- and bivariate marginal densities. Package bayesmix provides Bayesian estimation using JAGS. Package Bmix provides Bayesian Sampling for stick-breaking mixtures. Package bclust allows Bayesian clustering using a spike-and-slab hierarchical model and is suitable for clustering high-dimensional data. Package dpmixsim fits Dirichlet process mixture models using conjugate models with normal structure. Package profdpm determines the maximum posterior estimate for product partition models where the Dirichlet process mixture is a specific case in the class. Package mixAK contains a mixture of statistical methods including the MCMC methods to analyze normal mixtures with possibly censored data. Package GSM fits mixtures of gamma distributions. Package mcclust implements methods for processing a sample of (hard) clusterings, e.g. the MCMC output of a Bayesian clustering model. Among them are methods that find a single best clustering to represent the sample, which are based on the posterior similarity matrix or a relabelling algorithm. Package rjags provides an interface to the JAGS MCMC library which includes a module for mixture modelling. Other estimation methods: Package AdMit allows to fit an adaptive mixture of Student-t distributions to approximate a target density through its kernel function. Circular and orthogonal regression clustering using redescending M-estimators is provided by package edci . Robust estimation using Weighted Likelihood can be done with package wle . Package pendensity estimates densities with a penalized mixture approach. Other Cluster Algorithms: Package amap provides alternative implementations of k-means and agglomerative hierarchical clustering. Package biclust provides several algorithms to find biclusters in two-dimensional data. Package isa2 provides the Iterative Signature Algorithm (ISA) for biclustering. Package cba implements clustering techniques for business analytics like "rock" and "proximus". Package CHsharp clusters 3-dimensional data into their local modes based on a convergent form of Choi and Hall's (1999) data sharpening method. Package clue implements ensemble methods for both hierarchical and partitioning cluster methods. Package CoClust implements a cluster algorithm that is based on copula functions and therefore allows to group observations according to the multivariate dependence structure of the generating process without any assumptions on the margins. Fuzzy clustering and bagged clustering are available in package e1071 . Package compHclust provides complimentary hierarchical clustering which was especially designed for microarray data to uncover structures present in the data that arise from 'weak' genes. Package FactoClass performs a combination of factorial methods and cluster analysis. The hopach algorithm is a hybrid between hierarchical methods and PAM and builds a tree by recursively partitioning a data set. For graphs and networks model-based clustering approaches are implemented in packages latentnet and mixer . Package nnclust allows fast clustering of large data sets by constructing a minimum spanning tree for each cluster. For each cluster the procedure is stopped when the nearest-neighbour distance rises above a specified threshold. A set of clusters and a set of "outliers" not in any cluster is returned. The algorithm works best for well-separated clusters in up to 8 dimensions, and sample sizes up to hundreds of thousands. Package randomLCA provides the fitting of latent class models which optionally also include a random effect. Package poLCA allows for polytomous variable latent class analysis and regression. Package RPMM fits recursively partitioned mixture models for Beta and Gaussian Mixtures. This is a model-based clustering algorithm that returns a hierarchy of classes, similar to hierarchical clustering, but also similar to finite mixture models. Package segclust fits a segmentation/clustering model. A mixture of univariate gaussian distributions is used for the cluster structure and segments are assumed to arise because switching between clusters over time occurs. Self-organizing maps are available in package som . Several packages provide cluster algorithms which have been developped for bioinformatics applications. These packages include FunCluster for profiling microarray expression data, MMG for mixture models on graphcs, and ORIClust for order-restricted information-based clustering. Cluster-wise Regression: Package flexmix implements an user-extensible framework for EM-estimation of mixtures of regression models, including mixtures of (generalized) linear models. Package fpc provides fixed-point methods both for model-based clustering and linear regression. A collection of asymmetric projection methods can be used to plot various aspects of a clustering. Multigroup mixtures of latent Markov models on mixed categorical and continuous data (including time series) can be fitted using depmix or depmixS4 . The parameters are optimized using a general purpose optimization routine given linear and nonlinear constraints on the parameters. Package mixreg fits mixtures of one-variable regressions and provides the bootstrap test for the number of components. Package lcmm fits a latent class linear mixed model which is also known as growth mixture model or heterogeneous linear mixed model using a maximum likelihood method. moc fits mixture models to multivariate mixed data using a Newton-type algorithm. The component specific distribution may have one, two or three parameters. Covariates and concomitant variables can be specified as well as constraints for the parameters. mixtools provides fitting with the EM algorithm for parametric and non-parametric (multivariate) mixtures. Parametric mixtures include mixtures of multinomials, multivariate normals, normals with repeated measures, Poisson regressions and Gaussian regressions (with random effects). Non-parametric mixtures include the univariate semi-parametric case where symmetry is imposed for identifiability and multivariate non-parametric mixtures with conditional independent assumption. In addition fitting mixtures of Gaussian regressions with the Metropolis-Hastings algorithm is available. mixPHM fits mixtures of proportional hazard models with the EM algorithm. Package gamlss.mx fits finite mixtures of of gamlss family distributions. Additional Functionality: Mixtures of univariate normal distributions can be printed and plotted using package nor1mix . Packages gcExplorer and clusterfly allow to visualise the results of clustering algorithms. Package clusterGeneration contains functions for generating random clusters and random covariance/correlation matrices, calculating a separation index (data and population version) for pairs of clusters or cluster distributions, and 1-D and 2-D projection plots to visualize clusters. Alternatively MixSim generates a finite mixture model with Gaussian components for prespecified levels of maximum and/or average overlaps. This model can be used to simulate data for studying the performance of cluster algorithms. For cluster validation package clusterRepro tests the reproducibility of a cluster. Package clv contains popular internal and external cluster validation methods ready to use for most of the outputs produced by functions from package cluster and clValid calculates several stability measures. Package clustTool provides a GUI for clustering data with spatial information. Package clustvarsel provides variable selection for model-based clustering. Functionality to compare the similarity between two cluster solutions is provided bycluster.stats()in package fpc . clusterCons allows to calculate the consensus clustering result from re-sampled clustering experiments with the option of using multiple algorithms and parameters. The stability of k-centroid clustering solutions fitted using functions from package flexclust can also be validated viabootFlexclust()using bootstrap methods. Package MOCCA provides methods to analyze cluster alternatives based on multi-objective optimization of cluster validation indices. Package SDisc provides an integrated methodology for the identification of homogeneous profiles in a data distribution by including methods for data treatment and pre-processing, repeated cluster analysis, model selection, model reliability and reproducibility assessment, profiles characterization and validation by visual and table summaries. Package sigclust provides a statistical method for testing the significance of clustering results.
时间序列是一种重要的高维数据类型,它是由客观对象的某个物理量在不同时间点的采样值按照时间先后次序排列而组成的序列,在经济管理以及工程领域具有广泛应用。例如证券市场中股票的交易价格与交易量、外汇市场上的汇率、期货和黄金的交易价格以及各种类型的指数等,这些数据都形成一个持续不断的时间序列。利用时间序列数据挖掘,可以获得数据中蕴含的与时间相关的有用信息,实现知识的提取 。时间序列数据本身所具备的高维性、复杂性、动态性、高噪声特性以及容易达到大规模的特性,因此时间序列挖掘是数据挖掘研究中最具有挑战性的十大研究方向之一 。目前重点的研究内容包括时间序列的模式表示、时间序列的相似性度量和查询、时间序列的聚类、时间序列的异常检测、时间序列的分类、时间序列的预测等。 由于时间序列数据本身所具备的高维性、复杂性、动态性、高噪声特性以及容易达到大规模的特性,直接在时间序列上进行数据挖掘不但在储存和计算上要花费高昂代价而且可能会影响算法的准确性和可靠性。时间序列的模式表示是一种对时间序列进行抽象和概括的特征表示方法,是在更高层次上对时间序列的重新描述 。时间序列的模式表示具有压缩数据、保持时间序列基本形态的功能,并且具有一定的除噪能力。常用的时间序列模式表示方法主要包含:频域表示法、分段线性表示法、符号表示法以及主成分分析表示法等。频域表示的基本思想是将时间序列从时域通过傅里叶变换或小波变换映射到频域,用很少的低频系数来代表原来的时间序列数据,这种方法虽然数据浓缩的效率很高,但是对噪声敏感,而且不直观。分段线性表示法的基本思想是用 K个直线段来近似代替原来的时间序列,这种方法能够实现数据压缩的目的,而且允许在时间轴上进行缩放,但实现过程较复杂,且要求事先给出直线段数K。K值的选择是一个关键因素,太小则丢失有用信息,太大又会产生过多的冗余信息。时间序列的符号化表示就是通过一些离散化方法将时间序列的连续实数值或者一段时间内的时间序列波形映射到有限的符号表上,将时间序列转换为有限符号的有序集合。符号化表示的优点在于可以利用许多字符串研究领域的成果,缺点在于如何选择合适的离散化算法,解释符号的意义,以及定义符号之间的相似性度量。主成分分析是一种常见的降维方法。在时间序列的模式表示中,通过对整个时间序列数据库的整体表示实现对整个时间序列数据库的特征提取和压缩。其优点在于计算精度高且对噪声数据的鲁棒性强,但由于在奇异值分解过程中涉及到特征值计算,计算开销较大。 时间序列的相似性度量是时间序列数据挖掘的基础 。时间序列由于其特定的形状特征, 使得目前常用的一些相似性度量和聚类方法失去了原有的优越性, 而几乎所有的时间序列挖掘算法都涉及到计算序列之间的相似性问题。目前,时间序列的相似性度量主要采用Lp范数(例如欧几里德距离)、动态时间弯曲距离、最长公共子序列、编辑距离、串匹配等。前两种相似性度量方法应用较为广泛。但是欧几里德距离不支持时间序列的线性漂移和时间弯曲,动态时间弯曲距离的计算量很大,不适合直接应用于海量时间序列的挖掘,从而限制了其在时间序列数据挖掘上的广泛应用。 虽然各种聚类方法已经在数据挖掘领域中得到了较为深入的研究,但这些方法大多是针对关系数据库中的静态数据对象而提出的。然而在现实世界中越来越多的应用涉及到流数据和时间序列数据等随时间变化的复杂动态数据对象的聚类分析。由于时间序列数据与静态数据有着极大的不同,故对其进行聚类分析有着很大的复杂性。近年来,涌现出许多时间序列聚类方法 ,这些时间序列数据聚类方法大体上可以分为三种,即基于原始数据的聚类、基于特征的聚类和基于模型的聚类。其中后两种方法的核心思想是利用时间序列的模式表示方法把时间序列数据转化为静态的特征数据或者是模型参数,然后再直接应用静态数据的聚类方法来完成聚类任务。 在对时间序列进行分析时, 经常希望能够发现这些时间序列在不同时间段的形态有何关联关系。这种关联关系一般表现为时间序列中频繁出现的变化模式和极少出现的变化模式。这种极少出现的变化模式称之为异常模式。在某些领域, 异常模式的发现对人们来说往往更有价值。例如, 医院可以从病人的心电图序列中发现异常模式从而进行诊断和治疗。按照异常的表现形式不同, 线性时间和空间上时间序列的异常主要可以分为点异常和模式异常两种, 它们都是用于发现一条时间序列上的异常情况的。模式异常是指在一条时间序列上与其他模式之间具有显著差异的模式。事实上, 点异常也可以认为是长度为1 的模式异常。目前已经提出多种时间序列异常检测方法,例如基于人工免疫系统的时间序列异常检测 、基于支持向量聚类的时间序列异常检测 以及后缀树和马尔可夫模型的时间序列异常检测 。 时间序列分类是时间序列数据分析中的重要任务之一. 不同于时间序列分析中常用的算法与问题,时间序列分类是要把整个时间序列当作输入,其目的是要赋予这个序列某个离散标记。它比一般分类问题困难,主要在于要分类的时间序列数据不等长,这使得一般的分类算法不能直接应用。即使是等长的时间序列,由于不同序列在相同位置的数值一般不可直接比较,一般的分类算法依然还是不适合直接应用。为了解决这些难点,通常有两种方法:第一,定义合适的距离度量(最常用的距离度量是DTW距离),使得在此度量意义下相近的序列有相同的分类标签,这类方法属于领域无关的方法;第二,首先对时间序列建模(利用序列中前后数据的依赖关系建立模型),再用模型参数组成等长向量来表示每条序列,最后用一般的分类算法进行训练和分类,这类方法属于领域相关的方法。文 分析了两类方法,并且分别在不同的合成数据集和实际数据集上比较了领域无关和领域相关的两类方法。结果发现在训练数据较少时,使用领域相关的算法比较合适;另一方面,领域无关的算法受噪声的影响相对较少。 预测是对尚未发生或目前还不明确的事物进行预先的估计和推测,是在现时对事物将要发生的结果进行探讨和研究,简单地说就是指从已知事件测定未知事件。进行预测的总原则是:认识事物的发展变化规律,利用规律的必然性进行科学预测。时间序列预测主要包括三种基本方法:内生时间序列预测技术;外生时间序列预测技术;主观时间序列预测技术。时间序列分析与预测在经济 、金融 、工程 等领域有着广泛的应用,研究成果也最为丰富,将另文讨论。 参考文献 1. Keogh E, Kasetty S. On the need for time series data mining benchmarks: a survey and empirical demonstration .Data Mining and Knowledge Discovery, 2003, 7(4): 349-371. 2. Yang Qiang, Wu Xindong. 10 challenging problems in data mining research. Interna tional Journal of Information Technology Decision Making, 2006, 5(4): 597-604. 3. Lin J, Keogh E, Lonardi S, Chiu B. A symbolic representation of time series, with implications for streaming algorithms. Proceedings of the 8th ACM SIGMOD workshop on Research issues in data mining and knowledge discovery, 2003, Pages: 2 11. 4. Gullo F, Ponti G, Tagarelli A, Greco S. A time series representation model for accurate and fast similarity detection, Pattern Recognition, 2009, 42(11): 2998-3014. 5. Gunopulos D, Das G. Time series similarity measures. KDD00: Tutorial notes of the sixth ACM SIGKDD international conference on Knowledge discovery and data mining, 2000. 6. Literatures on Similarity-based Time Series Retrieval. http://www.cs.ust.hk/~leichen/readings/literaturesovertimeseries.htm 7. Liao T W. Clustering of time series data: a survey. Pattern Recognition, 2005, 38: 1857-1874 8. Dasgupta D, Forrest S. Novelty detection in time series data using ideas from immunology. In: Proceeding of the 5th International Conference on Intelligent Systems. 1996, Pages: 82- 87. 9. Ma J, Perkins S. Time-series Novelty Detection Using One-class Support Vector Machines. Procedding of International Joint Conference on Neural Networks, 2003. 10. Keogh E, Lonardi S. Finding surprising patterns in a time series database in linear time and space. Proceedings of the eighth ACM SIGKDD, 2002. 11. 杨一鸣, 潘嵘, 潘嘉林, 杨强, 李磊 . 时间序列分类问题的算法比较 . 计算机学报, 2007 , 30 ( 8 ): 1259-1265. 12. Clements M P (柯莱蒙兹), Hendry D F (韩德瑞),陆懋祖 . 预测经济时间序列 . 北京大学出版社, 2008 13. Tsay R S (蔡瑞胸),潘家柱译 . 金融时间序列分析 . 机械工业出版社, 2006 14. 杨叔子.时间序列分析的工程应用(上下册).第二版.华中科技大学出版社, 2007
1 前言 数据挖掘是一个多学科交叉的研究领域,涉及许多学科。聚类是数据挖掘的重要任务之一,目前主要的聚类算法可以划分为如下几类 :划分方法,层次方法,基于密度的方法,基于网格的方法和基于模型的方法等。这些方法大多数需要一些参数限制,设定聚类的数目,而且聚类结果对初始状态及参数非常敏感。 近年来,一些学者应用群体智能 (Swarm Intelligence) 的思想研究聚类问题。因为群体智能源于对简单个体组成的群落社会系统的模拟,如蚁群、蜂群,在没有任何先验知识和无统一指挥的分布环境下,它们具有自我组织、合作、通信等特点。 Deneubourg 等首次模拟幼蚁自动分类 ( 即较小的幼虫在中心,较大的幼虫在外围 ) 及蚁尸聚积现象,提出了聚类基本模型。随后 Lumer 和 Faieta 在文献 中改进了 Deneubourg 的基本模型,提出了 LF 算法并应用于数据分析中。蚁群算法是一种新型的模拟进化算法,其在数据挖掘中的应用正逐步引起人们的关注 。但由于蚁群算法的研究历史很短,在实际问题中应用还较少,因此存在许多有待进一步研究改进的地方,如需要设置的参数太多、参数的设置还有一定难度、算法本身不能保证聚类纯度等。 本文在 LF 等基本模型的基础上引入相邻对象方向角和方向屏蔽角,对确定相邻对象的方法进行改进,并以矿山实际测量数据为数据源,对改进后的方法进行检验。 2 基本蚁群聚类算法的相邻对象的选取方法 蚁群聚类主要思想是 :先将所有多维属性空间中的数据对象随机地投影到二维网格平面上,然后每只蚂蚁在二维平面上随机选择一个数据对象,随即蚂蚁计算该数据对象与邻域半径内其他数据对象之间在属性空间中的相似性。如果不相似,蚂蚁将数据对象拾起并随机移往别处,再计算与邻域半径内对象的相似性,直到移往与周围对象相似的地方被放下,并随机选择下一个数据对象;如果相似,蚂蚁将不会拾起该数据对象,而随机选择下一个数据对象。这样,数据对象通过被蚂蚁的不断拾起、移动与放下而被聚类。或者说,相似的对象被蚂蚁搬运集中到一起。简单说来,其思想就是不相似的搬走,相似的放下。 从蚁群聚类的主要思想可知,相似对象能否聚在一起,是由邻域内对象的相似性大小决定的。以 常用的 LF 算法为例,分析邻域内相邻对象的选取方法。在 LF 算法中,数据对象的相似度 f ( o i ) 由公式 (1) 确定,设蚂蚁在时刻 t 于位置 r 发现对象 o i ,则 o i 在 r 处与其邻域内对象 o j 的平均相似度定义为 : (1) 其中, s 为邻域的边长, Neigh s s ( r ) 表示位置 r 周围面积为 s s 的正方形邻域。 d ( o i , o j ) 表示对象 o i 与对象 o j 在属性空间中的距离,常用欧氏 (Euclidean) 距离、余弦距离公式计算 ( 也可采用其它距离公式 ) 。 s 作为邻域的边长, 它给出了相似的邻域范围。相邻对象的选取方法就是将邻域范围内的所有对象作为相邻对象。这样的选取方法缺点在于所有的相邻对象都具有同样的重要性,没有体现不同方向的相邻对象在相似度计算中的不同影响。如图 1 所示, o i 为当前对象, s 为邻域边长,根据 LF 算法中相邻对象的选取方法,共八个相邻对象,其中 A 1 、 A 2 、 A 3 和 A 4 为第一类对象, B 1 、 B 2 、 B 3 和 B 4 为第二类对象。如果当前对象 o i 是第一类点,可能因为受第二类的四个点的影响,使得 f ( o i ) 很小,蚂蚁不能在此放下 o i ;另一方面, 如果当前对象 o i 是第二类点,可能因为受第二类的四个点的影响,使得 f ( o i ) 很大,导致蚂蚁在此放下 o i 。 3 相邻对象确定方法的改进 常用的相邻对象的确定方法由于没有考虑相邻对象之间方向关系,可能造成聚类速度缓慢甚至算法不收敛。在引入改进方法之前,先对几个概念进行定义。 相邻对象的方向角: o i 为当前对象, o j 和 o k 分别为 o i 的两个相邻对象,在二维网格平面上, o i 分别与 o j 、 o k 连线,两条连线之间形成的锐角叫做相邻对象 o j 和 o k 的方向角。如图 1 所示, 角就是 o i 的相邻对象 A 2 和 A 3 的方向角。 方向屏蔽角:是一个事先输入的角度常数,作用是与相邻对象的方向角进行比较,判断是否有相邻对象可以屏蔽,不参与相似度的计算。 新方法的基本过程描述如下: 第 1 步 初始化方向屏蔽角 ; 第 2 步 得到邻域范围内所有相邻对象 N j ( j =1,2, , k ) ,并计算当前对象到所有相邻对象在二维网格平面上的距离 D j ( j =1,2, , k ) 和所有相邻对象相互之间的方向角 nm ( n =1,2, , k , m =1,2, , k , n m ) ; 第 3 步 得到离当前对象最近的相邻对象 N i ,如果 im ( m =1,2, , k , i m ) ,将 N m 从相邻对象集中去掉; 第 4 步 按照 D j ( j =1,2, , k ) 从小到大依次对相邻对象进行检验,对相邻对象方向角小于屏蔽角的相邻对象进行屏蔽,最终得到屏蔽后的相邻对象集。 以图 1 所示的数据对象为例,当前对象为 o i , 设方向屏蔽角为 10 ,用新方法最终得到相邻对象集为 { A 1 , A 2 , A 3 , A 4 } , B 1 、 B 2 、 B 3 和 B 4 分别被 A 1 、 A 2 、 A 3 和 A 4 屏蔽掉了。 4 应用实例及结果分析 露天矿采场由于测量验收工作的需要,基本上每月都要对有采动的台阶位置进行测量,产生大量的测量数据,用手工对不同位置的数据进行分类是一件十分繁重的工作,采用数据聚类的方法不仅可以实现数据的自动聚类,又有利于台阶的自动生成。选用的实例数据是内蒙古某露天矿的台阶测量数据,如图 2 所示, 图中标有数字 1 、 2 、 3 和 4 附近的点为各台阶平盘的测量点。下面分别使用 LF 算法和改进后的算法对这些数据进行聚类。 LF 算法的参数设定为: k 1 =0.1 , k 2 =0.15 ,相似系数 a= 250 ,邻域边长 s= 2 ,迭代次数 N =100000 ;改进后的算法除了增加屏蔽角 =10 外,其它参数以 LF 算法相同。图 3 是 LF 算法聚类结果的二维网格平面投影显示,图 4 是改进算法的聚类结果的二维网格平面投影显示,不同的类用不同形成的点表示,对这两个图的比较可以看出,两种算法都实现了对测量数据的精确聚类,但从聚类结果的形态分布看,改进算法的聚类结果形态分布优于 LF 算法的聚类结果。图 5 所示的两条曲线分别是 LF 算法和改进算法的相似度变化曲线,从图中可以看出,改进算法在迭代 20000 次附近就达到了稳定,而 LF 算法是在迭代 80000 次后才达到稳定,说明改进算法比 LF 算法聚类速度明显加快了。图 6 所示为聚类结果的空间实际位置。 5 结论 在基本模型的基础上,对蚁群聚类算法中相邻对象的确定方法做了一些改进。通过定义相邻对象的方向角和方向屏蔽角,实现确定相邻对象是否最终被选取。使用相同的实例数据和相同的参数,分别用 LF 算法和改进后的算法进行聚类,对聚类结果和相似度变化曲线进行分析比较,结果表明,改进后蚁群聚类算法有更优的聚类形态和更快的聚类速度,达到了预期的目的。 图 3 LF 算法的聚类结果 图 4 改进后算法的聚类结果 图 5 两种算法的相似度变化曲线 图 6 聚类结果的实际位置 图 1 相邻对象选取方法示意图 图 2 实例数据点位置分布
聚类是数据挖掘中用来发现数据分布和隐含模式的一项重要技术 。作为一种常见的数据分析工具和无监督机器学习方法,聚类的目的是把数据集合分成若干类(或簇),使得每个类中的数据之间最大限度地相似,而不同类中的数据最大程度地不同。根据聚类算法所采用的基本思想,大致可以将它们分为五种 ,即划分聚类、层次聚类、基于密度的聚类、基于网格的聚类和基于模型的聚类。目前对聚类算法的研究正在不断深入,其中核聚类算法和谱聚类算法是近年来受到广泛关注的两种算法 。 核聚类方法的主要思想是通过一个非线性映射,将输入空间中的数据点映射到高维特征空间中,并选取合适的 Mercer 核函数代替非线性映射的内积,在特征空间中进行聚类。该方法是普适的,它比经典的聚类方法有较大的改进。它通过非线性映射增加了数据点线性可分的概率,即能较好地分辨、提取并放大有用的特征,从而实现更为准确的聚类,算法收敛速度也较快。在经典聚类算法失效的情况下,核聚类算法常常能得到较好的聚类 结果 。 支持向量聚类( Support Vector Clustering, SVC )属于核聚类的一种,它以支持向量机( Support Vector Machine, SVM )为工具进行聚类 。它是 Ben-Hur 等在基于高斯核的 SVDD ( Support Vector Domain Description )算法基础上进一步发展起来的无监督非参数型的聚类算法 。它的基本思想是:利用高斯核,将数据空间中的数据点映射到一个高维的特征空间中。再在特征空间中寻找一个能包围所有数据点象的半径最小的球,将这个球映回到数据空间,则得到了包含所有数据点的等值线集。这些等值线就是簇的边界。每一条闭合等值线包围的点属于同一个簇 。 SVC 算法主要分为两个阶段: SVC 训练阶段和聚类分配阶段。其中 SVC 训练阶段包括高斯核宽度系数的确定、核矩阵的计算、 Lagrange 乘子的计算、支持向量的选取和高维特征空间中特征球半径的计算。聚类分配阶段首先生成邻接矩阵,然后根据邻接矩阵进行聚类分配 。 SVC 算法具有两大显著优势:能产生任意形状的簇边界;能分析噪声数据点且能分离相互交叠的簇。这是许多聚类算法无法做到的。但 SVC 算法仍存在两个瓶颈: Lagrange 乘子的计算和邻接矩阵的计算。相对而言,后者需要消耗的计算时间远比前者多 。因此很多新的 SVC 算法都旨在提高邻接矩阵的计算效率 。 参考文献 Xu R, Wunsch D. Survey of Clustering Algorithms. IEEE Transaction on Neural Networks, 2005, 16(3): 645-678. Han J, Kamber M. Data Mining: Concepts and Techniques, Second Edition. Morgan Kaufmann, San Francisco , 2006. Filippone M, Camastra F, Masulli F, Rovetta S. A Survey of Kernel and Spectral Methods for Clustering. Pattern Recognition, 2008, 41(1): 176-190. 张莉,周伟达,焦李成 . 核聚类算法 . 计算机学报 , 2002, 25(6): 587-590. Burges C J C. A Tutorial on Support Vector Machines for Pattern Recognition. Data Mining and Knowledge Discovery, 1998, 2(2) : 121-167. Tax D M J, Duin R P W. Support Vector Domain Description. Pattern Recognition Letters, 1999, 20(11-13): 1191-1199. Ben-Hur A, Horn D, Siegelmann H T, Vapnik V. Support Vector Clustering. Journal of Machine Learning Research, 2001, 2(12): 125-137. Scholkopf B, Williamson R, Smola A, Shawe-Taylor J, Platt J. Support Vector Method for Novelty Detection. Advances in Neural Information Processing System 12. 2000: 582-588. 吕常魁,姜澄宇,王宁生 . 一种支持向量聚类的快速算法 . 华南理工大学学报 . 2005, 33(1): 6-9. Lee J, Lee D. An Improved Cluster Labeling Method for Support Vector Clustering. IEEE Transactions on Pattern Analysis and Machine Intelligence. 2005, 27(3): 461-464. Camastra F, Verri A. A Novel Kernel Method for Clustering. IEEE Transactions on Pattern Analysis and Machine Intelligence. 2005, 27(5):801-805.
随着对网络性质的物理意义和数学特性的深入研究,人们发现许多实际网络都具有一个共同性质,即社区结构。也就是说,整个网络是由若干个社区或组构成的。每个社区内部的结点间的连接相对非常紧密,但是各个社区之间的连接相对来说却比较稀疏 。揭示网络的社区结构,对于深入了解网络结构与分析网络特性是很重要的。如社会网络中的社区代表根据兴趣和背景而形成的真实的社会团体;引文网络中的社区代表针对同一主题的相关论文;万维网中的社区就是讨论相关主题的若干网站 ;而生物化学网络或者电子电路中的网络社区可以是某一类功能单元 。发现这些网络中的社区有助于我们更加有效的理解和开发这些网络。 在复杂网络社区结构划分的研究中,社区结构划分算法所要划分的网络大致可分为两类,一类是比较常见的网络,即仅包含正联系的网络(网络中边的权值为正实数);另一类是符号社会网络,即网络中既包含正向联系的边,也包含负向联系的边。因此划分网络中社区结构的算法相应分为两大类,而对于第一类网络又提出了许多不同的社区结构划分算法,划分第一类网络社区的传统算法可分为两大类,第一类是基于图论的算法,比如K-L算法 、谱平分法 、随机游走算法 和派系过滤算法 等;第二类是层次聚类算法,比如基于相似度度量的凝聚算法 和基于边介数度量的分裂算法 等。最近几年从其他不同的角度又提出了许多划分第一类网络社区结构的算法,大致可划分如下:基于电阻网络性质的算法 、基于信息论的算法 、基于PCA的算法 和最大化模块度 的算法 等。对于符号网络,Doreian和Mrvar提出了一种利用局部搜索划分符号网络社区结构的算法 ,且Bo Yang等提出一种基于代理的启发式划分符号网络社区结构的算法(FEC) 。 尽管复杂网络的社区发现问题得到了大量的研究,但还存在一些尚未解决的基本问题,如社区概念虽然大量使用,但却缺少严格的数学定义;大多数社区发现算法虽然性能优越,但所需计算量却很大。这说明复杂网络中社区发现的研究还需要付出大量的努力。 关于复杂网络社区发现问题更加系统深入的最新进展情况请看2009长篇综述文章 Community Detection in graphs by Santo Fortunato (arXiv:0906.0612) 参考文献 Girvan M, Newman M E J. Community structure in social and biological networks . PNAS, 2001, 99(12): 7821-7826. Newman M E J. Fast algorithm for detecting community structure in networks . Physical Review E, 2004, 69(6): 066133. Fell D A, Wagner A. The small world of metabolism . Nature(Biotechnology, 2000, (18): 1121-1122. Pool l, Kochen M. Contacts and Influence . Social Networks, 1978, (1): 1-48. Milgram S. The small world problem . Psychology Today, 1967, (2): 60-67. Kernighan B W, Lin S. An efficient heuristic procedure for portioning graphs . Bell System Technical Journal, 1970, 49: 291-307. Fiedler M. Algebraic connectivity of graphs . Czechoslovak Mathematical Journal, 1973, 23(98): 298-305. Pothen A, Simon H, Liou K P. Partitioning sparse matrices with eigenvectors of graphs . SIAM Journal on Matrix Analysis and Applications. 1990, 11(3): 430-452. P. Pons and M. Latapy. Computing Communities in Large Networks Using Random Walks . Computer and Information Sciences. 2005,284-293. G. Palla, I. Derenyi, I. Farkas et al. Uncovering the Overlapping Community Structure of Complex Networks in Nature and Society . Nature,2005 435(7043): 814-818. G. Palla, I. Farkas, P. Pollner, I. Derenyi et al. Directed network modules . Phys. New. J, 2007,186. Tyler J, Wilkinson D, Huberman B. Email as spectroscopy: Automated discovery of community structure within organizations . International Conference on Communities and Technologies, 2003, 81-96. F. Radicchi, C. Castellano, F. Cecconi et al. Defining and identifying communities in networks . Eur. Phys. J. B, 2004, 101: 2658-2663. Wu F, Huberman B A. Find communities in linear time: A physics approach . Euro. Phys. J B, 2003, 38: 331-338. Rosvall M, Bergstrom C T. An information-theoretic framework for resolving community structure in complex networks . PNAS, 2007, 104(18): 7327-7331. Chonghui Guo, Liang Zhang. An Analysis Method Based on PCA for the Community Structure in Complex Networks . Operations Research and Management Science, 2008, 17(6), 144-149. Newman M E J, Girvan M. Finding and evaluating community structure in networks . Physical Review E, 2004, 69 (2): 026113. Clauset A, Newman M E J, Moore C. Finding community structure in very large networks . Phys. Rev. E, 2004,70: 066111. Duch J, Arenas A. Community detection in complex networks using extreme optimization . Physical Review E,2005,72: 027104. R. Guimer and L. A. N. Amaral, Functional cartography of complex metabolic networks . Nature, 2005, 433: 895-900. A. Medus, G. Acua, and C. O. Dorso. Detection of community structures in networks via global optimization . Physica A, 2005, 358: 593-604. J. Reichardt and S. Bornholdt. Statistical Mechanics of Community Detection . Phys. Rev. E, 2006, 74: 016110. Newman M E J. Finding community structure in networks using the eigenvectors of matrices . Physical Review E, 2006, 74(3): 036104. P. Doreian and A. Mrvar. A Partitioning Approach to Structural Balance . Social Networks, 1996, 18(2): 149-168. Bo Yang, William K. Cheung, and Jiming Liu. Community Mining from Signed Social Networks . IEEE Transactions on Knowledge and Data Engineering. 2007, 19(10): 1333-1348.