# Patent

## Title
Distributed clustering with outlier detection

## Abstract

One or more processors initiate cluster feature (CF)-tree based hierarchical clustering on leaf entries of CF-trees included in a plurality of subsets. One or more processors, generate respective partial clustering solutions for the subsets. A partial clustering solution includes a set of regular sub-clusters and candidate outlier sub-clusters. One or more processors generate initial regular clusters by performing hierarchical clustering using the regular sub-clusters. For a candidate outlier sub-cluster, one or more processors determine a closest initial regular cluster, and a distance separating the candidate outlier sub-cluster and the closest initial regular cluster. One or more processors determine which candidate outlier sub-clusters are outlier clusters based on which candidate outlier sub-clusters have a computed distance to their respective closest initial regular cluster that is greater than a corresponding distance threshold associated with their respective closest initial regular cluster.

## Background
BACKGROUND OF THE INVENTION
The present invention relates generally to the field of data clustering, and more particularly to distributed data clustering.
Clustering techniques are widely used by retail and consumer product companies who need to learn more about their customers in order to apply 1-to-1 marketing strategy. By application of clustering techniques, customers are partitioned into groups by their buying habits, gender, age, income level etc. Retail and consumer product companies can then use the cluster information to tailor their marketing and product development strategy to each customer group.
Traditional clustering algorithms can broadly be classified into partitional clustering and hierarchical clustering. Partitional clustering algorithms divide data cases into clusters by optimizing certain criterion function. A well-known representative of this class is the k-means clustering. Hierarchical clustering algorithms proceed by stages that produce a sequence of partitions with each partition being nested into the next partition in the sequence. Notice that no initial values are needed for hierarchical clustering. Hierarchical clustering can be agglomerative and divisive. Agglomerative clustering starts with a singleton cluster (i.e. a cluster that contains one data case only) and proceeds by successively merging that cluster with other clusters. In contrast, divisive clustering starts with one single cluster that contains all data cases and proceeds by successively separating the cluster into smaller ones.
SUMMARY
Embodiments of the present invention provide a method, system, and program product for outlier detection. One or more processors initiate cluster feature (CF)-tree based hierarchical clustering on leaf entries of a plurality of CF-trees included in a plurality of subsets, wherein each CF-tree presents a respective set of local data as leaf entries. One or more processors generate respective partial clustering solutions for one or more subsets, included in the plurality of subsets, wherein clustering activity for a given CF-tree ceases when a threshold number of sub-clusters has been reached, and wherein a partial clustering solution includes a set of regular sub-clusters and candidate outlier sub-clusters that contain summaries of sets of data records. One or more processors generate initial regular clusters by performing hierarchical clustering using regular sub-clusters. For each candidate outlier sub-cluster of a plurality of candidate outlier sub-clusters, one or more processors determine a closest initial regular cluster, and a distance separating the respective candidate outlier sub-cluster and the respective closest initial regular cluster. One or more processors determine which candidate outlier sub-clusters are outlier clusters based, at least in part, on which candidate outlier sub-clusters have a computed distance to their respective closest initial regular cluster that is greater than a corresponding distance threshold associated with their respective closest initial regular cluster.



BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS
FIG. 1 is a functional block diagram illustrating a distributed computing environment, in accordance with an exemplary embodiment of the present invention.
FIG. 2 depicts a block diagram of respective components of the computing device(s) executing a mapper program, a reducer program and a controller program, in accordance with an exemplary embodiment of the present invention.
FIG. 3 illustrates operational processes of a method for adaptive variable selection, in accordance with an exemplary embodiment of the present invention.
FIG. 4 illustrates operational processes of a method for outlier determination, in accordance with an exemplary embodiment of the present invention.
FIG. 5 illustrates Table 6, which includes steps for adaptive feature selection, in accordance with an exemplary embodiment of the present invention.
FIG. 6 illustrates Table 7, which includes steps for identifying clusters from distributed data with high performance and accuracy, in accordance with an exemplary embodiment of the present invention.
FIG. 7 illustrates Table 8, which includes steps to extend outlier detection into the distributed setting, in accordance with an exemplary embodiment of the present invention.



DETAILED DESCRIPTION
Some embodiments of the present invention recognize one or more of the following: (i) a method that includes maximum likelihood or scatter separability criteria addresses the problem of determining clustering solutions for large datasets while minimizing computational expense; (ii) that an efficient wrapper approach of variable selection for clustering will reduce computational expense; (iii) that performing distributed data analysis in a parallel framework can distribute computational expense; (iv) that summarizing local data records through cluster feature (CF)-tree(s) can reduce computational expense; (v) that an assessment of variables by building approximate clustering solutions iteratively on the CF-trees can reduce computational expense; (vi) that computational expense can be minimized by utilizing only one data pass over the given data, which allows for an efficient building of clustering solutions on large and distributed data sources; (vii) that the stability of the clustering result is further ensured by application of an ensemble technique for final variable selection; (viii) that distributed data can be processed by application of repeated hierarchical clustering on leaf entries from multiple CF-trees; (ix) that only selected variables in the CF-trees are considered in each clustering iteration and that the selection is based on internally specified criteria; (x) that an element of the clustering algorithm is a distance measure that reflects the relative similarity or dissimilarity of the clusters; (xi) that a common distance measure is used in both the CF-tree growth and the clustering process; (xii) that wrapper methods can produce better clustering since the wrapper model aims to select variables that maximize the clustering solution quality; (xiii) that known wrapper model methods are very computationally expensive and many data passes are needed during the clustering process; (xiv) that the performance of known wrapper methods typically decreases when handling very large and distributed data sources, because building a clustering model on the whole data is computationally demanding; and (xv) that building multiple models iteratively further increases computational demand, which further increases computational expense for known wrapper methods (see (xiii) and (xiv) above).
Embodiments of the present invention perform a pre-clustering step by scanning the entire dataset and storing the dense regions of data cases in terms of summary statistics called cluster features. The cluster features are stored in memory in a data structure called a CF-tree. An agglomerative hierarchical clustering algorithm is applied to cluster the set of cluster features and generate candidate sets of variables. Since the set of cluster features is much smaller than the original dataset, the hierarchical clustering can perform well in terms of speed. Notice that the CF-tree is incremental in the sense that it does not require the whole dataset in advance and only scans the dataset once. A stable and robust set of variables is selected from the candidate sets of variables. The selected set of variables produces an overall quality clustering solution based on each variable's respective frequency of appearance among candidate sets of variables.
In addition, a set of candidate outlier sub-clusters are identified that have a computed distance greater than the corresponding distance threshold of the closest regular cluster. Outlier clusters are sorted according to outlier strength in descending order, and the minimum outlier strength is determined for the top percent of outliers. This minimum outlier strength is then used as an outlier threshold for scoring. The outlier threshold is used for detection of outlier records rather than sub-clusters. A new data pass is applied and outlier strength computed for each record using the same formula as for the outlier sub-cluster. The records with outlier strength above the computed threshold are the outlier records.
The following portion of Detailed Description is divided into the following subsections: (i) The Hardware and Software Environment; (ii) Example Embodiment; and (iii) Further Comments and/or Embodiments.
I. The Hardware and Software Environment
The present invention may be a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.
The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.
An embodiment of a possible hardware and software environment for software and/or methods according to the present invention will now be described in detail with reference to the Figures. FIG. 1 is a functional block diagram illustrating a distributed computing environment, generally designated 100, in accordance with one embodiment of the present invention. Distributed computing environment 100 includes computing device 110, 120, 130, 140, 150, 160 and 170 connected over network 180. Computing device 110, 120, 130, 140 respectively include mapper program 115. Computing device 110, 120, 130, 140 respectively include data 192, 194, 196 and 198. Computing device 150 and 160 both include reducer program 155, and respectively include CF-tree data 156 and 157. Computing device 170 includes controller program 175 and cluster analysis 176.
In various embodiments of the present invention, computing device 110, 120, 130, 140, 150, 160 and 170 are respectively a computing device that can be a standalone device, a server, a laptop computer, a tablet computer, a netbook computer, a personal computer (PC), or a desktop computer. In another embodiment, computing device 110, 120, 130, 140, 150, 160 and 170 respectively represent a computing system utilizing clustered computers and components to act as a single pool of seamless resources. In general, computing device 110, 120, 130, 140, 150, 160 and 170 can be any computing device or a combination of devices with access to mapper program 115, reducer program 155, controller program 175, CF-tree data 156 and 157, cluster analysis 176, and data 192, 194, 196 and 198 and is capable of executing mapper program 115, reducer program 155, and controller program 175. Computing device 110, 120, 130, 140, 150, 160 and 170 may include internal and external hardware components, as depicted and described in further detail with respect to FIG. 2.
In this exemplary embodiment, mapper program 115, reducer program 155, controller program 175, CF-tree data 156 and 157, cluster analysis 176, and data 192, 194, 196 and 198 are respectively stored on computing device 110, 120, 130, 140, 150, 160 and 170. However, in other embodiments, mapper program 115, reducer program 155, controller program 175, CF-tree data 156 and 157, cluster analysis 176, and data 192, 194, 196 and 198 may be stored externally and accessed through a communication network, such as network 180. Network 180 can be, for example, a local area network (LAN), a wide area network (WAN) such as the Internet, or a combination of the two, and may include wired, wireless, fiber optic or any other connection known in the art. In general, network 180 can be any combination of connections and protocols that will support communications between computing device 110, 120, 130, 140, 150, 160 and 170, and their respective programs and data, in accordance with a desired embodiment of the present invention.
In general, data 192, 194, 196 and 198, respectively include data that is generated by mapper program 115 or is received for processing by mapper program 115, such as data to be used to create CF-trees, in accordance with a desired embodiment of the present invention. Mapper program 115 is, in general, a mapping and clustering program (which may herein be referred to as a mapper) that accesses data 192, 194, 196 and 198, respectively and generates a subset of CF-trees, which is stored as part of CF-tree data 156 or 157, i.e., CF-tree data.
In general, CF-tree data 156 and 157 respectively include data that is generated by reducer program 155 or is received for processing by reducer program 155. This includes data that is stored as part of a CF-tree or its related files, in accordance with a desired embodiment of the present invention. Reducer program 155 is, in general, a reducer program (which may herein be referred to as a reducer) that generates a candidate set of variables and a set of sub-clusters, using CF-tree data, which correspond to the maximal goodness, which is locally optimal. In some embodiments, the output of each reducer task includes a set of candidate outliers.
In general, data included in cluster analysis 176 is data that is generated by controller program 175 or is received for processing by controller program 175, in accordance with a desired embodiment of the present invention. Controller program 175 is, in general, a control program (which may herein be referred to as a controller) that collects candidate sets of variables produced by each of the reducers, combines the collected sets of variables, and selects a stable and robust set of variables that produces an overall quality clustering solution based on each variable's respective frequency of appearance among candidate sets of variables produced by reducers. In some embodiments, controller program 175 utilizes sub-clusters and candidate outliers to generate an outlier threshold and outlier clusters, which can be sorted according to outlier strength. In such embodiments, the generated outlier threshold can be used for detection of outlier records rather than sub-clusters.
FIG. 2 depicts a block diagram, 200, of respective components of computing device(s) 110, 120, 130, 140, 150, 160 and 170, in accordance with an illustrative embodiment of the present invention. It should be appreciated that FIG. 2 provides only an illustration of one implementation and does not imply any limitations with regard to the environments in which different embodiments may be implemented. Many modifications to the depicted environment may be made.
Computing device 110, 120, 130, 140, 150, 160 and 170 respectively include communications fabric 202, which provides communications between respective computer processor(s) 204, memory 206, persistent storage 208, communications unit 210, and input/output (I/O) interface(s) 212. Communications fabric 202 can be implemented with any architecture designed for passing data and/or control information between processors (such as microprocessors, communications and network processors, etc.), system memory, peripheral devices, and any other hardware components within a system. For example, communications fabric 202 can be implemented with one or more buses.
Memory 206 and persistent storage 208 are computer-readable storage media. In this embodiment, memory 206 includes random access memory (RAM) 214 and cache memory 216. In general, memory 206 can include any suitable volatile or non-volatile computer-readable storage media.
Mapper program 115, reducer program 155, controller program 175, CF-tree data 156 and 157, cluster analysis 176, and data 192, 194, 196 and 198 are stored in persistent storage 208 for execution and/or access by one or more of the respective computer processors 204 via one or more memories of memory 206. In this embodiment, persistent storage 208 includes a magnetic hard disk drive. Alternatively, or in addition to a magnetic hard disk drive, persistent storage 208 can include a solid state hard drive, a semiconductor storage device, read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, or any other computer-readable storage media that is capable of storing program instructions or digital information.
The media used by persistent storage 208 may also be removable. For example, a removable hard drive may be used for persistent storage 208. Other examples include optical and magnetic disks, thumb drives, and smart cards that are inserted into a drive for transfer onto another computer-readable storage medium that is also part of persistent storage 208.
Communications unit 210, in these examples, provides for communications with other data processing systems or devices, including resources of network 180. In these examples, communications unit 210 includes one or more network interface cards. Communications unit 210 may provide communications through the use of either or both physical and wireless communications links. Mapper program 115, reducer program 155, controller program 175, CF-tree data 156 and 157, cluster analysis 176, and data 192, 194, 196 and 198 may be downloaded to persistent storage 208 through communications unit 210.
I/O interface(s) 212 allows for input and output of data with other devices that may be respectively connected to computing device 110, 120, 130, 140, 150, 160 and 170. For example, I/O interface 212 may provide a connection to external devices 218 such as a keyboard, keypad, a touch screen, and/or some other suitable input device. External devices 218 can also include portable computer-readable storage media such as, for example, thumb drives, portable optical or magnetic disks, and memory cards. Software and data used to practice embodiments of the present invention, e.g., mapper program 115, reducer program 155, controller program 175, CF-tree data 156 and 157, cluster analysis 176, and data 192, 194, 196 and 198, can be stored on such portable computer-readable storage media and can be loaded onto persistent storage 208 via I/O interface(s) 212. I/O interface(s) 212 also connect to a display 220.
Display 220 provides a mechanism to display data to a user and may be, for example, a computer monitor, or a television screen.
The programs described herein are identified based upon the application for which they are implemented in a specific embodiment of the invention. However, it should be appreciated that any particular program nomenclature herein is used merely for convenience, and thus the invention should not be limited to use solely in any specific application identified and/or implied by such nomenclature.
It is to be noted that the term(s) “Smalltalk” and the like may be subject to trademark rights in various jurisdictions throughout the world and are used here only in reference to the products or services properly denominated by the marks to the extent that such trademark rights may exist.
II. Example Embodiment
Overview: In this exemplary embodiment, a distributed data analysis is performed in a parallel framework. In contrast to constructing a global similarity matrix, local data records are summarized through CF-trees (Note: a CF-tree is a very compact summary of a dataset in the way that each entry in the leaf node is a sub-cluster which absorbs the data records that are close together). Exemplary embodiments build local CF-trees separately on different data sources, and use them to build approximate hierarchical clustering solutions, iteratively, on multiple computing machines. Further, variables are assessed during the building of the approximate hierarchical clustering solutions. In this way, exemplary embodiments need only one data pass over the given data to build clustering solutions efficiently on large and distributed data sources. This exemplary embodiment collects all the candidate sets of variables, produced by the multiple computing machines, and derives the final set of selected variables using an ensemble technique for final variable selection. In some cases using an ensemble technique for final variable selection further ensures stability of the clustering result.
Embodiments of the present invention recognize one or more of the following advantages: 1) local data sources are handled in parallel, which speeds up the process of reading data; 2) approximate clustering solutions are built on CF-trees, instead of individual records, which makes the iterative process of building clusters more efficient, and only one data pass is needed; 3) variables are selected effectively through approximate clustering solutions that are built in parallel, which ensures better clustering quality while leveraging available computing resources as much as possible; 4) the ensemble method provides a set of variables which endows a more robust clustering result, e.g., irrelevant, noise, or outlier variables can be removed more effectively; 5) generating an overall clustering solution for distributed data together with outlier selection; 6) generating a selection of candidate outliers and evaluating those candidate outliers against regular clusters (not outlier clusters) to yield a final set of actual outliers; and 7) both regular clusters and outliers are identified in a distributed setting based on the concept of outlier strength.
FIG. 3 illustrates a flowchart, 300, of a method of adaptive variable selection, based on operational processes of mapper program 115, reducer program 155, and controller program 175 respectively executing on computing devices 110, 120, 130, 140, 150, 160 and 170, within the environment of FIG. 1, in accordance with an exemplary embodiment of the present invention.
Under the map-reduce framework, mappers work on each data split (i.e. distributed data source) separately, and each mapper passes local data and builds a local CF-tree. In process 305, each mapper program 115, respectively executing on computing device 110, 120, 130, and 140, accesses its corresponding data, i.e., data 192, 194, 196 and 198. In general, data that is generated by mapper program 115 or is received for processing by mapper program 115 is stored as part of a data file, e.g., data 192, 194, 196 and 198, respectively.
Each mapper program 115, respectively builds local CF-trees using the accessed data, in process 310. A CF-tree is a height-balanced tree where each node contains a number of entries. Each entry of the CF-tree corresponds to a number of data records and contains CF (cluster feature) summary. Cluster features include the number of records, mean and variance of each continuous variable, and counts for each category of each categorical variable. Leaf entries (entries in the leaf nodes of the CF-tree) represent sub-clusters. The non-leaf nodes and their entries are used to guide a new record into a correct leaf node.
A sequential clustering approach is used to build the CF-tree. Mapper program 115 uses a sequential clustering approach to scan the records one by one and determine if the current record should be merged with the previously formed sub-clusters or if a new sub-cluster should be created based on a distance criterion. Mapper program 115 creates a new sub-cluster if the distance between the current record being processed and the previously formed sub-clusters exceeds a threshold. For example, the distance between the current record being processed and the previously formed sub-clusters exceeds a threshold. As a result, the current record is not merged with the previously formed sub-clusters. Instead a new sub-cluster is formed that includes the current record.
The output of each mapper is in the form of <key, value>, where the value is the built CF-tree and the key is a randomly assigned integer between 1 and the number of reducers, i.e., the number of instances of reducer program 155 that are used to process the generated CF-trees. The resulting subset of CF-trees with the same key is then passed to a respective reducer program 155, in process 315, and stored as part of CF-tree data 156 and 157 respectively. For example, computing device 110 and 120 send their respective resulting subset of CF-trees, with the same key, to computing device 150, which subsequently stores the received data as part of CF-tree data 156.
The number of reducers is determined according to a strategy of balancing accuracy and performance under the given computing resources. For example, in the case that there are a large number of data splits, one strategy is to assign the same key to as many CF-trees as can be handled efficiently by a single reducer. Otherwise, a unique key for each CF-tree is assigned such that there are enough sets of selected variables in the final ensemble. In exemplary embodiments, multiple reducers are employed to maximize the parallel calculations, and each reducer is responsible for a subset of CF-trees with the same key.
Each respective reducer program 155 performs a wrapper model method using the subset of CF-trees with the same key that are received from mapper program 115 (instead of individual data records). In this way, raw data is passed only once. Moreover, the wrapper model method can run more efficiently since CF-trees are relatively small. Embodiments of the present invention utilize a comprehensive method to remove the least important variables in the sequential backward variable selection.
The operational processes of reducer program 155 yield a comprehensive method involving iterative steps of building the hierarchical clustering solution, computing a goodness measure of the solution, calculating variable importance, and removing the least important variables. The same subset of CF-trees is used in every iteration and only the variables become different.
For each subset of CF-trees with the same key, the following processes, are performed:
In process 320, each reducer program 155 accesses its CF-tree data, e.g., CF-tree data 156 and 157, respectively and selects all variables used for generating the CF-trees and sets the goodness measure at the minimal possible value. In general, data that is generated by reducer program 155 or is received for processing by reducer program 155 is stored as part of a CF-tree or its related files, e.g., data included as part of CF-tree data 156 and 157, respectively.
In process 325, reducer program 155 performs hierarchical agglomerative clustering with selected variables on the leaf entries of the involved CF-trees to generate an approximate clustering solution. Hierarchical agglomerative clustering is an iterative process where the closest two sub-clusters are merged in each step.
In process 330, reducer program 155 computes a goodness measure for the approximate clustering solution. In decision process 335, reducer program 155 determines whether the goodness measure is improved. If the goodness measure is improved (decision process, 335, yes branch), then reducer program 155 computes variable importance for the set of selected variables, in process 340. Variable importance indicates how influential a variable is in building the clustering solution, and it can be defined by several approaches, for example using hypothesis tests, or considering the contribution of each variable to the information criteria, e.g. Bayesian Information Criterion (BIC) and Akaike Information Criterion (AIC). The latter approach is consistent with the criteria for automatically determining the number of clusters in the solution
In process 345, reducer program 155 discards the most unimportant variables, i.e., the variables with the lowest variable importance. Reducer program 155 returns to process 325. If the goodness measure is not improved (decision process, 335, no branch), then reducer program 155 proceeds to process 350.
In process 350, reducer program 155 selects the set of variables with the maximal goodness. In principle, the goodness measure of a clustering solution can be any measures used to determine goodness such as scatter separability, maximum likelihood, etc. In this embodiment, given that hierarchical clustering starts with leaf-entries, i.e. small sub-clusters, a new goodness measure is herein used and defined as the weighted average Silhouette coefficient over all starting sub-clusters. The average Silhouette coefficient ranges between −1 (indicating a very poor model) and +1 (indicating an excellent model). This measure avoids bias of variable selection criteria with respect to the number of variables.
In process 355, each respective reducer program 155 passes its output to controller program 175, which saves the output as part of cluster analysis 176. The output of each reducer includes a set of variables that corresponds to the maximal goodness, which is locally optimal. In general, data that is generated by controller program 175 or is received for processing by controller program 175 is stored as part of a cluster analysis, e.g., data included in cluster analysis 176.
In the previous exemplary embodiment, in the processes of sequential backward variable selection, the most unimportant variable is removed iteratively until the clustering quality is decreased. However, if the number of clusters is determined automatically, then a more aggressive strategy can be used to remove unimportant variables. This assumes that variables with a smaller number of optimal clusters would be less important. This strategy takes into account the need for finding the number of clusters in conjunction with variable selection.
As such, in certain embodiments, the number of clusters is determined automatically. To clarify for understanding, the following scenario will be used: suppose there are J* final clusters. In such embodiments, processes 325, 330 and 345 are repeated to discard the most unimportant variables until the optimal number of clusters is determined by the remaining variables being less than J*.
Controller program 175 collects candidate sets of variables produced by each of the reducers, i.e., the instances of reducer program 155, in process 360. Several methods can be utilized by Controller program 175 to combine the collected sets of variables. For example, one such method selects the set of variables with the maximum goodness value. However, this method remains unstable in terms of the overall clustering solution quality.
In this exemplary embodiment, in process 365, controller program 175 selects a stable and robust set of variables that produces an overall quality clustering solution based on each variable's respective frequency of appearance among candidate sets of variables produced by the reducers. For example, controller program 175 discards any variables with frequency of occurrence among the candidate variable sets less than a threshold, e.g., 50%. This approach effectively removes irrelevant or noise variables since it is not possible for such variables to appear frequently under the given framework.
This ensemble-based approach is also scalable and efficient since it allows parallel computation in reducers that perform the computationally demanding tasks of selecting the candidate sets of variables based on the local CF-trees and hierarchical clustering.
FIG. 4 illustrates a flowchart, 400, illustrating a method of outlier determination, based on operational processes of mapper program 115, reducer program 155, and controller program 175 respectively executing on computing devices 110, 120, 130, 140, 150, 160 and 170, within the environment of FIG. 1, in accordance with an exemplary embodiment of the present invention.
In contrast to the clustering described in the discussion of FIG. 3, in FIG. 4 a partial clustering is performed by the respective processes of mapper program 115 and reducer program 155. To generate a partial clustering solution mapper program 115 and reducer program 155 stop the clustering process when the number of sub-clusters reaches a given threshold. The resulting sub-clusters are then joined with resulting sub-clusters from other reducer tasks and the process of hierarchical clustering continues producing the overall clustering solution. Partial clustering is applied when collecting partial clustering results from reducers into the controller to generate an overall solution. However, it could, in some cases, also be applied to adaptive feature selection, described in the discussion of FIG. 3, within each reducer, but usually each reducer there would be capable of generating its solution as a single task without requiring partial clustering.
In FIG. 4, in addition to the processing described in FIG. 3, which is hereafter modified for partial clustering, the following processes are performed, for each reducer task corresponding to a single key, to identify outliers:
In process 405, reducer program 155 collects all CF-trees and outliers with the same key under consideration.
In process 410, reducer program 155 merges candidate outliers into CF Trees, if possible. Reducer program 155 merges each candidate outlier with the closest regular leaf entry. Such a merging is only deemed possible if the merging does not break the maximal tightness threshold among the involved CF-trees. The closest regular leaf entry is determined by passing the CF-trees. In processes 415, 420 and 422 reducer program 155 performs CF-tree based hierarchical clustering on the leaf entries, and generates a number of sub-clusters specified by the threshold.
In process 415, reducer program 155 uses CF-trees to find pairs of closest leaf entries. While this process is applied to multiple CF-trees, not all pairs of leaves are compared.
To find the closest pair of CF tree leaf entries, reducer program 155 passes the involved CF-trees separately from their root node, and each of them provides a candidate closest leaf entry. Then, the true closest leaf entry is selected from the candidates. Such an approach is used in place of a comparison of all pairs of leaf entries, thus yielding only a few comparisons per CF-tree. An ordering of CF-trees further reduces the number of comparisons. As such, for a given leaf entry in the current CF-tree, only the current and subsequent CF-trees are searched for closest leaf entries.
In step 420, once the closest pair of leaf entries is chosen, reducer program 155 updates the leaf entry that belongs to the first CF-tree, i.e., merges the leaf entries. If the leaf entries in the pair belong to the same CF-tree, then the one with larger size is updated. The updated leaf entry accounts for all data cases in the former pair of entries while the other leaf entry is discarded. Thus, the number of leaf entries is reduced by one at each clustering step. Meanwhile, the involved CF-trees are updated accordingly to reflect the merging. In general, processes 415 and 420 are repeated until a threshold number of leaf entries is reached, and returns the set of updated CF-trees, whose leaf entries indicate the produced sub-clusters.
In decision process 422, reducer program 155 determines if the threshold number of leaf entries has been reached. If the threshold number of leaf entries has been reached (decision process 422, YES branch), then reducer program 155 proceeds to process 425. If the threshold number of leaf entries has not been reached (decision process 422, NO branch), then reducer program 155 proceeds to process 415.
The output of each reducer task consists of the set of sub-clusters and candidate outliers. If the number of original reducer tasks is very large, then the output can become overwhelming for the final clustering operation in the controller. In such a case, multiple tasks may be processed by a single reducer and the joined results from the original tasks further reduced by another round of partial hierarchical clustering before sending the output to the controller.
In process 425, reducer program 155 passes the sub-clusters and remaining candidate outliers to the controller, i.e., controller program 175.
In process 430, controller program 175 collects all the sets of regular sub-clusters and candidate outliers produced by reducers. Notice that outliers here actually contain summaries of sets of data records and are therefore sub-clusters. In previous sections, the term sub-clusters referred to regular sub-clusters, but in this section, regular sub-clusters will be distinguished from outlier sub-clusters.
In process 435, controller program 175 executes a standard hierarchical clustering starting with regular sub-clusters to generate initial regular clusters. The number of regular clusters can be determined automatically or by using a fixed number depending on the embodiment.
In processes 445 and beyond, controller program 175 determines a measure of outlier strength for candidate outlier sub-clusters. The outlier strength is defined for an outlier sub-cluster (s) as the expected ratio of its distance from a regular cluster (j) to the distance threshold of the cluster (j), that is:




  
    O
    ⁡
    
      (
      s
      )
    
  
  =
  
    
      ∑
      
        j
        =
        1
      
      J
    
    ⁢
    
      
    
    ⁢
    
      
        
          d
          ⁡
          
            (
            
              j
              ,
              s
            
            )
          
        
        
          
            D
            t
          
          ⁡
          
            (
            j
            )
          
        
      
      ⁢
      
        p
        ⁡
        
          (
          
            j
            |
            s
          
          )
        
      
    
  




