package clusterer
The clusterer
package contains classes, traits and objects for clustering
algorithms.
- Alphabetic
- By Inheritance
- clusterer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Cluster(c: Int = Cluster.next (), np: Int = 0) extends Error with Product with Serializable
The
Cluster
case class maintains information about clusters, the cluster id, center/centroid, cluster size, and measure of error.The
Cluster
case class maintains information about clusters, the cluster id, center/centroid, cluster size, and measure of error. Note: the cluster assignment function as an array 'to_c' indicates how points are assigned to clusters.- c
the cluster id
- np
the number of points in the cluster (size)
- See also
package.scala
for the definition of the 'distance' method
-
trait
Clusterer extends AnyRef
The
Clusterer
trait provides a common framework for several clustering algorithms.The
Clusterer
trait provides a common framework for several clustering algorithms.- See also
package.scala
for 'distance' function
-
class
ClusteringPredictor extends PredictorMat
The
ClusteringPredictor
class is used to predict a response value for new vector 'z'.The
ClusteringPredictor
class is used to predict a response value for new vector 'z'. It works by finding the cluster that the point 'z' would belong to. The recorded response value for 'y' is then given as the predicted response. The per cluster recorded reponse value is the consensus (e.g., average) of the individual predictions for 'z' from the members of the cluster. Training involves clustering the points in data matrix 'x' and then computing each clusters reponse. -
class
HierClusterer extends Clusterer with Error
Cluster several vectors/points using hierarchical clustering.
Cluster several vectors/points using hierarchical clustering. Start with each point forming its own cluster and merge clusters until there are only 'k'.
-
class
KMeansClusterer extends Clusterer with Error
The
KMeansClusterer
class cluster several vectors/points using k-means clustering.The
KMeansClusterer
class cluster several vectors/points using k-means clustering. Randomly assign points to 'k' clusters (primary technique). Iteratively, reassign each point to the cluster containing the closest centroid. Stop when there are no changes to the clusters.- See also
KMeansClusterer2
for secondary technique. -----------------------------------------------------------------------------
-
class
KMeansClusterer2 extends KMeansClusterer
The
KMeansClusterer2
class cluster several vectors/points using k-means clustering.The
KMeansClusterer2
class cluster several vectors/points using k-means clustering. Randomly pick 'k' points as initial centroids (secondary technique). Iteratively, reassign each point to the cluster containing the closest centroid. Stop when there are no changes to the clusters.- See also
KMeansClusterer
for primary technique. -----------------------------------------------------------------------------
-
class
KMeansClustererHW extends KMeansClusterer
The
KMeansClustererHW
class cluster several vectors/points using the Hartigan-Wong algorithm. -
class
KMeansClustererPP extends KMeansClustererHW
The
KMeansClustererPP
class cluster several vectors/points using the Hartigan-Wong algorithm. -
class
KMeansClustererSSE extends Clusterer with Error
The
KMeansClustererSSE
class cluster several vectors/points using k-means clustering.The
KMeansClustererSSE
class cluster several vectors/points using k-means clustering. Randomly assign points to 'k' clusters (primary technique). Iteratively, reassign each point to the cluster containing the closest centroid. Stop when there are no changes to the clusters.- See also
KMeansClusterer2
for secondary technique. -----------------------------------------------------------------------------
-
class
KMeansPPClusterer extends KMeansClusterer
The
KMeansPPClusterer
class cluster several vectors/points using the k-means++ clustering technique.The
KMeansPPClusterer
class cluster several vectors/points using the k-means++ clustering technique. ------------------------------------------------------------------------------ See also
ilpubs.stanford.edu:8090/778/1/2006-13.pdf -----------------------------------------------------------------------------
-
trait
KMeansPPClustererTester extends AnyRef
The
KMeansPPClustererTester
trait includes atest
function to aid in the testing of theKMeansPPClusterer
class. -
class
MarkovClusterer extends Clusterer with Error
The
MarkovClusterer
class implements a Markov Clustering Algorithm 'MCL' and is used to cluster nodes in a graph.The
MarkovClusterer
class implements a Markov Clustering Algorithm 'MCL' and is used to cluster nodes in a graph. The graph is represented as an edge-weighted adjacency matrix (a non-zero cell indicates nodes i and j are connected).The primary constructor takes either a graph (adjacency matrix) or a Markov transition matrix as input. If a graph is passed in, the normalize method must be called to convert it into a Markov transition matrix. Before normalizing, it may be helpful to add self loops to the graph. The matrix (graph or transition) may be either dense or sparse. See the
MarkovClustererTest
object at the bottom of the file for examples. -
class
RandomGraph extends AnyRef
The
RandomGraph
class generates random undirected graphs with clusters (as adjacency matrices). -
class
TightClusterer extends AnyRef
The
TightClusterer
class uses tight clustering to eliminate points that do not not fit well in any cluster.
Value Members
-
def
dist(u: VectoD, v: VectoD): Double
Compute a distance metric (e.g., distance squared) between vectors/points 'u' and 'v'.
Compute a distance metric (e.g., distance squared) between vectors/points 'u' and 'v'. Override this methods to use a different metric, e.g., 'norm' - the Euclidean distance, 2-norm 'norm1' - the Manhattan distance, 1-norm
- u
the first vector/point
- v
the second vector/point
-
object
Algorithm extends Enumeration
The
Algorithm
object specifies which algorithm to use. -
object
Cluster extends Serializable
The
Cluster
object is used for creating auto-increment identifiers for cluster ids. -
object
Clusterer
The
Clusterer
provides a simple dataset (matrix of data points) for initial testing of clustering algorithms. -
object
ClusteringPredictor
The
ClusteringPredictor
companion object provides a factory functions. -
object
ClusteringPredictorTest extends App
The
ClusteringPredictorTest
object is used to test theClusteringPredictor
class.The
ClusteringPredictorTest
object is used to test theClusteringPredictor
class. > runMain scalation.analytics.clusterer.ClusteringPredictorTest -
object
ClusteringPredictorTest2 extends App
The
ClusteringPredictorTest2
object is used to test theClusteringPredictor
class.The
ClusteringPredictorTest2
object is used to test theClusteringPredictor
class. > runMain scalation.analytics.clusterer.ClusteringPredictorTest2 -
object
ClusteringPredictorTest3 extends App
The
ClusteringPredictorTest3
object is used to test theClusteringPredictor
class.The
ClusteringPredictorTest3
object is used to test theClusteringPredictor
class. Test on AutoMPG dataset and compare withKNN_Predictor
. > runMain scalation.analytics.clusterer.ClusteringPredictorTest3 -
object
GapStatistic
The
GapStatistic
object is used to help determine the optimal number of clusters for a clusterer by comparing results to a reference distribution.The
GapStatistic
object is used to help determine the optimal number of clusters for a clusterer by comparing results to a reference distribution. ------------------------------------------------------------------------------ See also
web.stanford.edu/~hastie/Papers/gap.pdf
-
object
GapStatisticTest extends App
The
GapStatisticTest
object is used to test theGapStatistic
object.The
GapStatisticTest
object is used to test theGapStatistic
object. > runMain scalation.analytics.clusterer.GapStatisticTest -
object
GapStatisticTest2 extends App
The
GapStatisticTest2
object is used to test theGapStatistic
object.The
GapStatisticTest2
object is used to test theGapStatistic
object. > runMain scalation.analytics.clusterer.GapStatisticTest2 -
object
HierClustererTest extends App
The
HierClusterer
object is used to test theHierClusterer
class.The
HierClusterer
object is used to test theHierClusterer
class. > runMain scalation.analytics.clusterer.HierClustererTest -
object
HierClustererTest2 extends App
The
HierClustererTest2
object is used to test theHierClusterer
class.The
HierClustererTest2
object is used to test theHierClusterer
class. > runMain scalation.analytics.clusterer.HierClustererTest2 -
object
KMeansClusterer2Test extends App
The
KMeansClusterer2Test2
object is used to test theKMeansClusterer2
class.The
KMeansClusterer2Test2
object is used to test theKMeansClusterer2
class. > runMain scalation.analytics.clusterer.KMeansClusterer2Test -
object
KMeansClusterer2Test2 extends App
The
KMeansClusterer2Test2
object is used to test theKMeansClusterer2
class.The
KMeansClusterer2Test2
object is used to test theKMeansClusterer2
class. > runMain scalation.analytics.clusterer.KMeansClusterer2Test2 -
object
KMeansClusterer2Test3 extends App
The
KMeansClusterer2Test2
object is used to test theKMeansClusterer2
class.The
KMeansClusterer2Test2
object is used to test theKMeansClusterer2
class. > runMain scalation.analytics.clusterer.KMeansClusterer2Test3 -
object
KMeansClusterer2Test4 extends App
The
KMeansClusterer2Test4
object is used to test theKMeansClusterer2
class.The
KMeansClusterer2Test4
object is used to test theKMeansClusterer2
class. > runMain scalation.analytics.clusterer.KMeansClusterer2Test4 -
object
KMeansClustererHWTest extends App
The
KMeansClustererTestHW
object is used to test theKMeansClustererHW
class.The
KMeansClustererTestHW
object is used to test theKMeansClustererHW
class. > runMain scalation.analytics.clusterer.KMeansClustererHWTest -
object
KMeansClustererHWTest2 extends App
The
KMeansClustererHWTest2
object is used to test theKMeansClustererHW
class.The
KMeansClustererHWTest2
object is used to test theKMeansClustererHW
class. > runMain scalation.analytics.clusterer.KMeansClustererHWTest2 -
object
KMeansClustererHWTest3 extends App
The
KMeansClustererHWTest3
object is used to test theKMeansClustererHW
class.The
KMeansClustererHWTest3
object is used to test theKMeansClustererHW
class. > runMain scalation.analytics.clusterer.KMeansClustererHWTest3 -
object
KMeansClustererPPTest extends App
The
KMeansClustererTestPP
object is used to test theKMeansClustererPP
class.The
KMeansClustererTestPP
object is used to test theKMeansClustererPP
class. > runMain scalation.analytics.clusterer.KMeansClustererPPTest -
object
KMeansClustererPPTest2 extends App
The
KMeansClustererPPTest
object is used to test theKMeansClustererPP
class.The
KMeansClustererPPTest
object is used to test theKMeansClustererPP
class. > runMain scalation.analytics.clusterer.KMeansClustererPPTest2 -
object
KMeansClustererPPTest3 extends App
The
KMeansClustererPPTest3
object is used to test theKMeansClustererPP
class.The
KMeansClustererPPTest3
object is used to test theKMeansClustererPP
class. > runMain scalation.analytics.clusterer.KMeansClustererPPTest3 -
object
KMeansClustererSSETest extends App
The
KMeansClustererSSETest
object is used to test theKMeansClustererSSE
class.The
KMeansClustererSSETest
object is used to test theKMeansClustererSSE
class. > runMain scalation.analytics.clusterer.KMeansClustererSSETest -
object
KMeansClustererSSETest2 extends App
The
KMeansClustererSSETest2
object is used to test theKMeansClustererSSE
class.The
KMeansClustererSSETest2
object is used to test theKMeansClustererSSE
class. > runMain scalation.analytics.clusterer.KMeansClustererSSETest2 -
object
KMeansClustererSSETest3 extends App
The
KMeansClustererSSETest2
object is used to test theKMeansClustererSSE
class.The
KMeansClustererSSETest2
object is used to test theKMeansClustererSSE
class. > runMain scalation.analytics.clusterer.KMeansClustererSSETest3 -
object
KMeansClustererSSETest4 extends App
The
KMeansClustererSSETest4
object is used to test theKMeansClustererSSE
class.The
KMeansClustererSSETest4
object is used to test theKMeansClustererSSE
class. > runMain scalation.analytics.clusterer.KMeansClustererSSETest4 -
object
KMeansClustererTest extends App
The
KMeansClustererTest
object is used to test theKMeansClusterer
class.The
KMeansClustererTest
object is used to test theKMeansClusterer
class. > runMain scalation.analytics.clusterer.KMeansClustererTest -
object
KMeansClustererTest2 extends App
The
KMeansClustererTest2
object is used to test theKMeansClusterer
class.The
KMeansClustererTest2
object is used to test theKMeansClusterer
class. > runMain scalation.analytics.clusterer.KMeansClustererTest2 -
object
KMeansClustererTest3 extends App
The
KMeansClustererTest2
object is used to test theKMeansClusterer
class.The
KMeansClustererTest2
object is used to test theKMeansClusterer
class. > runMain scalation.analytics.clusterer.KMeansClustererTest3 -
object
KMeansClustererTest4 extends App
The
KMeansClustererTest4
object is used to test theKMeansClusterer
class.The
KMeansClustererTest4
object is used to test theKMeansClusterer
class. > runMain scalation.analytics.clusterer.KMeansClustererTest4 -
object
KMeansPPClusterer
The
KMeansPPClusterer
companion object supplies a factory function. -
object
KMeansPPClustererTest extends App with KMeansPPClustererTester
The
KMeansPPClustererTest
object is used to test theKMeansPlusPlusClusterer
class.The
KMeansPPClustererTest
object is used to test theKMeansPlusPlusClusterer
class. > runMain scalation.analytics.clusterer.KMeansPPClustererTest -
object
KMeansPPClustererTest2 extends App with KMeansPPClustererTester
The
KMeansPPClustererTest2
object is used to test theKMeansPlusPlusClusterer
class.The
KMeansPPClustererTest2
object is used to test theKMeansPlusPlusClusterer
class. > runMain scalation.analytics.clusterer.KMeansPPClustererTest2 -
object
KMeansPPClustererTest3 extends App with KMeansPPClustererTester
The
KMeansPPClustererTest3
object is used to test theKMeansPlusPlusClusterer
class.The
KMeansPPClustererTest3
object is used to test theKMeansPlusPlusClusterer
class. > runMain scalation.analytics.clusterer.KMeansPPClustererTest3 -
object
KMeansPPClustererTest4 extends App with KMeansPPClustererTester
The
KMeansPPClustererTest4
object is used to test theKMeansPlusPlusClusterer
class.The
KMeansPPClustererTest4
object is used to test theKMeansPlusPlusClusterer
class. > runMain scalation.analytics.clusterer.KMeansPPClustererTest4 -
object
MarkovClustererTest extends App
The
MarkovClustererTest
object is used to test theMarkovClusterer
class.The
MarkovClustererTest
object is used to test theMarkovClusterer
class.- See also
www.cs.ucsb.edu/~xyan/classes/CS595D-2009winter/MCL_Presentation2.pdf ^ > runMain scalation.analytics.clusterer.MarkovClustererTest
-
object
MarkovClustererTest2 extends App
The
MarkovClustererTest2
object is used to test theMarkovClusterer
class.The
MarkovClustererTest2
object is used to test theMarkovClusterer
class. ^ > runMain scalation.analytics.clusterer.MarkovClustererTest2 -
object
RandomGraphTest extends App
The
RandomGraphTest
object is used to test theRandomGraph
class.The
RandomGraphTest
object is used to test theRandomGraph
class. > runMain scalation.analytics.cluterer.RandomGraphTest -
object
TightClustererTest extends App
The
TightClustererTest
is used to test theTightClusterer
class.The
TightClustererTest
is used to test theTightClusterer
class. > runMain scalation.analytics.clusterer.TightClustererTest