Where J is the number of regular clusters, d(j,s) is the distance from a regular cluster j to the center of the sub-cluster s and Dt(j) is the distance threshold of regular cluster j. Since only the cluster features of sub-clusters, rather than original data records are available in the controller, the distance threshold Dt(j) is estimated as the maximum distance from cluster j to each center of the corresponding starting sub-clusters in the hierarchical clustering.
The probability of sub-cluster s belonging to cluster j, p(j|s), is defined as:




  
    p
    ⁡
    
      (
      
        j
        |
        s
      
      )
    
  
  =
  
    
      exp
      ⁡
      
        (
        
          -
          
            d
            ⁡
            
              (
              
                j
                ,
                s
              
              )
            
          
        
        )
      
    
    
      
        ∑
        
          j
          =
          1
        
        J
      
      ⁢
      
        
      
      ⁢
      
        exp
        ⁡
        
          (
          
            -
            
              d
              ⁡
              
                (
                
                  j
                  ,
                  s
                
                )
              
            
          
          )
        
      
    
  




In process 445, controller program 175 computes the distance from the closest regular cluster for each remaining candidate outlier sub-cluster.
In process 450, controller program 175 determines which candidate outlier sub-clusters are outlier clusters. Controller program 175 bases this determination on which candidate outlier sub-clusters have a computed distance greater than the corresponding distance threshold of the closest regular cluster. For example, if candidate outlier sub-cluster (A) has a computed distance greater than the corresponding distance threshold of the closest regular cluster, then controller program 175 determines that candidate outlier sub-cluster (A) is an outlier cluster.
In process 455, controller program 175 merges the rest of candidate outlier sub-clusters with the corresponding closest regular clusters and updates the distance threshold for each regular cluster.
In process 460, for each remaining outlier cluster, controller program 175 computes its outlier strength.
In process 465, controller program 175 sorts remaining outlier clusters according to outlier strength, in descending order, and determines the minimum outlier strength for the top P (e.g., default 5%) percent of outliers. The minimum outlier strength can be used as an outlier threshold for scoring purposes.
In process 470, controller program 175 generates a specified number of the most extreme outlier clusters (e.g., default 20), along with the following measures for each cluster: cluster size, outlier strength, probabilities of belonging to each regular cluster, etc. The specified number of the most extreme outlier clusters along with the sorted remaining outlier clusters and the minimum outlier strength are all saved as part of cluster analysis 176.
In certain embodiments, the outlier threshold obtained in process 465 is used for detection of outlier records rather than sub-clusters. In such embodiments, a new data pass is applied and outlier strength is computed for each record using the same formula as for the outlier sub-cluster. The records with outlier strength above the computed threshold are the outlier records.
III. Further Comments and Embodiments
Various embodiments and comments, in accordance with the present invention, are disclosed herein. These embodiments and comments are provided for purposes of illustration only, and are not intended to limit the scope of the invention. Those skilled in the art will readily appreciate that the present invention may be implemented in various forms, and that modifications, additions, and substitutions are possible without departing from the spirit and scope of the invention as set forth in the appended claims.
In the following portion of this document, the two-step clustering method is extended into the distributed setting, specifically under the map-reduce framework. In addition to generating a clustering solution, mechanisms for selecting the most relevant features for clustering given data are provided, as well as detecting rare outlier points. Moreover, an enhanced set of evaluation and diagnostic features enabling insight, interactivity, and an improved overall user experience are provided.
Some embodiments of the present invention may include one, or more, of the following assumptions: 1) to create CF-trees efficiently, assume that operations within a main memory environment (e.g. RAM) is efficient, and the size of the main memory can be allocated or controlled by a user, and 2) assume that the data is randomly partitioned. (Note: If this assumption is not allowed, sequential partition can still be applied. But notice that the clustering result would be possibly impacted, particularly if the data is ordered in some special way.)
Notations:
The following table of notations, included in TABLE 1, are used throughout the document unless otherwise stated:








TABLE 1







R
Number of data partitions/splits.


Nj
Number of cases in cluster Cj.


Njk
Number of cases in cluster Cj which have non-



missing values in the kth feature.


K
Number of features used for clustering.


xi = (xi1, . . . , xiK)
The ith data case. xi is a K-dimensional vector.


xikA, k = 1, . . . , KA
Value of the kth continuous feature of the ith data 



case xi. There are KA number of continuous features.


xikB, k = 1, . . . , KB
Value of the kth categorical feature of the ith data 



case xi. There are KB number of categorical features.


Lk, k = 1, . . . , KB
Number of categories of the kth categorical feature 



in the entire data.


Njkl, k = 1, . . . , KB, l =
Number of cases in cluster Cj whose kth categorical 


1, . . . , Lk
feature takes the lth category.


sjk, k = 1, . . . , KA
Sum of values of the kth continuous feature in 



cluster Cj.


sjk2, k = 1, . . . , KA
Sum of squared values of the kth continuous feature 



in cluster Cj.


d(j, s)
Distance between clusters Cj and Cs.


C<j,s>
Cluster formed by combining clusters Cj and Cs.









Data Pre-processing:

In some cases, data pre-processing includes one or more of the following transformations: a) Trailing blanks are trimmed b) Date/time features are transformed into continuous ones, c) normalization of continuous features, d) category values of a categorical feature are mapped into integers. (As such, the expression “xikB=l” indicates that the kth categorical feature of the ith case takes the lth category), e) system/user missing and invalid values are all considered as missing, and f) cases with missing values in all features are discarded.
Data and Measures:
Let xi be the ith data case. Denote Ij as the index set of cluster Cj,Ij={i:xiεCj}. Let K=KA+KB be the total number of features in which KA of them are continuous and KB are categorical. Without loss of generality, write xi as given by equation (1) as follows:

xi=(xi1, . . . ,xiK)=(xi1A, . . . ,xiKA,xi1B, . . . ,xiKBB)

Where xikA is the value of the kth continuous feature, k=1, . . . , KA, and xikB is the value of the kth categorical feature, k=1, . . . , KB. Express xikB as a vector (xik1B, . . . , xikLkB) of Lk values in which each entry is either zero or one, e.g., as given by equation (2) as follows:




  
    x
    ikl
    B
  
  =
  
    {
    
      
        
          
            1
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            
              x
              ik
              B
            
            ⁢
            
              
            
            ⁢
            takes
            ⁢
            
              
            
            ⁢
            the
            ⁢
            
              
            
            ⁢
            lth
            ⁢
            
              
            
            ⁢
            category
          
        
      
      
        
          
            0
            ,
          
        
        
          otherwise
        
      
    
  




Cluster Feature of a Cluster:

The cluster feature (sufficient statistics set) CFj of a cluster Cj is a collection of statistics that summarizes the characteristics of a cluster. A possible set CFj is given by equation (3) as follows:

CFj={Nj,{right arrow over (N)}j,sj,sj2,NjB}

Where Nj is the number of data cases in cluster:

Cj,{right arrow over (N)}j=(Njk, . . . ,NjKA,Nj1′, . . . ,NjKB′)

is a K-dimensional vector; the kth entry is the number of data cases in cluster Cj which have non-missing values in the kth feature. sj=(sj1, . . . ,sjKA) is a KA-dimensional vector; the kth entry is the sum of the non-missing values of the kth continuous feature in cluster Cj, e.g., as given by equation (4) as follows:

sjk=ΣiεIjxikA 

For k=1, . . . , KA. Similarly, sj2=(sj12, . . . ,sjKA2) is a KA-dimensional vector such that the kth entry is the sum of squared non-missing values of the kth continuous feature in cluster Cj, e.g., as given by equation (5) as follows:

sjk2=ΣiεIj(xikA)2 

    
    
        for k=1, . . . , KA 
    
    


Similarly, NjB=(Nj1B, . . . ,NjKB B) is a Σk=1KB(Lk−1)-dimensional vector where the kth sub-vector NjkB is (Lk−1) dimensional, e.g., as given by equation (6) as follows:

NjkB=(Njk1, . . . ,Njk(Lk−1))

For k=1, . . . , KB. The lth entry Njkl represents the total number of cases in cluster Cj whose kth categorical feature takes the lth category, l=1, . . . , Lk−1, e.g., as given by equation (7) as follows:

Njkl=ΣiεIjxiklB.

Updating Cluster Feature when Merging Two Clusters:

When two clusters Cj and Cs are said to merge, it simply means that the two corresponding sets of data points are merged together to form a union. In this case, the CF<j,s> for the merged cluster C<j,s> can be calculated by simply adding the corresponding elements in CFj and CFs, e.g., as given by equation (8) as follows:

CF<j,s>={Nj+Ns,{right arrow over (N)}j+{right arrow over (N)}s,sj+ss,sj2+ss2,NjB+NsB}

Tightness of a Cluster:

The interpretation of tightness of a cluster is that the smaller the value of tightness, the less variation of the data cases within the cluster. There are two tightness measures, and they will be used depending on the specified distance measure, log-likelihood distance or Euclidean distance.
Tightness Based on Log-Likelihood Distance:
The tightness {tilde over (η)}j of a cluster Cj can be defined as average negative log-likelihood function of the cluster evaluated at the maximum likelihood estimates of the model parameters, e.g., a tightness {tilde over (η)}j of a cluster Cj is given by equation (9) as follows:




  
    
      η
      ^
    
    j
  
  =
  
    
      
        1
        2
      
      ⁢
      
        
          ∑
          
            k
            =
            1
          
          
            K
            A
          
        
        ⁢
        
          ln
          (
          
            1
            +
            
              
                
                  σ
                  ^
                
                jk
                2
              
              
                Δ
                ⁢
                
                  
                
                ⁢
                k
              
            
          
          )
        
      
    
    +
    
      
        ∑
        
          k
          =
          1
        
        
          K
          B
        
      
      ⁢
      
        
          E
          ^
        
        jk
      
    
  




Where {circumflex over (σ)}jk2 is the maximum likelihood variance estimate of the kth continuous feature in cluster Cj and is given by equation (10) as follows:




  
    
      σ
      ^
    
    jk
    2
  
  =
  
    
      
        s
        jk
        2
      
      -
      
        
          
            N
            jk
          
          ⁡
          
            (
            
              
                μ
                ^
              
              jk
            
            )
          
        
        2
      
    
    
      N
      jk
    
  




In which {circumflex over (μ)}jk is the sample mean, as given by equation (11) as follows:




  
    
      μ
      ^
    
    jk
  
  =
  
    
      s
      jk
    
    
      N
      jk
    
  




Êjk is the entropy of the kth categorical feature in cluster Cj, as given by equation (12) as follows:

Êjk=−Σl=1Lk{circumflex over (q)}jkl ln {circumflex over (q)}jkl 

In which {circumflex over (q)}jkl is the portion of data cases in cluster Cj whose kth categorical feature takes the lth category, as is given by equation (13) as follows:




  
    
      q
      ^
    
    jkl
  
  =
  
    
      N
      jkl
    
    
      N
      jk
      ′
    
  




Finally, Δk is appositive scalar which is added to handle the degenerating conditions and balance the contributions between a continuous feature and a categorical one. The default value of Δk is 1⁄6. To handle missing values, the definition of tightness assumes that the distribution of missing values is the same as for the observed non-missing points in the cluster. Moreover, the following assumption, given by equation (14) as follows, is always applied:

xln(x)=0,if x=0  (equation 14)

Tightness Based on Euclidean Distance:

The tightness {tilde over (η)}j of a cluster Cj can be defined as the average Euclidean distance from member cases to the center/centroid of the cluster. A tightness {tilde over (η)}j of a cluster Cj is given by equation (15) as follows:




  
    
      η
      ~
    
    j
  
  =
  
    
      
        ∑
        
          k
          =
          1
        
        K
      
      ⁢
      
        
          
            s
            jk
            2
          
          -
          
            
              
                N
                jk
              
              ⁡
              
                (
                
                  
                    μ
                    ^
                  
                  jk
                
                )
              
            
            2
          
        
        
          N
          jk
        
      
    
  




Notice that if any feature in cluster Cj has all missing values, the feature will not be used in the computation.
Distance Measures Between Two Clusters:
Suppose clusters Cj and Cs are merged to form a new cluster C<j,s> that consists of the union of all data cases in Cj and Cs. Two distance measures are available.
Log-Likelihood Distance:
The distance between Cj and Cs can be captured by observing the corresponding decrease in log-likelihood as the result of combining Cj and Cs to form C<j,s>. The distance measure, d(j,s), between two clusters Cj and Cs is given by equation (16) as follows:

d(j,s)=Σk=1KA+KBdk(j,s)={tilde over (ξ)}j+{tilde over (ξ)}s−{tilde over (ξ)}<j,s>

Where equation (17) is as follows:




  
    
      ξ
      ~
    
    j
  
  =
  
    
      
        -
        
          1
          2
        
      
      ⁢
      
        
          ∑
          
            k
            =
            1
          
          
            K
            A
          
        
        ⁢
        
          
            N
            jk
          
          ⁢
          
            ln
            ⁡
            
              (
              
                
                  
                    σ
                    ^
                  
                  jk
                  2
                
                +
                
                  Δ
                  k
                
              
              )
            
          
        
      
    
    -
    
      
        ∑
        
          k
          =
          1
        
        
          K
          B
        
      
      ⁢
      
        
          N
          jk
          ′
        
        ⁢
        
          
            E
            ^
          
          jk
        
      
    
  




and equation (18) is as follows:




  
    
      d
      k
    
    ⁡
    
      (
      
        j
        ,
        s
      
      )
    
  
  =
  
    {
    
      
        
          
            
              
                {
                
                  
                    
                      
                        
                          
                            -
                            
                              N
                              jk
                            
                          
                          ⁢
                          
                            ln
                            ⁡
                            
                              (
                              
                                
                                  
                                    σ
                                    ^
                                  
                                  jk
                                  2
                                
                                +
                                
                                  Δ
                                  k
                                
                              
                              )
                            
                          
                        
                        -
                        
                          
                            N
                            sk
                          
                          ⁢
                          
                            ln
                            ⁡
                            
                              (
                              
                                
                                  
                                    σ
                                    ^
                                  
                                  sk
                                  2
                                
                                +
                                
                                  Δ
                                  k
                                
                              
                              )
                            
                          
                        
                        +
                      
                    
                  
                  
                    
                      
                        
                          N
                          
                            
                              〈
                              
                                j
                                ,
                                s
                              
                              〉
                            
                            ⁢
                            k
                          
                        
                        ⁢
                        
                          ln
                          ⁡
                          
                            (
                            
                              
                                
                                  σ
                                  ^
                                
                                
                                  
                                    〈
                                    
                                      j
                                      ,
                                      s
                                    
                                    〉
                                  
                                  ⁢
                                  k
                                
                              
                              +
                              
                                Δ
                                k
                              
                            
                            )
                          
                        
                      
                    
                  
                
                }
              
              /
              2
            
            ,
          
        
        
          
            
              
                
                  if
                  ⁢
                  
                    
                  
                  ⁢
                  feature
                  ⁢
                  
                    
                  
                  ⁢
                  k
                
              
            
            
              
                
                  is
                  ⁢
                  
                    
                  
                  ⁢
                  continuous
                
              
            
          
        
      
      
        
          
            
              
                
                  -
                  
                    N
                    jk
                    ′
                  
                
                ⁢
                
                  
                    E
                    ^
                  
                  jk
                
              
              -
              
                
                  N
                  sk
                  ′
                
                ⁢
                
                  
                    E
                    ^
                  
                  sk
                
              
              +
              
                
                  N
                  
                    
                      〈
                      
                        j
                        ,
                        s
                      
                      〉
                    
                    ⁢
                    k
                  
                  ′
                
                ⁢
                
                  
                    E
                    ^
                  
                  
                    
                      〈
                      
                        j
                        ,
                        s
                      
                      〉
                    
                    ⁢
                    k
                  
                
              
            
            ,
          
        
        
          
            
              
                
                  
                    if
                    ⁢
                    
                      
                    
                    ⁢
                    feature
                    ⁢
                    
                      
                    
                    ⁢
                    k
                  
                
              
              
                
                  
                    is
                    ⁢
                    
                      
                    
                    ⁢
                    categorical
                  
                
              
            
            ⁢
            
              
            
          
        
      
    
  




Note that since {tilde over (ξ)}<j,s> can be calculated by using the statistics in CF<j,s>, the distance can be calculated by first updating the CF<j,s> of the merged cluster C<j,s>. To handle missing values, the definition of distance assumes that the contribution of missing values equals zero.
The Euclidean distance can only be applied if all features are continuous. The distance between two cases is clearly defined. The distance between two clusters is here defined by the Euclidean distance between the two cluster centers. A cluster center is defined as the vector of cluster means of each feature. If the centers/centroids of clusters Cj and Cs are ({circumflex over (μ)}j1, . . . , {circumflex over (μ)}jK) and ({circumflex over (μ)}s1, . . . , {circumflex over (μ)}sK) respectively, then equation (19) gives d(j,s) as:

d(j,s)=√{square root over (Σk=1Kdk2(j,s))}=√{square root over (Σk=1K({circumflex over (μ)}jk−{circumflex over (μ)}sK)2)}

Where dk(j,s) is defined by equation 20 as:

dk(j,s)=|{circumflex over (μ)}jk−{circumflex over (μ)}sk|

Again, any feature in cluster Cj with all missing values will not be used in the computation.
CF-Tree Building:
A CF-tree is a very compact summary of dataset in the way that each entry (leaf entry) in the leaf node is a sub-cluster, which absorbs the data cases that are close together, as measured by the tightness index {tilde over (η)} and controlled by a specific threshold value T. The CF-tree is built dynamically as new data case is inserted, it is used to guide to a new insertion into the correct sub-cluster for clustering purpose. The CF-tree is a height-balanced tree with four parameters: 1) the branching factor B for the non-leaf nodes, (The branching factor B is the maximum number of entries that a non-leaf node can hold. A non-leaf entry is of the form [CFi, childi], i=1, . . . , B, in which childi is a pointer to its ith child node and CFi is the cluster feature of the sub-cluster represented by this child.); 2) the branching factor L for the leaf nodes, (The branching factor L is the maximum number of entries that a leaf node can hold. A leaf entry is similar to a non-leaf entry except that is does not have a pointer. It is of the form [CFi], i=1, . . . , L); 3) The threshold parameter T that controls the tightness 1) of any leaf entries, (That is, all leaf entries in a leaf node must satisfy a threshold requirement that the tightness has to be less than T, i.e. {tilde over (η)}≦T); and 4) Maximum tree height H. In addition, each leaf node has two pointers: “prev” and “next” which are used to chain all leaf nodes together for efficient scanning
Inserting a Single Case or a Sub-Cluster into a CF-Tree:
The procedure for inserting a data case or a sub-cluster (abbrev. “Ent”) into a CF-tree is as follows:
Identify the appropriate leaf node. Starting from the root node, recursively descend the CF-tree by choosing the closest child node according to the distance measure d.
Modify the leaf node. Upon reaching a leaf node, find the closest leaf entry [CFi], say, and see if Ent can be absorbed into [CFi] without violating the threshold requirement {circumflex over (η)}≦T. If so, update the CF information in [CFi] to reflect the absorbing action. If not, add a new entry for Ent to the leaf. If there is space on the leaf for this new entry to fit in, then the modification is completed upon entry of Ent to the leaf. Otherwise, split the leaf node by choosing the farthest pair of entries as seeds, and redistribute the remaining entries based on the closest criteria.
Modify the path to the leaf node. After inserting Ent into a leaf node, update the CF information for each non-leaf entry on the path to the leaf node. If there is no leaf split, then only the corresponding CF information is needed to update to reflect the absorbing of Ent. If a leaf split happens, then it is necessary to insert a new non-leaf entry into the parent node in order to describe the newly created leaf. If the parent has space for this entry, at all higher levels, only the CF information is needed to update to reflect the absorbing of Ent. In general, however, the parent node has to split as well, and so on up to the root node. If the root node is split, the tree height increases by one.
Notice that the growth of CF-tree is sensitive to case order. If the same data case is inserted twice but at different time, the two copies might be entered into two distinct leaf entries. It is possible that two sub-clusters that should be in one cluster are split across nodes. Similarly, it is also possible that two sub-clusters that should not be in one cluster are kept together in the same node.
Threshold Heuristic:
In building the CF-tree, the algorithm starts with an initial threshold value (default is 0). Then the algorithm scans the data cases and inserts into the tree. If the main memory runs out before data scanning is finished, then the threshold value is increased to rebuild a new smaller CF-tree, by re-inserting the leaf entries of the old tree into the new one. After the old leaf entries have been re-inserted, data scanning is resumed from the case at which it was interrupted. The following strategy is used to update the threshold values.
Suppose that at step i, the CF-tree of the threshold Ti is too big for the main memory after Ni data cases in the data have been scanned, an estimate of the next (larger) threshold Ti+1 is needed to rebuild a new smaller CF-tree. In certain embodiments, the next threshold Ti+1 is estimated so that Ni+1=min(2Ni,N), where N is the total number of data cases in the data. That is, whether N is known, estimate the next threshold Ti+1 at most in proportion to the data that have been scanned so far.
A very simple way to estimate Ti+1 is to use equation 21 as follows:




  
    
      T
      ^
    
    
      i
      +
      1
    
  
  =
  
    
      
        N
        
          i
          +
          1
        
      
      
        N
        i
      
    
    ⁢
    
      T
      
        i
        ⁢
        
          
        
      
    
  




Another way to estimate Ti+1 is to take the next threshold value Ti+1 such that it is at least greater than the tightness {tilde over (η)} of the union of the two closest entries in the tree. However, searching the closest entries can be tedious. Utilizing a heuristic, e.g., BIRCH's heuristic, traverse along a path from the root to the most crowded leaf that has the most entries and find the pair of leaf entries that is closest. Let {tilde over (η)}min be the tightness of the union of the closest pair.
Combine the above arguments together, and determine Ti+1 as follows in equation 22:




  
    T
    
      i
      +
      1
    
  
  =
  
    {
    
      
        
          
            
              
                η
                ~
              
              min
            
            ,
          
        
        
          
            
              if
              ⁢
              
                
              
              ⁢
              
                
                  η
                  ~
                
                min
              
            
            >
            
              T
              i
            
          
        
      
      
        
          
            
              
                T
                ^
              
              
                i
                +
                1
              
            
            ,
          
        
        
          otherwise
        
      
    
  




Rebuilding CF-Tree:

When the CF-tree size exceeds the size of the main memory, or the CF-tree height is larger than H, the CF-tree is rebuilt to a smaller one by increasing the tightness threshold. Assume that within each node of CF-tree ti, the entries are labeled contiguously from 0 to nk−1, where nk is the number of entries in that node. A path from an entry in the root (level 1) to a leaf node (level h) is uniquely represented by (i1, i2, . . . , ih−1), where ij, j=1, h−1, is the label of the jth level entry on that path. So naturally, path (i1(1), i2(1), . . . , ih−1(1)) is before (or <) path (i1(2), i2(2), . . . , ih−1(2)) if i1(1)=i1(2), . . . , ij−1(2), and ij(1)<=ij(2) for 0≦j≦h−1. It can thus be seen that each leaf node corresponds to a path, since this is a tree structure, the terms “path” and “leaf node” will be used interchangeably hereafter.
With the natural path order defined above, the algorithm scans and frees the old tree, path by path, and at the same time, creates the new tree path by path. The procedure is as follows:
Let the new tree start with NULL and OldCurrentPath be initially the leftmost path in the old tree.
Create the corresponding NewCurrentPath in the new tree: Copy the nodes along OldCurrentPath in the old tree into the new tree as the (current) rightmost path; call this NewCurrentPath.
Insert leaf entries in OldCurrentPath to the new tree: With the new threshold, each leaf entry in OldCurrentPath is tested against the new tree to see if it can either by absorbed by an existing leaf entry, or fit in as a new leaf entry without splitting, in the NewClosestPath that is found top-down with the closest criteria in the new tree. If yes and NewClosestPath is before NewCurrentPath, then it is inserted to NewClosestPath, and deleted from the leaf node in NewCurrentPath.
Free space in OldCurrentPath and NewCurrentPath: Once all leaf entries in OldCurrentPath are processed, the nodes along OldCurrentPath can be deleted from the old tree. It is also likely that some nodes along NewCurrentPath are empty because leaf entries that originally corresponded to this path have been “pushed forward”. In this case, the empty nodes can be deleted from the new tree.
Process the next path in the old tree: OldCurrentPath is set to the next path in the old tree if there still exists one, and go to step 2.
Delayed-Split Option: If the CF-tree resulted by inserting a data case is too big for the main memory, it may be possible that some other data cases in the data can still fit in the current CF-tree without causing a split on any node in the CF-tree (thus the size of the current tree remains the same and can still be in the main memory). Similarly if the CF-tree resulted by inserting a data case exceeds the maximum height, it may be possible that some other data cases in the data can still fit in the current CF-tree without increasing the tree height.
Once either of the two conditions occur, such cases are written out to disk (with S1 amount of disk space put aside for this purpose) and data scanning continues until the disk space runs out as well. The advantage of this approach is that more data cases can fit into the tree before a new tree is rebuilt.
Outlier-Handling Option:
Outlier is defined as leaf entry (sub-cluster) of low density, which contains less than Nmin (default 10) cases. Similar to the delayed-split option, some disk space S2 is allocated for handling outliers. When the current CF-tree is too big for the main memory, some leaf entries are treated as potential outliers (based on the definition of outlier) and are written out to disk. The others are used to rebuild the CF-tree. FIG. 3 shows the control flow of the outlier-handling option.
Implementation notes: a) The CF-tree t1 should be updated once any leaf entry is written to disk space S2. b) Outliers identified here are local candidates, and they are analyzed further in later steps, where the final outliers will be determined.
Overview of CF-Tree Building:
Initially a threshold value is set, data is scanned and the CF-tree is built dynamically. When the main memory runs out, or the tree height is larger than the maximum height before the whole data is scanned, the algorithm performs the delayed-split option, outlier-handling option and the tree rebuilding step to rebuild a new smaller CF-tree that can fit into the main memory. The process continues until all cases in the data are processed. When all data is scanned, cases in disk space S1 and entries in disk space S2 are scanned again to verify whether or not they are outliers.
Implementation note: When all data is scanned, all cases in disk space S1 will be inserted into the tree if the option of outlier-handling is turned off. This may result in rebuilding the tree if necessary.
The following TABLE, 2, shows the parameters involved in CF-tree building and their default values.









TABLE 2






Parameter
Default value








Assigned main memory (M)
80 * 1024 bytes



Assigned disk space for outlier-
20% of M



handling (S2)




Assigned disk space for
10% of M



delayed-split (S1)




Adjustment constant to the
1⁄6



tightness and distance




measures, Δk, k = 1, . . . , KA




Distance measure (Log-
Log-likelihood



likelihood/Euclidean)




Initial threshold value (T)
0



Branching factor (B)
8



Branching factor (L)
8



Maximum tree height (H)
3



Delayed-split option (on/off)
On



Outlier-handling option (on/off)
On



Outlier definition (Nmin)
Leaf entry which contains less




than Nmin cases, default 10









Hierarchical Agglomerative Clustering:

Hierarchical Agglomerative Clustering (HAC) proceeds by steps producing a sequence of partitions in which each partition is nested into the next partition in the sequence. HAC can be implemented using two methods, as described below.
Matrix Based HAC:
Suppose that matrix based HAC starts with J0 clusters. At each subsequent step, a pair of clusters is chosen. The two clusters Cj and Cs in the pair are closest together in terms of the distance measure d(j,s). A new cluster C<j,s> is formed to replace one of the clusters in the pair, say. This new cluster contains all data cases in Cj and Cs. The other cluster Cs is discarded. Hence the number of clusters is reduced by one at each step. The process stops when the desired number of clusters J1 is reached. Since the distance measure between any two clusters that are not involved in the merge does not change, the algorithm is designed to update the distance measures between the new cluster and the other clusters efficiently.
An example of a procedure for matrix based HAC can be seen in TABLE 3, shown as follows:







TABLE 3







Step 1. For j = 1, . . . , J0 − 1, {


    Compute d(j, s) for s = j + 1, . . . , J0;


    



  
    
      Find
      ⁢
      
        
      
      ⁢
      
        δ
        j
      
    
    =
    
      
        
          min
          
            
              s
              =
              
                j
                +
                1
              
            
            ,
            ...
            ,
            
              J
              0
            
          
        
        ⁢
        
          
            d
            ⁡
            
              (
              
                j
                ,
                s
              
              )
            
          
          ⁢
          
            
          
          ⁢
          and
          ⁢
          
            
          
          ⁢
          
            s
            j
          
        
      
      =
      
        arg
        ⁢
        
          
            min
            
              
                s
                =
                
                  j
                  +
                  1
                
              
              ,
              ...
              ,
              
                J
                0
              
            
          
          ⁢
          
            d
            ⁡
            
              (
              
                j
                ,
                s
              
              )
            
          
        
      
    
  
  ;






 }


 


  
    
      
        
          Find
          ⁢
          
            
          
          ⁢
          
            δ
            *
          
        
        =
        
          
            
              min
              
                
                  j
                  =
                  1
                
                ,
                ...
                ,
                
                  
                    J
                    0
                  
                  -
                  1
                
              
            
            ⁢
            
              
                δ
                j
              
              ⁢
              
                
              
              ⁢
              and
              ⁢
              
                
              
              ⁢
              
                j
                *
              
            
          
          =
          
            arg
            ⁢
            
              
                min
                
                  
                    j
                    =
                    1
                  
                  ,
                  ...
                  ,
                  
                    
                      J
                      0
                    
                    -
                    1
                  
                
              
              ⁢
              
                δ
                j
              
            
          
        
      
      ,
      
        
      
      ⁢
      
        the
        ⁢
        
          
        
        ⁢
        closest
        ⁢
        
          
        
        ⁢
        pair
        ⁢
        
          
        
        ⁢
        is
      
    
    ⁢
    
      
    
  




  
    
      
    
    ⁢
    
      
        
          <
        
        ⁢
        
          j
          *
        
      
      ,
      
        
          
            s
            
              j
              *
            
          
          ⁢
          
            >
          
        
        ;
      
    
  





Step 2. For J = J0 − 1, . . . , J1, {


  Merge the closest pair <j*, sj*>, and replace Cj* by C<j*,sj*>;


  For j = 1, . . . , j* − 1, {


   If sj = sj*, recompute all distances d(j, s), s = j + 1, . . . , J, and update δj


and sj;


   If sj ≠ sj*, {


     Compute d = d(j, j*);


     If d < δj, update δj = d and sj = j*;


     If d = δj, no change;


     If d > δj and sj = j*,


      Recompute all distances d(j, s), s = j + 1, . . . , J, and update δj


     and sj;


     If d > δj and sj ≠ j*, no change;


   }


   }


   For j = j*, recompute all distances d(j, s), s = j + 1, . . . , J, and update δj


and sj;


   For j = j* + 1, . . . , sj* − 1, {


    If sj = sj*, recompute all distances d(j, s), s = j + 1, . . . , J, and update δj


and sj;


    If sj ≠ sj*, no change;


   }


   For j = sj* + 1, . . . , J, no change;


Erase Csj*;


    


  
    
      
        
          Find
          ⁢
          
            
          
          ⁢
          
            δ
            *
          
        
        =
        
          
            
              min
              
                
                  j
                  =
                  1
                
                ,
                ...
                ,
                J
              
            
            ⁢
            
              
                δ
                j
              
              ⁢
              
                
              
              ⁢
              and
              ⁢
              
                
              
              ⁢
              
                j
                *
              
            
          
          =
          
            arg
            ⁢
            
              
                min
                
                  
                    j
                    =
                    1
                  
                  ,
                  ...
                  ,
                  J
                
              
              ⁢
              
                δ
                j
              
            
          
        
      
      ,
      
        
      
      ⁢
      
        the
        ⁢
        
          
        
        ⁢
        closest
        ⁢
        
          
        
        ⁢
        pair
        ⁢
        
          
        
        ⁢
        is
      
    
    ⁢
    
      
    
  




  
    
      
    
    ⁢
    
      
        
          <
        
        ⁢
        
          j
          *
        
      
      ,
      
        
          
            s
            
              j
              *
            
          
          ⁢
          
            >
          
        
        ;
      
    
  





}









Implementation notes: In order to reduce the memory requirement, it is not necessary to create an actual distance matrix when determining the closest clusters.
CF-Tree Based HAC:
Suppose that CF-tree based HAC starts with K0 CF-trees TCFk, k=1, . . . , K0 which contain J0 leaf entries Ci, i=1, . . . , J0. Let l(Ci) be the index of the CF-tree which contains the leaf entry Ci. For convenience, suppose Cs>Cj if l(Cs)>l(Cj). At each subsequent step, a pair of leaf entries is chosen. The two leaf entries Cj and Cs in the pair are closest together in terms of the distance measure d(j,s). A new leaf entry C<j,s> is formed to replace one of the leaf entries in the pair, say is created. This new leaf entry contains all data cases in Cj and Cs. The other leaf entry Cs is discarded. Hence, the number of leaf entries is reduced by one at each step. Meanwhile, the involved CF-trees are updated accordingly. The process stops when the desired number of leaf entries J1 is reached. The output is the set of updated CF-trees, whose leaf entries indicate the produced clusters.
An example of a procedure for CF-tree based HAC can be seen in TABLE 4, shown as follows:







TABLE 4







Step 1. For j = 1, . . . , J0 − 1, {


   Find the closes leaf entry Csk in each CF-tree TCFk for k = l(Cj), . . . , K0,


following the involved tree structure;


   



  
    
      Find
      ⁢
      
        
      
      ⁢
      
        δ
        j
      
    
    =
    
      
        
          min
          
            
              
                s
                k
              
              >
              j
            
            ,
            
              k
              =
              
                l
                ⁡
                
                  (
                  
                    C
                    j
                  
                  )
                
              
            
            ,
            ...
            ,
            
              K
              0
            
          
        
        ⁢
        
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
          ⁢
          
            
          
          ⁢
          and
          ⁢
          
            
          
          ⁢
          
            s
            j
          
        
      
      =
      
        arg
        ⁢
        
          
            min
            
              
                
                  s
                  k
                
                >
                j
              
              ,
              
                k
                =
                
                  l
                  ⁡
                  
                    (
                    
                      C
                      j
                    
                    )
                  
                
              
              ,
              ...
              ,
              
                K
                0
              
            
          
          ⁢
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
        
      
    
  
  ;






 }


  


  
    
      
        
          Find
          ⁢
          
            
          
          ⁢
          
            δ
            *
          
        
        =
        
          
            
              min
              
                
                  j
                  =
                  1
                
                ,
                ...
                ,
                
                  
                    J
                    0
                  
                  -
                  1
                
              
            
            ⁢
            
              
                δ
                j
              
              ⁢
              
                
              
              ⁢
              and
              ⁢
              
                
              
              ⁢
              
                j
                *
              
            
          
          =
          
            arg
            ⁢
            
              
                min
                
                  
                    j
                    =
                    1
                  
                  ,
                  ...
                  ,
                  
                    
                      J
                      0
                    
                    -
                    1
                  
                
              
              ⁢
              
                δ
                j
              
            
          
        
      
      ,
      
        
      
      ⁢
      
        the
        ⁢
        
          
        
        ⁢
        closest
        ⁢
        
          
        
        ⁢
        pair
        ⁢
        
          
        
        ⁢
        is
      
    
    ⁢
    
      
    
  




  
    
      
    
    ⁢
    
      
        
          <
        
        ⁢
        
          j
          *
        
      
      ,
      
        
          
            s
            
              j
              *
            
          
          ⁢
          
            >
          
        
        ;
      
    
  





Step 2. For J = J0 − 1, . . . , J1, {


   Merge the closest pair <j*, sj*>, update CF-tree TCFl(Cj*) by the new leaf


   entry C<j*,sj*>, and remove the leaf entry Csj* from CF-tree TCFl(Csj*);


 For j = 1, . . . , j* − 1, {


   If sj = sj*, {


    Find the closest leaf entry Csk in each CF-tree TCFk for k = l(Cj), . . . , K0;


    



  
    
      Find
      ⁢
      
        
      
      ⁢
      
        δ
        j
      
    
    =
    
      
        
          min
          
            
              
                s
                k
              
              >
              j
            
            ,
            
              k
              =
              
                l
                ⁡
                
                  (
                  
                    C
                    j
                  
                  )
                
              
            
            ,
            ...
            ,
            
              K
              0
            
          
        
        ⁢
        
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
          ⁢
          
            
          
          ⁢
          and
          ⁢
          
            
          
          ⁢
          
            s
            j
          
        
      
      =
      
        arg
        ⁢
        
          
            min
            
              
                
                  s
                  k
                
                >
                j
              
              ,
              
                k
                =
                
                  l
                  ⁡
                  
                    (
                    
                      C
                      j
                    
                    )
                  
                
              
              ,
              ...
              ,
              
                K
                0
              
            
          
          ⁢
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
        
      
    
  
  ;






    }


   If sj ≠ sj*, {


    Compute d = d(j, j*);


    If d < δj, update δj = d and sj = j*;


    If d = δj, no change;


 If d > δj and sj = j*, {


   Find the closest leaf entry Csk in each CF-tree TCFk for k = l(Cj), . . . , K0;


   



  
    
      Find
      ⁢
      
        
      
      ⁢
      
        δ
        j
      
    
    =
    
      
        
          min
          
            
              
                s
                k
              
              >
              j
            
            ,
            
              k
              =
              
                l
                ⁡
                
                  (
                  
                    C
                    j
                  
                  )
                
              
            
            ,
            ...
            ,
            
              K
              0
            
          
        
        ⁢
        
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
          ⁢
          
            
          
          ⁢
          and
          ⁢
          
            
          
          ⁢
          
            s
            j
          
        
      
      =
      
        arg
        ⁢
        
          
            min
            
              
                
                  s
                  k
                
                >
                j
              
              ,
              
                k
                =
                
                  l
                  ⁡
                  
                    (
                    
                      C
                      j
                    
                    )
                  
                
              
              ,
              ...
              ,
              
                K
                0
              
            
          
          ⁢
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
        
      
    
  
  ;






     }


   If d > δj and sj ≠ j*, no change;


  }


 }


 For j = j*, {


  Find the closest leaf entry Csk in each CF-tree TCFk for k = l(Cj), . . . , K0;


  



  
    
      Find
      ⁢
      
        
      
      ⁢
      
        δ
        j
      
    
    =
    
      
        
          min
          
            
              
                s
                k
              
              >
              j
            
            ,
            
              k
              =
              
                l
                ⁡
                
                  (
                  
                    C
                    j
                  
                  )
                
              
            
            ,
            ...
            ,
            
              K
              0
            
          
        
        ⁢
        
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
          ⁢
          
            
          
          ⁢
          and
          ⁢
          
            
          
          ⁢
          
            s
            j
          
        
      
      =
      
        arg
        ⁢
        
          
            min
            
              
                
                  s
                  k
                
                >
                j
              
              ,
              
                k
                =
                
                  l
                  ⁡
                  
                    (
                    
                      C
                      j
                    
                    )
                  
                
              
              ,
              ...
              ,
              
                K
                0
              
            
          
          ⁢
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
        
      
    
  
  ;






  }


 For j = j* + 1, . . . , sj* − 1, {


  If sj = sj*, {


   Find the closest leaf entry Csk in each CF-tree TCFk for k = l(Cj), . . . , K0;


   



  
    
      Find
      ⁢
      
        
      
      ⁢
      
        δ
        j
      
    
    =
    
      
        
          min
          
            
              
                s
                k
              
              >
              j
            
            ,
            
              k
              =
              
                l
                ⁡
                
                  (
                  
                    C
                    j
                  
                  )
                
              
            
            ,
            ...
            ,
            
              K
              0
            
          
        
        ⁢
        
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
          ⁢
          
            
          
          ⁢
          and
          ⁢
          
            
          
          ⁢
          
            s
            j
          
        
      
      =
      
        arg
        ⁢
        
          
            min
            
              
                
                  s
                  k
                
                >
                j
              
              ,
              
                k
                =
                
                  l
                  ⁡
                  
                    (
                    
                      C
                      j
                    
                    )
                  
                
              
              ,
              ...
              ,
              
                K
                0
              
            
          
          ⁢
          
            d
            ⁡
            
              (
              
                j
                ,
                
                  s
                  k
                
              
              )
            
          
        
      
    
  
  ;






   }


  If sj ≠ sj*, no change;


  }


 For j = sj* + 1, . . . , J, no change;


 



  
    
      Find
      ⁢
      
        
      
      ⁢
      
        δ
        *
      
    
    =
    
      
        
          min
          
            
              j
              =
              1
            
            ,
            ...
            ,
            J
          
        
        ⁢
        
          
            δ
            j
          
          ⁢
          
            
          
          ⁢
          and
          ⁢
          
            
          
          ⁢
          
            j
            *
          
        
      
      =
      
        arg
        ⁢
        
          
            min
            
              
                j
                =
                1
              
              ,
              ...
              ,
              J
            
          
          ⁢
          
            δ
            j
          
        
      
    
  
  ,
  
    
  
  ⁢
  
    the
    ⁢
    
      
    
    ⁢
    closest
    ⁢
    
      
    
    ⁢
    pair
    ⁢
    
      
    
    ⁢
    is
    ⁢
    
      
    
    ⁢
    
      <
    
    ⁢
    
      j
      *
    
  
  ,
  
    
      
        s
        
          j
          *
        
      
      ⁢
      
        >
      
    
    ;
  






}


Step 3. Export updated non-empty CF-trees;









While CF-tree based HAC may superficially appear to be very similar to matrix based HAC there is at least one difference that is not to be ignored. That difference is that CF-tree based HAC takes advantage of CF-tree structures to efficiently find the closest pair, rather than checking all possible pairs as in matrix based HAC. This results in a reduction in total resource usage that would not be possible using matrix based HAC.
Determination of the Number of Clusters:
Assume that the hierarchical clustering method has been used to produce 1, 2 . . . clusters already. The following two criterion indices, Bayesian Information Criterion (BIC) and Akaike Information Criterion (AIC), are considered in order to find the appropriate number of final clusters.
Bayesian Information Criterion (BIC)(J) is determined by equation 23, shown as follows:




  
    B
    ⁢
    
      
    
    ⁢
    I
    ⁢
    
      
    
    ⁢
    
      C
      ⁡
      
        (
        J
        )
      
    
  
  =
  
    
      
        ∑
        
          k
          =
          1
        
        
          
            K
            A
          
          +
          
            K
            B
          
        
      
      ⁢
      
        B
        ⁢
        
          
        
        ⁢
        I
        ⁢
        
          
        
        ⁢
        
          
            C
            k
          
          ⁡
          
            (
            J
            )
          
        
      
    
    =
    
      
        
          -
          2
        
        ⁢
        
          
            ∑
            
              j
              =
              1
            
            J
          
          ⁢
          
            
              ξ
              ~
            
            j
          
        
      
      +
      
        
          m
          J
        
        ⁢
        
          ln
          ⁡
          
            (
            N
            )
          
        
      
    
  




    
    
        Where N is the total number of cases in all the J clusters (m1), is determined by equation 24, shown as follows:

mJ=J{2KA+Σk=1KB(Lk−1)},

        and BICk(J) is determined by equation 25, shown as follows:
    
    






  
    B
    ⁢
    
      
    
    ⁢
    I
    ⁢
    
      
    
    ⁢
    
      
        C
        k
      
      ⁡
      
        (
        J
        )
      
    
  
  =
  
    {
    
      
        
          
            
              
                
                  ∑
                  
                    j
                    =
                    1
                  
                  J
                
                ⁢
                
                  
                    N
                    jk
                  
                  ⁢
                  
                    ln
                    ⁡
                    
                      (
                      
                        
                          
                            σ
                            ^
                          
                          jk
                          2
                        
                        +
                        
                          Δ
                          k
                        
                      
                      )
                    
                  
                
              
              +
              
                2
                ⁢
                J
                ⁢
                
                  
                
                ⁢
                
                  ln
                  ⁡
                  
                    (
                    N
                    )
                  
                
              
            
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            feature
            ⁢
            
              
            
            ⁢
            k
            ⁢
            
              
            
            ⁢
            is
            ⁢
            
              
            
            ⁢
            continuous
          
        
      
      
        
          
            
              
                2
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      1
                    
                    J
                  
                  ⁢
                  
                    
                      N
                      jk
                      ′
                    
                    ⁢
                    
                      
                        E
                        ^
                      
                      jk
                    
                  
                
              
              +
              
                
                  J
                  ⁡
                  
                    (
                    
                      
                        L
                        k
                      
                      -
                      1
                    
                    )
                  
                
                ⁢
                
                  ln
                  ⁡
                  
                    (
                    N
                    )
                  
                
              
            
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            feature
            ⁢
            
              
            
            ⁢
            k
            ⁢
            
              
            
            ⁢
            is
            ⁢
            
              
            
            ⁢
            categorical
          
        
      
    
  




Akaike Information Criterion (AIC)(J), is determined by equation 26, shown as follows:




  
    A
    ⁢
    
      
    
    ⁢
    I
    ⁢
    
      
    
    ⁢
    
      C
      ⁡
      
        (
        J
        )
      
    
  
  =
  
    
      
        ∑
        
          k
          =
          1
        
        
          
            K
            A
          
          +
          
            K
            B
          
        
      
      ⁢
      
        A
        ⁢
        
          
        
        ⁢
        I
        ⁢
        
          
        
        ⁢
        
          
            C
            k
          
          ⁡
          
            (
            J
            )
          
        
      
    
    =
    
      
        
          -
          2
        
        ⁢
        
          
            ∑
            
              j
              =
              1
            
            J
          
          ⁢
          
            
              ξ
              ~
            
            j
          
        
      
      +
      
        2
        ⁢
        
          
        
        ⁢
        
          m
          J
        
      
    
  




    
    
        Where, AICk(J) is determined by equation 27, shown as follows:
    
    






  
    A
    ⁢
    
      
    
    ⁢
    I
    ⁢
    
      
    
    ⁢
    
      
        C
        k
      
      ⁡
      
        (
        J
        )
      
    
  
  =
  
    {
    
      
        
          
            
              
                
                  ∑
                  
                    j
                    =
                    1
                  
                  J
                
                ⁢
                
                  
                    N
                    jk
                  
                  ⁢
                  
                    ln
                    ⁡
                    
                      (
                      
                        
                          
                            σ
                            ^
                          
                          jk
                          2
                        
                        +
                        
                          Δ
                          k
                        
                      
                      )
                    
                  
                
              
              +
              
                4
                ⁢
                
                  
                
                ⁢
                J
              
            
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            feature
            ⁢
            
              
            
            ⁢
            k
            ⁢
            
              
            
            ⁢
            is
            ⁢
            
              
            
            ⁢
            continuous
          
        
      
      
        
          
            
              
                2
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      1
                    
                    J
                  
                  ⁢
                  
                    
                      N
                      jk
                      ′
                    
                    ⁢
                    
                      
                        E
                        ^
                      
                      jk
                    
                  
                
              
              +
              
                2
                ⁢
                
                  
                
                ⁢
                
                  J
                  ⁡
                  
                    (
                    
                      
                        L
                        k
                      
                      -
                      1
                    
                    )
                  
                
              
            
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            feature
            ⁢
            
              
            
            ⁢
            k
            ⁢
            
              
            
            ⁢
            is
            ⁢
            
              
            
            ⁢
            categorical
          
        
      
    
  




Let I(J) be the criterion index (BIC or AIC) of J clusters, d(J) be the distance measure between the two clusters merged in merging J+1 clusters to J clusters, and JC be the total number of sub-clusters from which to determine the appropriate number of final clusters.
In some embodiments, users can supply the range for the number of clusters [Jmin,Jmax] in which they believe the “true” number of clusters should lie. Notice that if JC<Jmax, reset Jmax=JC. Notice that the criterion index I(J) can be defined as BIC(J) or AIC(J), and it can also be defined as BICk(J) or AICk(J). The former definition is used to find the optimal number of clusters when using all available features in clustering, while the latter one is to find the optimal number of clusters when using a single feature. This applies for the distance measure d(J) as well.
With this in mind, the following four methods are proposed for finding the number of clusters:

    
    
        Method 1. Finding the number of clusters by information criterion only.
        To report
    
    






  
    J
    I
  
  =
  
    arg
    ⁢
    
      
    
    ⁢
    
      
        min
        
          J
          ∈
          
            [
            
              
                J
                min
              
              ,
              
                J
                max
              
            
            ]
          
        
      
      ⁢
      
        (
        
          I
          ⁡
          
            (
            J
            )
          
        
        )
      
    
  




    
    
         as the number of clusters, where I(J) can be either BIC(J) or AIC(J) depending on user's choice.
        Method 2. Finding the number of cluster by distance jump only.
        To report
    
    






  
    J
    d
  
  =
  
    1
    +
    
      arg
      ⁢
      
        
      
      ⁢
      
        
          max
          
            J
            ∈
            
              [
              
                
                  
                    J
                    min
                  
                  -
                  1
                
                ,
                
                  
                    J
                    max
                  
                  -
                  1
                
              
              ]
            
          
        
        ⁢
        
          (
          
            
              d
              ⁡
              
                (
                J
                )
              
            
            /
            
              d
              ⁡
              
                (
                
                  J
                  +
                  1
                
                )
              
            
          
          )
        
      
    
  




    
    
         as the number of clusters.
        Method 3. Finding the number of clusters by max(JI,Jd).
        To report max(JI,Jd) as the number of clusters.
        Method 4. Finding the number of clusters by min(JI,Jd).
        To report min(JI,Jd) as the number of clusters.
    
    


It is to be noted that, in default, method 4 is used with BIC as the information criterion.
Feature Selection:
Feature Filtering: Based on the available summary statistics, an initial analysis will be performed to determine the features which are not useful for making the clustering solution. Specifically, one or more of the following features, included in TABLE 5, shown below, will be excluded. The remaining features will be saved for adaptive feature selection in the next step.










TABLE 5





#
Rule
Status
Comment







1
Frequency/analysis weight feature
Required



2
Identity features
Required



3
The percentage of missing values in
Required




any feature is larger than δ (default 0.7)




4
The distribution of the categories of a
Required
The statistic of



categorical feature is extremely

RMSSE is the



imbalanced, that is RMSSE > δ

effect size for



(default 0.7)

one sample





chi-square test.


5
There are categories of a categorical
Discarded




feature with extremely high or low





frequency, that is, the outlier strength is





larger than δ (default 3)




6
The coefficient of variation of a
Required




continuous feature is smaller than δ





(default 0.05)









Adaptive Feature Selection:

Adaptive feature selection is used to select the most important features for the final clustering solution. Specifically, the adaptive feature selection performs the steps included in Table 6 as seen in FIG. 5.
The process described above can be implemented in parallel using one map-reduce job under the Hadoop framework. See Supplemental section A, further below, for details on the map-reduce implementation.
Implementation note: In certain embodiments, in default, the information based feature importance is used for the log-likelihood distance measure, and the effect size based feature importance is for the Euclidean distance.
Distributed Clustering:
Certain embodiments of the invention can identify clusters from distributed data with high performance and accuracy. Specifically, it performs the steps as seen in Table 7 of FIG. 6.
The process described above can be implemented in parallel using one map-reduce job under the Hadoop framework. See Supplemental section B for details of the map-reduce implementation.
Implementation notes: The number of computing units (Q) is given by equation 28 as follows:

Q=┌min(R*S/D1,D2/Cmin)┐

    
    
        where D1 (default 50,000) is the number of data points which are suitable to perform CF-tree based HAC, D2 (default 5,000) is the number of data points which are suitable to perform matrix based HAC, Cmin is the minimal number of sub-clusters produced by each computing unit, and S is the maximal number of leaf entries, i.e. BH*L, in a single CF-tree.
    
    


The number of sub-clusters produced by each computing unit, J1, is given by equation 29 as follows:

J1=┌min(R*S, D2)/Q┐

Distributed Outlier Detection:

Outlier detection will be based and build upon the outlier handling method that was previously described above. Outlier detection is further extended into the distributed setting with the steps as seen in Table 8 of FIG. 7.
Outlier strength of a cluster Cs, O(s), is computed, as given by equation 30, as follows:




  
    O
    ⁡
    
      (
      s
      )
    
  
  =
  
    
      ∑
      
        j
        =
        1
      
      J
    
    ⁢
    
      
        
          
            d
            ~
          
          ⁡
          
            (
            
              j
              ,
              s
            
            )
          
        
        
          
            D
            t
          
          ⁡
          
            (
            j
            )
          
        
      
      ⁢
      
        p
        ⁡
        
          (
          
            j
            ❘
            s
          
          )
        
      
    
  




    
    
        where Dt(j) is the distance threshold of cluster Cj, which is the maximum distance from cluster Cj to each center of its starting sub-clusters in matrix based HAC, {tilde over (d)}(j,s) is the distance from cluster Cj to the center of cluster Cs, and p(j|s) is the probability of cluster Cs belonging to cluster Cj, that is given by equation 31 as follows:
    
    






  
    p
    ⁡
    
      (
      
        j
        ❘
        s
      
      )
    
  
  =
  
    
      exp
      ⁡
      
        (
        
          -
          
            
              d
              ~
            
            ⁡
            
              (
              
                j
                ,
                s
              
              )
            
          
        
        )
      
    
    
      
        ∑
        
          j
          =
          1
        
        J
      
      ⁢
      
        exp
        ⁡
        
          (
          
            -
            
              
                d
                ~
              
              ⁡
              
                (
                
                  j
                  ,
                  s
                
                )
              
            
          
          )
        
      
    
  




Notice that the distance between the cluster center and a cluster Cj is computed by considering the center of cluster Cs as a singleton cluster Cs′. The cluster center herein is defined as the vector of proportional values qskl for each category of any categorical feature, and clusters means {circumflex over (μ)}sk for each continuous feature. In terms of cluster feature the cluster center as a singleton, CFs′, is given by:

CFs′={Ns′,{right arrow over (N)}s′,ss′,ss′2,Ns′B},

    
    
        where Ns′=1, {right arrow over (N)}s′=(1, . . . ,1), ss′=({circumflex over (μ)}s1, . . . , {circumflex over (μ)}sKA), ss′2=({circumflex over (μ)}s12, . . . , {circumflex over (μ)}sKA2),Ns′B=(Ns′1B, . . . ,Ns′KBB), and Ns′kB=({circumflex over (q)}sk1, . . . ,{circumflex over (q)}sk(Lk−1))
        Note that {right arrow over (N)}s′ may contain zero entries for those features which have missing values in all cases in cluster Cs.

Cluster Membership Assignment:

Without Outlier-Handling:

    
    


Without outlier-handling the case is assigned to the closest cluster according to the distance measure. Meanwhile, the probabilities of the case belonging to each regular cluster are produced.
With Outlier-Handling Using the Legacy Method:
Determine the log-likelihood distance: Assume outliers follow a uniform distribution. Calculate both the log-likelihood resulting from assigning a case to a noise cluster and that resulting from assigning it to the closest non-noise cluster. The case is then assigned to the cluster which leads to the larger log-likelihood. This is equivalent to assigning a case to its closest non-noise cluster if the distance between them is smaller than a critical value C=ln(ΠkRkΠmLm), where Πk Rk is the product of ranges of continuous fields, and ΠmLm is the product of category numbers of categorical fields. Otherwise, designate the case as an outlier.
Determine the euclidean distance: Assign a case to its closest non-noise cluster if the Euclidean distance between them is smaller than a critical value C which is given by:




  C
  =
  
    2
    ⁢
    
      
        
          1
          
            JK
            A
          
        
        ⁢
        
          
            ∑
            
              j
              =
              1
            
            J
          
          ⁢
          
            
              ∑
              
                k
                =
                1
              
              
                K
                A
              
            
            ⁢
            
              
                σ
                ^
              
              jk
              2
            
          
        
      
    
  




    
    
        Otherwise, designate the case as an outlier.

New Method:

    
    


When scoring a new case, compute the outlier strength of the case. If the computed outlier strength is greater than the outlier threshold, then the case is an outlier and otherwise belongs to the closest cluster. Meanwhile, the probabilities of the case belonging to each regular cluster are produced. Alternatively, in some embodiments, users can specify a customized outlier threshold, e.g. 3, rather than using the one found from the data.
Clustering Model Evaluation:
Clustering model evaluation enables users to understand the identified cluster structure, and also to learn useful insights and interestingness derived from the clustering solution. Note that clustering model evaluation can be done using cluster features and also the hierarchical dendrogram when forming the clustering solution.
Across-Cluster Feature Importance:
Across-cluster feature importance indicates how influential a feature is in building the clustering solution. This measure is very useful for users to understand the clusters in their data. Moreover, it is helpful for feature selection, as described in a later section. Across-cluster feature importance can be defined using two methods, Information Criterion Based Method and Effect Size Based Method.
Information Criterion Based Method:
If BIC is used as the information criterion, the importance of feature k (Importancek) is given by equation 32 as follows:

Importancek=1−BICk(J)/BIC(J)

While if AIC is used, the importance of feature k (Importancek) is given by equation 33 as follows:

Importancek=1−AICk(J)/AIC(J)

Effect Size Based Method:

In some embodiments, this method shares some similarities to the method used for defining association interestingness for bivariate variables.
Categorical Feature:
For a categorical feature k, compute Pearson chi-square test statistic (χp2)




  
    
      
        
          
            χ
            p
            2
          
          =
          
            
              ∑
              
                l
                =
                1
              
              
                L
                k
              
            
            ⁢
            
              
                ∑
                
                  j
                  =
                  1
                
                J
              
              ⁢
              
                
                  
                    (
                    
                      
                        N
                        jkl
                      
                      -
                      
                        E
                        jkl
                      
                    
                    )
                  
                  2
                
                
                  E
                  jkl
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        where
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          34
        
        )
      
    
  
  
    
      
        
          
            E
            jkl
          
          =
          
            
              
                N
                
                  jk
                  ·
                
              
              ⁢
              
                N
                
                  ·
                  kl
                
              
            
            
              N
              ⁢
              
                .
                k
              
              .
            
          
        
        ⁢
        
          

        
        ⁢
        and
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          35
        
        )
      
    
  
  
    
      
        
          N
          
            jk
            ·
          
        
        =
        
          
            ∑
            
              l
              =
              1
            
            
              L
              k
            
          
          ⁢
          
            N
            jkl
          
        
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          36
        
        )
      
    
  
  
    
      
        
          N
          
            ·
            kl
          
        
        =
        
          
            ∑
            
              j
              =
              1
            
            J
          
          ⁢
          
            N
            jkl
          
        
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          37
        
        )
      
    
  
  
    
      
        
          N
          
            ·
            k
            ·
          
        
        =
        
          
            ∑
            
              l
              =
              1
            
            
              L
              k
            
          
          ⁢
          
            
              ∑
              
                j
                =
                1
              
              J
            
            ⁢
            
              N
              jkl
            
          
        
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          38
        
        )
      
    
  




    
    
        The pvalue is computed as:

pvalue=Prob{X2>χp2},  (equation 39)

    
    


In equation 39, X2 is a random variable that follows a chi-square distribution with freedom degree of (J−1) (Lk−1). Note that categories with Njk.=0 or N.kl=0 will be excluded when computing the statistic and degrees of freedom.
The effect size, Es, Cramer's V, is given by equation 40 as follows:




  
    E
    s
  
  =
  
    
      (
      
        
          χ
          p
          2
        
        
          
            N
            
              ·
              k
              ·
            
          
          ⁡
          
            (
            
              q
              -
              1
            
            )
          
        
      
      )
    
    
      1
      /
      2
    
  




    
    
        where

q=min(J,Lk).  (equation 41)
        
            The importance of feature k (Importancek) is produced by following a mapping function, as shown in equation 42 as follows:
        
        
    
    






  
    Importance
    k
  
  =
  
    {
    
      
        
          
            0
            ,
          
        
        
          
            
              p
              value
            
            ≥
            
              sig
              .
            
          
        
      
      
        
          
            
              MonotoneCubicInterpolation
              ⁡
              
                (
                
                  
                    S
                    t
                  
                  ,
                  
                    I
                    t
                  
                  ,
                  
                    E
                    s
                  
                
                )
              
            
            ,
          
        
        
          
            
              p
              value
            
            <
            
              sig
              .
            
          
        
      
    
  




    
    
        
        
            where sig. is significance level (default 0.05), St is a set of threshold values to assess effect size (default St={0.0, 0.2, 0.6, 1.0}), It is a set of corresponding thresholds of importance (default It={0.00, 0.33, 0.67, 1.00}), and MonotoneCubicInterpolation(•) is a monotone cubic interpolation mapping function between St and It.

Continuous Feature:

        
        
    
    


For a continuous feature k, compute F test statistic (F), equation 43, as follows:




  
    
      
        
          F
          =
          
            
              S
              ⁢
              
                
              
              ⁢
              S
              ⁢
              
                
              
              ⁢
              
                R
                /
                
                  (
                  
                    J
                    -
                    1
                  
                  )
                
              
            
            
              
                
              
              ⁢
              
                S
                ⁢
                
                  
                
                ⁢
                S
                ⁢
                
                  
                
                ⁢
                
                  E
                  /
                  
                    (
                    
                      
                        N
                        
                          ·
                          k
                        
                      
                      -
                      J
                    
                    )
                  
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        where
        ⁢
        
          

        
        ⁢
        
          
            S
            ⁢
            
              
            
            ⁢
            S
            ⁢
            
              
            
            ⁢
            R
          
          =
          
            
              ∑
              
                j
                =
                1
              
              J
            
            ⁢
            
              
                
                  N
                  jk
                
                ⁡
                
                  (
                  
                    
                      
                        μ
                        ^
                      
                      jk
                    
                    -
                    
                      
                        μ
                        ^
                      
                      k
                    
                  
                  )
                
              
              2
            
          
        
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          44
        
        )
      
    
  
  
    
      
        
          S
          ⁢
          
            
          
          ⁢
          S
          ⁢
          
            
          
          ⁢
          E
        
        =
        
          
            ∑
            
              j
              =
              1
            
            J
          
          ⁢
          
            
              N
              jk
            
            ⁢
            
              
                σ
                ^
              
              jk
              2
            
          
        
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          45
        
        )
      
    
  
  
    
      
        
          N
          
            ·
            k
          
        
        =
        
          
            ∑
            
              j
              =
              1
            
            J
          
          ⁢
          
            N
            jk
          
        
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          46
        
        )
      
    
  
  
    
      
        
          
            μ
            ^
          
          k
        
        =
        
          
            
              
                ∑
                
                  j
                  =
                  1
                
                J
              
              ⁢
              
                
                  N
                  jk
                
                ⁢
                
                  
                    μ
                    ^
                  
                  jk
                
              
            
            
              N
              
                ·
                k
              
            
          
          .
        
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          47
        
        )
      
    
  




The F statistic is undefined if the denominator equals zero. Accordingly, the Pvalue is calculated, in equation 48 as follows:




  
    p
    value
  
  =
  
    {
    
      
        
          
            undefined
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            both
            ⁢
            
              
            
            ⁢
            the
            ⁢
            
              
            
            ⁢
            numerator
            ⁢
            
              
            
            ⁢
            and
          
        
      
      
        
          
            0
            ,
          
        
        
          
            
              
            
            ⁢
            
              
                denominator
                ⁢
                
                  
                
                ⁢
                of
                ⁢
                
                  
                
                ⁢
                F
                ⁢
                
                  
                
                ⁢
                are
                ⁢
                
                  
                
                ⁢
                zero
              
              ;
              
                else
                ⁢
                
                  
                
                ⁢
                if
                ⁢
                
                  
                
                ⁢
                the
              
            
            ⁢
            
              
            
          
        
      
      
        
          
            Prob
            ⁢
            
              {
              
                F
                (
                
                  
                    J
                    -
                    1
                  
                  ,
                
              
            
          
        
        
          
            
              
            
            ⁢
            
              
                denominator
                ⁢
                
                  
                
                ⁢
                of
                ⁢
                
                  
                
                ⁢
                F
                ⁢
                
                  
                
                ⁢
                is
                ⁢
                
                  
                
                ⁢
                zero
              
              ;
              
                else
                .
              
            
          
        
      
      
        
          
            
              
                
                  
                    
                      N
                      
                        ·
                        k
                      
                    
                    -
                    J
                  
                  )
                
                >
                F
              
              }
            
            ,
          
        
        
          
            
          
        
      
    
  




In which F(J−1, N.k−J) is a random variable that follows a F-distribution with degrees of freedom J−1 and N.k−J.

    
    
        The effect size, Es, Eta square, is given by equation 49, as follows:
    
    






  
    
      
        
          
            E
            s
          
          =
          
            1
            -
            
              
                
                  ∑
                  
                    j
                    =
                    1
                  
                  J
                
                ⁢
                
                  
                    N
                    jk
                  
                  ⁢
                  
                    
                      σ
                      ^
                    
                    jk
                    2
                  
                
              
              
                
                  N
                  
                    ·
                    k
                  
                
                ⁢
                
                  
                    σ
                    ^
                  
                  k
                  2
                
              
            
          
        
        ⁢
        
          

        
        ⁢
        where
        ⁢
        
          

        
        ⁢
        
          
            
              σ
              ^
            
            k
            2
          
          =
          
            
              
                
                  ∑
                  
                    j
                    =
                    1
                  
                  J
                
                ⁢
                
                  s
                  jk
                  2
                
              
              -
              
                
                  N
                  
                    ·
                    k
                  
                
                ⁢
                
                  
                    μ
                    ^
                  
                  k
                  2
                
              
            
            
              N
              
                ·
                k
              
            
          
        
      
    
    
      
        (
        
          equation
          ⁢
          
            
          
          ⁢
          50
        
        )
      
    
  




    
    
        
        
            The importance of feature k is produced using the same mapping function as (equation 42), and default St={0.0, 0.04, 0.36, 1.0}.

Within-Cluster Feature Importance:

        
        
    
    


Within-cluster feature importance indicates how influential a feature is in forming a cluster. Similar to across-cluster feature importance, within-cluster feature importance can also be defined using an Information Criterion Based Method or an Effect Size Based Method.
Information Criterion Based Method:
If BIC is used as the information criterion, the importance of feature k within cluster Cj (j=1, . . . ,J) is Importancek,j as given by equation 51 as follows:

Importancek=1−BICk,j/BICj 

    
    
        Where equation 52 yields BICk,j as follows:
    
    






  
    BIC
    
      k
      ,
      j
    
  
  =
  
    {
    
      
        
          
            
              
                
                  N
                  jk
                
                ⁢
                
                  ln
                  ⁡
                  
                    (
                    
                      
                        
                          σ
                          ^
                        
                        jk
                        2
                      
                      +
                      
                        Δ
                        k
                      
                    
                    )
                  
                
              
              +
              
                2
                ⁢
                
                  ln
                  ⁡
                  
                    (
                    N
                    )
                  
                
              
            
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            feature
            ⁢
            
              
            
            ⁢
            k
            ⁢
            
              
            
            ⁢
            is
            ⁢
            
              
            
            ⁢
            continuous
          
        
      
      
        
          
            
              
                2
                ⁢
                
                  N
                  jk
                  ′
                
                ⁢
                
                  
                    E
                    ^
                  
                  jk
                
              
              +
              
                
                  (
                  
                    
                      L
                      k
                    
                    -
                    1
                  
                  )
                
                ⁢
                
                  ln
                  ⁡
                  
                    (
                    N
                    )
                  
                
              
            
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            feature
            ⁢
            
              
            
            ⁢
            k
            ⁢
            
              
            
            ⁢
            is
            ⁢
            
              
            
            ⁢
            categorical
          
        
      
    
  




    
    
        And equation 53 yields BICj as follows:
    
    






  
    B
    ⁢
    
      
    
    ⁢
    I
    ⁢
    
      
    
    ⁢
    
      C
      j
    
  
  =
  
    
      ∑
      
        k
        =
        1
      
      
        
          K
          A
        
        +
        
          K
          B
        
      
    
    ⁢
    
      B
      ⁢
      
        
      
      ⁢
      I
      ⁢
      
        
      
      ⁢
      
        C
        
          k
          ,
          j
        
      
    
  




If AIC is used as the information criterion, the importance of feature k within cluster Cj (j=1, . . . ,J) is Importancek,j given by equation 54 as follows:

Importancek,j=1−AICk,j/AICj 

    
    
        Where equation 55 yields AICk,j as follows:
    
    






  
    A
    ⁢
    
      
    
    ⁢
    I
    ⁢
    
      
    
    ⁢
    
      C
      
        k
        ,
        j
      
    
  
  =
  
    {
    
      
        
          
            
              
                
                  N
                  jk
                
                ⁢
                
                  ln
                  ⁡
                  
                    (
                    
                      
                        
                          σ
                          ^
                        
                        jk
                        2
                      
                      +
                      
                        Δ
                        k
                      
                    
                    )
                  
                
              
              +
              4
            
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            feature
            ⁢
            
              
            
            ⁢
            k
            ⁢
            
              
            
            ⁢
            is
            ⁢
            
              
            
            ⁢
            continuous
          
        
      
      
        
          
            
              
                2
                ⁢
                
                  N
                  jk
                  ′
                
                ⁢
                
                  
                    E
                    ^
                  
                  jk
                
              
              +
              
                2
                ⁢
                
                  (
                  
                    
                      L
                      k
                    
                    -
                    1
                  
                  )
                
              
            
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            feature
            ⁢
            
              
            
            ⁢
            k
            ⁢
            
              
            
            ⁢
            is
            ⁢
            
              
            
            ⁢
            categorical
          
        
      
    
  




    
    
        And equation 56 yields AICj as follows:
    
    






  
    A
    ⁢
    
      
    
    ⁢
    I
    ⁢
    
      
    
    ⁢
    
      C
      j
    
  
  =
  
    
      ∑
      
        k
        =
        1
      
      
        
          K
          A
        
        +
        
          K
          B
        
      
    
    ⁢
    
      A
      ⁢
      
        
      
      ⁢
      I
      ⁢
      
        
      
      ⁢
      
        C
        
          k
          ,
          j
        
      
    
  




Effect Size Based Method:

Within-cluster importance is defined by comparing the distribution of the feature within a cluster with the overall distribution. This is applied to both categorical features and continuous features.
Categorical Feature:
For cluster Cj (j=1, . . . ,J) and a categorical feature k, compute Pearson chi-square test statistic using equation 57 as follows:




  
    χ
    p
    2
  
  =
  
    
      ∑
      
        l
        =
        1
      
      
        L
        k
      
    
    ⁢
    
      
        
          (
          
            
              N
              jkl
            
            -
            
              E
              jkl
            
          
          )
        
        2
      
      
        E
        jkl
      
    
  




    
    
        Where equation 58 yields Ejkl as follows:
    
    






  
    E
    jkl
  
  =
  
    
      
        N
        
          jk
          ·
        
      
      ⁢
      
        N
        
          ·
          kl
        
      
    
    
      N
      
        ·
        k
        ·
      
    
  




    
    
        The p-value is computed, using equation 59, as follows:

pvalue=Prob{X2>χp2}

    
    


in which X2 is a random variable that follows a chi-square distribution with freedom degree of Lk−1. Note that importance for feature k within cluster Cj will be undefined if Njk. equals zero.

    
    
        The effect size (Es) is given by equation 60, as follows:
    
    






  
    E
    s
  
  =
  
    
      (
      
        
          χ
          p
          2
        
        
          
            N
            jk
          
          ·
          
            (
            
              
                L
                k
              
              -
              1
            
            )
          
        
      
      )
    
    
      1
      2
    
  




    
    
        
        
            The importance of feature k within cluster Cj is produced using the same mapping function as (42), and default St={0.0, 0.2, 0.6, 1.0}.

Continuous Feature:

For cluster Cj (j=1, . . . ,J) and a continuous feature k, compute t test statistic (t) using equation 61, as follows:

        
        
    
    






  t
  =
  
    
      
        
          μ
          ^
        
        jk
      
      -
      
        
          μ
          ^
        
        k
      
    
    
      
        s
        d
      
      /
      
        
          N
          jk
        
      
    
  




    
    
        Where equation 62 yields sd as follows:
    
    






  
    s
    d
  
  =
  
    
      
        
          N
          jk
        
        
          
            N
            jk
          
          -
          1
        
      
      ⁢
      
        
          σ
          ^
        
        jk
        2
      
    
  




    
    
        Equation 63 yields the pvalue as follows:
    
    






  
    p
    value
  
  =
  
    {
    
      
        
          
            undefined
            ,
          
        
        
          
            if
            ⁢
            
              
            
            ⁢
            both
            ⁢
            
              
            
            ⁢
            the
            ⁢
            
              
            
            ⁢
            numerator
            ⁢
            
              
            
            ⁢
            and
            ⁢
            
              
            
            ⁢
            denominator
          
        
      
      
        
          
            0
            ,
          
        
        
          
            
              
            
            ⁢
            
              
                of
                ⁢
                
                  
                
                ⁢
                t
                ⁢
                
                  
                
                ⁢
                are
                ⁢
                
                  
                
                ⁢
                zero
              
              ;
              
                else
                ⁢
                
                  
                
                ⁢
                if
                ⁢
                
                  
                
                ⁢
                the
                ⁢
                
                  
                
                ⁢
                denominator
              
            
          
        
      
      
        
          
            
              1
              -
              
                Prob
                ⁢
                
                  {
                  
                    
                      
                      
                        T
                        ⁡
                        
                          (
                          
                            
                              N
                              jk
                            
                            -
                            1
                          
                          )
                        
                      
                      
                    
                    ≤
                    
                      
                      t
                      
                    
                  
                  }
                
              
            
            ,
          
        
        
          
            
              
            
            ⁢
            
              
                of
                ⁢
                
                  
                
                ⁢
                t
                ⁢
                
                  
                
                ⁢
                is
                ⁢
                
                  
                
                ⁢
                zero
              
              ;
              
                
              
              ⁢
              
                else
                .
              
            
          
        
      
    
  




in which T(Njk−1) is a random variable that follows a t-distribution with degrees of freedom Njk−1.

    
    
        The effect size (Es) is given by equation 64, as follows:
    
    






  
    E
    s
  
  =
  
    
      
        
          μ
          ^
        
        jk
      
      -
      
        
          μ
          ^
        
        k
      
    
    
      s
      d
    
  




The importance of feature k within cluster Cj is produced using the same mapping function as (equation 42), and default St={0.0, 0.2, 0.6, 1.0}.
Clustering Model Goodness:
Clustering model goodness indicates the quality of a clustering solution. This measure will be computed for the final clustering solution, and it will also be computed for approximate clustering solutions during the process of adaptive feature selection.
Suppose there are J regular clusters, denoted as C1, . . . , CJ. Let l(i) be the regular cluster label assigned to sub-cluster i. Then for each sub-cluster i, the Silhouette coefficient (Si) is computed approximately by equation 65 as follows:




  
    S
    i
  
  =
  
    
      Ω
      -
      Φ
    
    
      max
      ⁡
      
        (
        
          Φ
          ,
          Ω
        
        )
      
    
  




where Φ is the weighted average distance from sub-cluster i to every other sub-cluster assigned to the same regular cluster and is given by equation 66, as follows:




  Φ
  =
  
    
      
        ∑
        
          
            s
            ≠
            
              i
              ⁢
              
                
              
              ⁢
              and
              ⁢
              
                
              
              ⁢
              
                l
                ⁡
                
                  (
                  s
                  )
                
              
            
          
          =
          
            l
            ⁡
            
              (
              i
              )
            
          
        
      
      ⁢
      
        
          N
          s
        
        ⁢
        
          d
          ⁡
          
            (
            
              i
              ,
              s
            
            )
          
        
      
    
    
      
        ∑
        
          
            s
            ≠
            
              i
              ⁢
              
                
              
              ⁢
              and
              ⁢
              
                
              
              ⁢
              
                l
                ⁡
                
                  (
                  s
                  )
                
              
            
          
          =
          
            l
            ⁡
            
              (
              i
              )
            
          
        
      
      ⁢
      
        N
        s
      
    
  




Ω is the minimal average distance from sub-cluster i to sub-clusters in a different regular cluster among all different regular clusters, and is given by equation 67, as follows:




  Ω
  =
  
    min
    ⁢
    
      {
      
        
          
            
              
                
                  ∑
                  
                    
                      l
                      ⁡
                      
                        (
                        s
                        )
                      
                    
                    =
                    
                      C
                      j
                    
                  
                
                ⁢
                
                  
                    N
                    s
                  
                  ⁢
                  
                    d
                    ⁡
                    
                      (
                      
                        i
                        ,
                        s
                      
                      )
                    
                  
                
              
              
                
                  ∑
                  
                    
                      l
                      ⁡
                      
                        (
                        s
                        )
                      
                    
                    =
                    
                      C
                      j
                    
                  
                
                ⁢
                
                  N
                  s
                
              
            
            ❘
            j
          
          =
          1
        
        ,
        ...
        ⁢
        
          
        
        ,
        
          
            J
            ⁢
            
              
            
            ⁢
            and
            ⁢
            
              
            
            ⁢
            
              C
              j
            
          
          ≠
          
            l
            ⁡
            
              (
              i
              )
            
          
        
      
      }
    
  




Clustering model goodness is defined as the weighted average Silhouette coefficient over all starting sub-clusters in the final stage of regular HAC, and is given by equation 68, as follows:




  Goodness
  =
  
    
      
        ∑
        j
      
      ⁢
      
        
          N
          j
        
        ⁢
        
          S
          j
        
      
    
    
      
        ∑
        j
      
      ⁢
      
        N
        j
      
    
  




The average Silhouette coefficient ranges between −1 (indicating a very poor model) and +1 (indicating an excellent model). An average Silhouette greater than 0.5 indicates reasonable partitioning of data; lower than 0.2 means that data does not exhibit cluster structure. In this regard, the following function is used to map Goodness into an interestingness score and is given by equation 69, as follows:

Interestingness(Goodness)=MonotoneCubicInterpolation(St,It,Goodness)

    
    
        where St={−1.0, 0.2, 0.5, 1.0}, and It={0.0, 0.0, 0.5, 1.0}

Special Clusters:

    
    


With the clustering solution, special clusters are found, which could be regular clusters with high quality, extreme outlier clusters, and so on.
Regular Cluster Ranking:
In order to select the most useful or interesting regular clusters, clusters are ranked according to any of the measures described below.
Cluster tightness: Cluster tightness is given by equation (9) or (15). Cluster tightness is not scale-free, and it is a measure of cluster cohesion.
Cluster importance: Cluster importance indicates the quality of the regular cluster in the clustering solution. A higher importance value means a better quality of the regular cluster.
If BIC is used as the information criterion, then the importance for regular cluster Cj (Importancej) is given by equation 70, as follows:

Importancej=1−BICj/BIC(J)

If AIC is used as the information criterion, then the importance for regular cluster Cj (Importancej) is given by equation 71, as follows:

Importancej=1−AICj/AIC(J)

Cluster importance is scale-free and, from certain perspectives, is a normalized measure of cluster cohesion.
Cluster Goodness:
The goodness measure for regular cluster Cj is defined as the weighted average Silhouette coefficient over all starting sub-clusters in regular cluster Cj (Goodnessj) and is given by equation 72, as follows:




  
    Goodness
    j
  
  =
  
    
      
        ∑
        
          
            l
            ⁡
            
              (
              i
              )
            
          
          =
          
            C
            j
          
        
      
      ⁢
      
        
          N
          i
        
        ⁢
        
          S
          i
        
      
    
    
      
        ∑
        
          
            l
            ⁡
            
              (
              i
              )
            
          
          =
          
            C
            j
          
        
      
      ⁢
      
        N
        i
      
    
  




It should be noted that Goodnessj can also be mapped into an interestingness score using equation 69. Cluster goodness is also scale-free, and it is a measure of balancing cluster cohesion and cluster separation.
Outlier Clusters Ranking:
For each outlier cluster, cluster size and outlier strength are determined. Each of the measures can be used to rank outlier clusters.
Outlier Clusters Grouping:
Outlier clusters can be grouped by the nearest regular cluster, using probability values.
Supplemental Section A: Map-Reduce Job for Feature Selection:
Mapper:
Each mapper will handle one data split, and use it to build a local CF-tree. The local CF-tree is assigned with a unique key. Notice that if the option of outlier handling is turned on, outliers will not be passed to reducers in case of feature selection.

    
    
        a. Let TCF(r)(keyr) be the CF-tree with the key of keyr on data split r (r=1, . . . ,R).
    
    


The map function is as follows in table 9:







TABLE 9







Inputs:










- Data split r
// r = 1, ... , R










- keyr
// r = 1, ... , R









<Parameter settings>










- MainMemory
// Default 80*1024 bytes










- OutlierHandling
// {on, off}, default on










- OutlierHandlingDiskSpace
// Default 20% of MainMemory










- OutlierQualification
// Default 10 cases










- DelayedSplit
// {on, off}, default on










- DelayedSplitDiskSpace
// Default 10% of MainMemory










- Adjustment
// Default 1/6










- DistanceMeasure
 // {Log-likelihood, Euclidean}, default









// Log-likelihood










- InitialThreshold
 // Default 0










- NonLeafNodeBranchingFactor
// Default 8










- LeafNodeBranchingFactor
// Default 8










- MaxTreeHeight
// Default 3







Outputs:









- TCF(r)(keyr)







Procedure:


1. Build a CF-tree on data split r based on specified features and settings;


2. Assign keyr to the CF-tree;


3. Export TCF(r)(keyr);









Reducer:

Each reducer can handle several keys. For each key, it first pours together all CF-trees which have the same key. Then the reducer builds approximate clustering solutions iteratively in order to find the most influential features. The selected features are passed to the controller.

    
    
        a. Let F*(keyr) be the set of features produced for the key of keyr, r=1, . . . , R.
    
    


The reduce function for each key is as follows in table 10:







TABLE 10







Inputs:









- TCF(r)(keyr)









<Parameter settings>










- Adjustment
// Default 1/6










- DistanceMeasure
// {Log-likelihood, Euclidean}, default Log-









// likelihood










- AutoClustering
// {on, off}, default on










- MaximumClusterNumber
// Default 15



- MinimumClusterNumber
// Default 2










- FixedClusterNumber
// Default 5










- ClusteringCriterion
// {BIC, AIC}, default BIC










- AutoClusteringMethod
// {information criterion, distance jump,









// maximum, minimum}, default minimum










- DiscardFeatureNumber
// Default 1










- FeatureImportance
// {information criterion, effect size}







Outputs:









- F*(keyr)







Procedure:


1. Let α= DiscardFeatureNumber;


2. Let F(keyr) be the set of all available features, and Goodness be zero;


3. With all leaf entries in CF-tree TCF(r)(keyr) and using features F(keyr),









perform matrix based HAC to get the set of approximate final clusters.



Suppose the number of approximate final clusters is J*, which is determined



automatically or using a fixed one depending on the settings;







4. Compute the goodness measure for the approximate clustering solution;


5. If the computed goodness measure is larger than Goodness,{









 Update Goodness;



 Let F*(keyr) = F(keyr);









Compute feature importance for each feature in F(keyr);



Decompose information criterion and distance measure by features for



each clustering solution along the hierarchical dendrogram with the



number of clusters between Jmin and Jmax;



If AutoClustering is off,{









Find Fα(keyr), the set of the most unimportant α features









in F(keyr);









Let F(keyr) = F(keyr) − Fα(keyr);









}



Else,{









Let Ĵ* = J*, and F_(keyr) = F(keyr);



While Ĵ* ≧ J*,{









Let F(keyr) = F_(keyr);



Find Fα(keyr), the set of the most unimportant α features









in F(keyr);









Let F_(keyr) = F(keyr) − Fα(keyr);









Determine the optimal number of clusters Ĵ* with the set of









features F_(keyr);









}









}









 Go to step 3.









}







6. Export F*(keyr);









Controller:

The controller pours together all sets of features produced by reducers, and selects those features which appear frequently. The selected features will be used in the next map-reduce job to build the final clustering solution. The controller runs the following procedure in Table 11, shown as follows:







TABLE 11







Inputs:









<Parameter settings>










- MinFrequency
// Default 50%







Outputs:










- F*
// Set of selected features







Procedure:


1. Let β= MinFrequency, and F* be empty;


2. Launch a map-reduce job, and get F*(keyr), for r = 1, ... , R from the


reducers;


3. Compute F = ∪r=1R F*(keyr);


4. For each feature in F,









If the occurring frequency is larger than R * β, add the feature



into F*;







5. Export F*;









Supplemental Section B: Map-Reduce Job for Distributed Clustering.

Mapper:

Each mapper will handle one data split, and use it to build a local CF-tree. Once the local CF-tree is built, each leaf entry is checked again for outliers. These outliers, together with cases in disk space S1 and entries in disk space S2 are considered as local outlier candidates.
Local outlier candidates and the local CF-tree will be distributed to a certain reducer. This is achieved by assigning them a key, which is randomly selected from the key set {key1, . . . ,keyQ}. The number of keys Q is computed by (equation 28).
For convenience, in the following, call leaf entries as pre-clusters. Let TCF(r)(keyi) and Sout(r)(keyi) be the CF-tree and the set of outliers, respectively, with the key of keyi (i=1, . . . , Q), on data split r (r=1, . . . , R). The map function is as follows in Table 12, shown as follows.







TABLE 12







Inputs:










- Data split r
// r = 1, ... , R










- keyi
// i = 1, ... , Q









<Parameter settings>










- MainMemory
// Default 80*1024 bytes










- OutlierHandling
// {on, off}, default on










- OutlierHandlingDiskSpace
// Default 20% of MainMemory










- OutlierQualification
// Default 10 cases










- DelayedSplit
// {on, off}, default on










- DelayedSplitDiskSpace
// Default 10% of MainMemory










- Adjustment
// Default 1/6










- DistanceMeasure
// {Log-likelihood, Euclidean}, default









 // Log-likelihood










- InitialThreshold
// Default 0










- NonLeafNodeBranchingFactor
// Default 8










- LeafNodeBranchingFactor
// Default 8










- MaxTreeHeight
// Default 3







Outputs:










- T(r)(keyi)
// Tightness threshold









- TCF(r)(keyi)



- Sout(r)(keyi)







Procedure:


1. Build a CF-tree on data split r based on specified features and settings;


2. If (OutlierHandling=’on’),{









Check the built CF-tree for outlier;



Mark the identified outliers, cases in disk space S1, and entries in disk



space S2 as local outlier candidates;









}







3. Assign keyi to the CF-tree and the set of outlier candidates;


4. Export T(r)(keyi), TCF(r)(keyi), and Sout(r)(keyi);









Reducer:

Each reducer can handle several keys. For each key, it first pours together all CF-trees which have the same key. Then with all leaf entries in the involved CF-trees, it performs a series of CF-tree based HACs to get a specified number of sub-clusters. Finally, the sub-clusters are passed to the controller. The number of sub-clusters produced for each key is computed by (equation 29).
Let Ω(keyi) be the set of data split indices r whose key is keyi, Ssub(keyi) and Sout(keyi) be the set of sub-clusters and the set of outliers, respectively, produced for the key of keyi, i=1, . . . , Q.
The reduce function for each key is as follows in Table 13, shown as follows.







TABLE 13







Inputs:









- T(r)(keyi), r ∈ Ω(keyi)



- TCF(r)(keyi), r ∈ Ω(keyi)



- Sout(r)(keyi), r ∈ Ω(keyi)









<Parameter settings>










- OutlierHandling
// {on, off}, default on










- Adjustment
 // Default 1/6










- DistanceMeasure
// {Log-likelihood, Euclidean}, default Log-









// likelihood










- NumSubClusters
// Number of sub-clusters produced for each key










- MinSubClusters
// Minimum sub-clusters produced for each key









// default 500









- MaximumDataPoitsCFHAC // Maximum data points for HAC, default



  50,000







Outputs:









- Ssub(keyi)



- Sout(keyi)







Procedure:


1. Let J1= NumSubClusters, Cmin= MinSubClusters, and D1=









 MaximumDataPoitsCFHAC;







2. Compute T(keyi) = max{T(r)(keyi),r ∈ Ω(keyi)};


3. Compute SCF(keyi) = {TCF(r)(keyi)|r ∈ Ω(keyi)};


4. If OutlierHandling is ‘on’,{









 Compute Sout(keyi) = ∪r∈Ω(keyi)Sout(r)(keyi);



 For each member in Sout(keyi),{









Find the closest leaf entry in the set of CF-trees SCF(keyi);



If the closest leaf entry can absorb the outlier member without



violating the threshold requirement T(keyi), then merge them, and



updateSout(keyi) and the involved CF-tree;









 }









}







5. Let c1 be the total number of leaf entries in SCF(keyi);









While c1 > D1,{









 Divide the set of CF-trees SCF(keyi) randomly into c2 groups,



 where c2 = ┌c1/D1┐;



 For each group which has a larger number of leaf entries than c3, perform CF-









tree based HAC to get c3 leaf entries, where c3 = └max(D1/c2,Cmin)┘;









 Update SCF(keyi) with new CF-trees produced in the above step;



 Compute the total number of remaining leaf entries c1;









}







6. With the set of CF-trees SCF(keyi), perform CF-tree based HAC to get a set of J1









sub-clusters, i.e. Ssub(keyi);







7. Export Ssub(keyi) and Sout(keyi);









Controller:

The controller pours together all sub-clusters produced by reducers, and performs matrix based HAC to get the final clusters. The controller identifies outlier clusters as well if the option of outlier handling is turned on. Moreover, the controller computes model evaluation measures, and derives insights and interestingness from the clustering results.
The controller runs the following procedure in Table 14, shown as follows.







TABLE 14







Inputs:









<Parameter settings>










- MainMemory
  // Default 80*1024 bytes










- OutlierHandling
// {on, off}, default on










- OutlierHandlingDiskSpace
// Default 20% of MainMemory










- OutlierQualification
  // Default 10 cases










- ExtremeOutlierClusters
// Default 20










- DelayedSplit
// {on, off}, default on










- DelayedSplitDiskSpace
// Default 10% of MainMemory










- Adjustment
// Default 1/6










- DistanceMeasure
  // {Log-likelihood, Euclidean}, default









// Log-likelihood










- InitialThreshold
 // Default 0










- NonLeafNodeBranchingFactor
// Default 8










- LeafNodeBranchingFactor
// Default 8










- MaximumTreeHeight
// Default 3










- AutoClustering
 // {on, off}, default on










- MaximumClusterNumber
// Default 15










- MinimumClusterNumber
// Default 2










- FixedClusterNumber
  // Default 5










- ClusteringCriterion
  // {BIC, AIC}, default BIC










- AutoClusteringMethod
// {information criterion, distance jump,









// maximum, minimum}, default minimum










- MinSubClusters
  // Minimum sub-clusters produced for each key,









// default 500










- MaxDataPoitsCFHAC
// Maximum data points for CF-tree based









HAC,









// default 50,000










- MaxDataPoitsMatrixHAC
// Maximum data points for matrix based









HAC,









// default 5,000







Outputs:









- PMML



- StatXML







Procedure:


1. Let Cmin = MinSubClusters, D1 = MaximumDataPoitsCFHAC, and D2 =









MaximumDataPoitsMatrixHAC;







2. Compute the number of keys









NumKeys = Q = ┌min(R * S/D1, D2/Cmin)┐;



// Each mapper is assigned a key which is selected randomly from the Q keys







3. Compute the number of sub-clusters produced for each key









NumSubClusters = └min(R * S, D2)/Q┘;







4. Launch a map-reduce job, and get Ssub(keyi) and Sout(keyi), for i = 1, ... , Q;


5. Compute Ssub = ∪i=1Q Ssub(keyi);


6. Perform matrix based HAC on Ssub to get the set of final regular clusters Ssub*,









where the number of final clusters is determined automatically or using a fixed



one depending on the settings;







7. If OutlierHandling is ‘on’, perform the steps from 2) to 7) in Step 3 in section 9.3;


8. Compute model evaluation measures, insights, and interestingness;


9. Export the clustering model in PMML, and other statistics in StatXML;









Implementation notes: The general procedure of the controller consists of both the controller procedure in appendix A and that in appendix B.
Supplemental Section C: Procedure for MonotoneCubicInterpolation( ).
f(x)=MonotoneCubicInterpolation(St,It,x)
Where x is the input statistic that characterizes fields or field pairs in particular aspects, e.g. distribution, association strength, etc. Its value range must be bounded below, and it must have a monotonically increasing relationship with the interestingness score threshold values. If the two conditions are not met, then a conversion (e.g. x=−x′ or x=|x|, etc) should be carried out.
St is a set of distinct threshold values for the input statistics, which have been accepted and commonly used by expert users to interpret the statistics. The positive infinity (+∞) is included if the input statistic is not bounded from above.
It is a set of distinct threshold values for the interestingness scores that St corresponds to. The threshold values must be between 0 and 1.
The size of St and It must be the same. There are at least two values in St excluding positive infinity (+∞).
Pre-Processing:


    
    
        Let {xk}=sorted(St) such that x1< . . . <xn, where n is the number of values in St.
        Let {y}=sorted(It) such that y1< . . . <yn.
    
    


Condition A: There are more than two threshold values for input statistics, and they are all finite numbers.
Preparing for Cubic Interpolation:
The following steps should be taken for preparing a cubic interpolation function construction.
Step 1: compute the slopes of the secant lines between successive points.




  
    Δ
    k
  
  =
  
    
      
        y
        
          k
          +
          1
        
      
      -
      
        y
        k
      
    
    
      
        x
        
          k
          +
          1
        
      
      -
      
        x
        k
      
    
  




    
    
        for k=1, . . . , n−1.
    
    


Step 2: Initialize the tangents at every data point as the average of the secants,




  
    m
    k
  
  =
  
    
      
        Δ
        
          k
          -
          1
        
      
      +
      
        Δ
        k
      
    
    2
  




    
    
        for k=2, . . . , n−1; these may be updated in further steps. For the endpoints, use one-sided differences: m1=Δ1 and mn=Δn−1.
    
    


Step 3: let αk=mk/Δk and βk=mk+1/Δk for k=1, . . . , n−1.

    
    
        If α or β are computed to be zero, then the input data points are not strictly monotone. In such cases, piecewise monotone curves can still be generated by choosing mk=mk+1=0, although global strict monotonicity is not possible.
    
    


Step 4: update mk



  
    
      
        
          If
          ⁢
          
            
          
          ⁢
          
            α
            2
          
        
        +
        
          β
          2
        
      
      >
      9
    
    ,
    
      

    
    ⁢
    
      
        then
        ⁢
        
          
        
        ⁢
        set
        ⁢
        
          
        
        ⁢
        
          m
          k
        
      
      =
      
        
          τ
          k
        
        ⁢
        
          α
          k
        
        ⁢
        
          Δ
          k
        
      
    
  




  and




  
    
      m
      
        k
        +
        1
      
    
    =
    
      
        τ
        k
      
      ⁢
      
        β
        k
      
      ⁢
      
        Δ
        k
      
    
  




  where




  
    
      τ
      k
    
    =
    
      
        3
        
          
            
              α
              2
            
            +
            
              β
              2
            
          
        
      
      .
    
  



Note: Only one pass of the algorithm is required. For k=1, . . . , n−1, if Δk=0 (if two successive yk=yk+1 are equal), then set mk=mk+1=0, as the spline connecting these points must be flat to preserve monotonicity. Ignore step 3 and 4 for those k.
Cubic Interpolation:
After the preprocessing, evaluation of the interpolated spline is equivalent to cubic Hermite spline, using the data xk, yk, and mk for k=1, . . . , n.
To evaluate x in the range [xk, xk+1] for k=1, . . . , n−1, calculate:




  h
  =
  
    
      
        x
        
          k
          +
          1
        
      
      -
      
        
          x
          k
        
        ⁢
        
          
        
        ⁢
        and
        ⁢
        
          
        
        ⁢
        t
      
    
    =
    
      
        x
        -
        
          x
          k
        
      
      h
    
  




    
    
        then the interpolant is

f(x)=ykh00(t)+h*mkh10(t)+yk+1h01(t)+h*mk+1h11(t)

        where hii(t) are the basis functions for the cubic Hermite spline (see Table 15, shown as follows).
    
    










TABLE 15







h00(t)
2t3 − 3t2 + 1


h10(t)
t3 − 2t2 + t


h01(t)
−2t3 + 3t2


h11(t)
t3 − t2









Condition B: There are two threshold values for input statistics.
As shown in a previous section(s), there are at least two values in St excluding positive infinity (+∞), they must be both finite numbers when there are only two threshold values.
In this case, the mapping function is a straight line connecting (x1, y1) and (x2, y2).




  
    f
    ⁡
    
      (
      x
      )
    
  
  =
  
    
      y
      1
    
    +
    
      
        (
        
          
            y
            2
          
          -
          
            y
            1
          
        
        )
      
      ⁢
      
        
          x
          -
          
            x
            1
          
        
        
          
            x
            2
          
          -
          
            x
            1
          
        
      
    
  




Condition C: Threshold values include infinity.
Note that there are at least two values in St excluding positive infinity (+∞). Take the last three statistic threshold values and threshold values for the interestingness scores from the sorted lists, yielding three pairs of data (xn−2,yn−2), (xn−1,yn−1,yn−1) and (+∞,yn).
An exponential function, such as:

f(x)=a−be−cx 

    
    
        can be defined by the pairs, where:
    
    





  
    a
    =
    
      y
      n
    
  




  
    b
    =
    
      
        
          
            (
            
              
                y
                n
              
              -
              
                y
                
                  n
                  -
                  2
                
              
            
            )
          
          
            x
            
              n
              -
              1
            
          
        
        /
        
          
            (
            
              
                y
                n
              
              -
              
                y
                
                  n
                  -
                  1
                
              
            
            )
          
          
            x
            
              n
              -
              2
            
          
        
      
      
        (
        
          
            x
            
              n
              -
              1
            
          
          -
          
            x
            
              n
              -
              2
            
          
        
        )
      
    
  




  
    c
    =
    
      
        1
        
          
            x
            
              n
              -
              1
            
          
          -
          
            x
            
              n
              -
              2
            
          
        
      
      ⁢
      ln
      ⁢
      
        
          
            y
            n
          
          -
          
            y
            
              n
              -
              2
            
          
        
        
          
            y
            n
          
          -
          
            y
            
              n
              -
              1
            
          
        
      
    
  



If n=3, which means there are only two distinct values in St excluding positive infinity (+∞), then the exponential function is employed for evaluating x in the range [x1, +∞). Otherwise, the exponential function is for evaluating x in the range [xn−1, +∞).
To evaluate x in the range [x1, xn−1), use procedures under “condition A: There are more than two threshold values for input statistics, and they are all finite numbers” with data set {x1, . . . , xn′} and {y1, . . . , yn′} where n′=n−1. To insure a smooth transition to the exponential function, the tangent mn′ at data point xn′ is given as:



  
    
      m
      
        n
        ′
      
    
    =
    
      
        
          
            d
            
              (
              
                a
                -
                
                  b
                  ⁢
                  
                    
                  
                  ⁢
                  
                    e
                    
                      -
                      cx
                    
                  
                
              
              )
            
          
          
            d
            x
          
        
        ⁢
        
          ❘
          
            x
            =
            
              x
              
                n
                ′
              
            
          
        
      
      =
      
        bc
        ⁢
        
          
        
        ⁢
        
          e
          
            -
            
              cx
              
                n
                ′
              
            
          
        
      
    
  




  again




  
    a
    =
    
      y
      n
    
  




  
    b
    =
    
      
        
          
            (
            
              
                y
                n
              
              -
              
                y
                
                  n
                  -
                  2
                
              
            
            )
          
          
            x
            
              n
              -
              1
            
          
        
        /
        
          
            (
            
              
                y
                n
              
              -
              
                y
                
                  n
                  -
                  1
                
              
            
            )
          
          
            x
            
              n
              -
              2
            
          
        
      
      
        (
        
          
            x
            
              n
              -
              1
            
          
          -
          
            x
            
              n
              -
              2
            
          
        
        )
      
    
  




  
    c
    =
    
      
        1
        
          
            x
            
              n
              -
              1
            
          
          -
          
            x
            
              n
              -
              2
            
          
        
      
      ⁢
      ln
      ⁢
      
        
          
            y
            n
          
          -
          
            y
            
              n
              -
              2
            
          
        
        
          
            y
            n
          
          -
          
            y
            
              n
              -
              1

## Claims

1. A computer program product for outlier detection, the computer program product comprising:
one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, the program instructions comprising:
program instructions to, based, at least in part, on a set of CF-trees, identify a plurality of subsets of CF-trees included in the set of CF-trees;
program instructions to initiate cluster feature (CF)-tree based hierarchical clustering on leaf entries of a plurality of CF-trees included in a given subset of CF-trees, wherein each CF-tree presents a respective set of local data as leaf entries;
program instructions to generate respective partial clustering solutions using the given subset of CF-trees, wherein clustering activity for a resulting CF-tree ceases when a threshold number of sub-clusters has been reached, and wherein a partial clustering solution includes a set of regular sub-clusters that are included in the resulting CF-tree and candidate outlier sub-clusters that contain summaries of sets of data records;
program instructions to generate initial regular clusters by performing hierarchical clustering using the set of regular sub-clusters;
program instructions to determine, for each candidate outlier sub-cluster of a plurality of candidate outlier sub-clusters, a closest initial regular cluster, and a distance separating the respective candidate outlier sub-cluster and the respective closest initial regular cluster; and
program instructions to determine which candidate outlier sub-clusters are outlier clusters based, at least in part, on which candidate outlier sub-clusters have a computed distance to their respective closest initial regular cluster that is greater than a corresponding distance threshold associated with their respective closest initial regular cluster.

2. The computer program product of claim 1, the program instructions further comprising:
program instructions to identify one or more candidate outliers of the CF-trees and their closest leaf entries;
program instructions to determine whether merging a candidate outlier, included in the one or more candidate outliers, with its closest leaf entry will break a maximal tightness threshold; and
program instructions to respond to a determination that merging the candidate outlier with its closest leaf entry will not break the maximal tightness threshold, merging that candidate outlier with its closest leaf entry.

3. The computer program product of claim 1, the program instructions further comprising:
program instructions to merge one or more candidate outlier sub-clusters that are determined not to be outlier clusters with their respective closest initial regular clusters; and
program instructions to update the distance threshold for one or more initial regular clusters that were merged with one or more candidate outlier sub-clusters.

4. The computer program product of claim 1, the program instructions further comprising:
program instructions to determine a measure of outlier strength for candidate outlier sub-clusters.

5. The computer program product of claim 1, the program instructions further comprising:
program instructions to compute an outlier strength for a plurality of outlier clusters; and
program instructions to sort the plurality of outlier clusters according to outlier strength.

6. The computer program product of claim 1, the program instructions further comprising:
program instructions to generate a specified number of outlier clusters, based, at least in part, on one or more of the following measures for each determined outlier cluster: a size of the outlier cluster, an outlier strength of the outlier cluster, and a probability of the outlier cluster belonging to a regular cluster.

7. The computer program product of claim 1, the program instructions to further comprising:
program instructions to determine a minimum outlier strength for a top percent of outlier clusters; and
program instructions to determine whether a new data record is an outlier based, at least in part on a comparison of a determined outlier strength for the new data record and the minimum outlier strength, wherein a determined outlier strength that is above the minimum outlier strength indicates that the new data record is an outlier.

8. A computer system for outlier detection, the computer system comprising:
one or more computer processors;
one or more computer readable storage medium;
program instructions stored on the computer readable storage medium for execution by at least one of the one or more processors, the program instructions comprising:
program instructions to, based, at least in part, on a set of CF-trees, identify a plurality of subsets of CF-trees included in the set of CF-trees;
program instructions to initiate cluster feature (CF)-tree based hierarchical clustering on leaf entries of a plurality of CF-trees included in a given subset of CF-trees, wherein each CF-tree presents a respective set of local data as leaf entries;
program instructions to generate respective partial clustering solutions using the given subset of CF-trees, wherein clustering activity for a resulting CF-tree ceases when a threshold number of sub-clusters has been reached, and wherein a partial clustering solution includes a set of regular sub-clusters that are included in the resulting CF-tree and candidate outlier sub-clusters that contain summaries of sets of data records;
program instructions to generate initial regular clusters by performing hierarchical clustering using the set of regular sub-clusters;
program instructions to, for each candidate outlier sub-cluster of a plurality of candidate outlier sub-clusters, determine a closest initial regular cluster, and a distance separating the respective candidate outlier sub-cluster and the respective closest initial regular cluster; and
program instructions to determine which candidate outlier sub-clusters are outlier clusters based, at least in part, on which candidate outlier sub-clusters have a computed distance to their respective closest initial regular cluster that is greater than a corresponding distance threshold associated with their respective closest initial regular cluster.

9. The computer system of claim 8, the program instructions further comprising:
program instructions to identify one or more candidate outliers of the CF-trees and their closest leaf entries;
program instructions to determine whether merging a candidate outlier, included in the one or more candidate outliers, with its closest leaf entry will break a maximal tightness threshold; and
program instructions to respond to a determination that merging the candidate outlier with its closest leaf entry will not break the maximal tightness threshold, by merging that candidate outlier with its closest leaf entry.

10. The computer system of claim 8, the program instructions further comprising:
program instructions to merge one or more candidate outlier sub-clusters that are determined not to be outlier clusters with their respective closest initial regular clusters; and
program instructions to update the distance threshold for one or more initial regular clusters that were merged with one or more candidate outlier sub-clusters.

11. The computer system of claim 8, the program instructions further comprising:
program instructions to determine a measure of outlier strength for candidate outlier sub-clusters.

12. The computer system of claim 8, the program instructions further comprising:
program instructions to generate a specified number of outlier clusters, based, at least in part, on one or more of the following measures for each determined outlier cluster: a size of the outlier cluster, an outlier strength of the outlier cluster, and a probability of the outlier cluster belonging to a regular cluster.

13. The computer system of claim 8, the program instructions further comprising:
program instructions to determine a minimum outlier strength for a top percent of outlier clusters; and
program instructions to determine whether a new data record is an outlier based, at least in part on a comparison of a determined outlier strength for the new data record and the minimum outlier strength, wherein a determined outlier strength that is above the minimum outlier strength indicates that the new data record is an outlier.

14. The computer system of claim 8, the program instructions further comprising:
program instructions to compute an outlier strength for a plurality of outlier clusters; and
program instructions to sort the plurality of outlier clusters according to outlier strength.