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 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.

Linear Supertypes
Error, Clusterer, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MarkovClusterer
  2. Error
  3. Clusterer
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MarkovClusterer(t: MatrixD, k: Int = 2, r: Double = 2.0)

    t

    either an adjacency matrix of a graph or a Markov transition matrix

    k

    the strength of expansion

    r

    the strength of inflation

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addSelfLoops(weight: Double = 1.0): Unit

    Add self-loops by setting the main diagonal to the weight parameter.

    Add self-loops by setting the main diagonal to the weight parameter.

    weight

    the edge weight on self-loops to be added.

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def calcCentroids(x: MatriD, to_c: Array[Int], sz: VectoI, cent: MatriD): Unit

    Calculate the centroids based on current assignment of points to clusters and update the 'cent' matrix that stores the centroids in its rows.

    Calculate the centroids based on current assignment of points to clusters and update the 'cent' matrix that stores the centroids in its rows.

    x

    the data matrix holding the points {x_i = x(i)} in its rows

    to_c

    the cluster assignment array

    sz

    the sizes of the clusters (number of points)

    cent

    the matrix holding the centroids in its rows

    Definition Classes
    Clusterer
  7. def centroids: MatriD

    Return the centroids.

    Return the centroids. Should only be called after 'train'.

    Definition Classes
    MarkovClustererClusterer
  8. def checkOpt(x: MatriD, to_c: Array[Int], opt: Double): Boolean

    Check to see if the sum of squared errors is optimum.

    Check to see if the sum of squared errors is optimum.

    x

    the data matrix holding the points

    to_c

    the cluster assignments

    opt

    the known (from human/oracle) optimum

    Definition Classes
    Clusterer
  9. def classify(y: VectoD): Int

    This clustering method is not applicable to graph clustering.

    This clustering method is not applicable to graph clustering.

    y

    unused parameter

    Definition Classes
    MarkovClustererClusterer
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  11. def cluster: Array[Int]

    Return the cluster assignment vector.

    Return the cluster assignment vector. Should only be called after train.

    Definition Classes
    MarkovClustererClusterer
  12. def csize: VectoI

    Return the sizes of the centroids.

    Return the sizes of the centroids. Should only be called after 'train'.

    Definition Classes
    MarkovClustererClusterer
  13. def distance(u: VectoD, cn: MatriD, kc_: Int = -1): VectoD

    Compute the distances between vector/point 'u' and the points stored as rows in matrix 'cn'

    Compute the distances between vector/point 'u' and the points stored as rows in matrix 'cn'

    u

    the given vector/point (u = x_i)

    cn

    the matrix holding several centroids

    kc_

    the number of centroids so far

    Definition Classes
    Clusterer
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  16. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def initCentroids(): Boolean
    Definition Classes
    Clusterer
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def name(c: Int): String

    Return the name of the 'c'-th cluster.

    Return the name of the 'c'-th cluster.

    c

    the c-th cluster

    Definition Classes
    Clusterer
  22. def name_(nm: Strings): Unit

    Set the names for the clusters.

    Set the names for the clusters.

    nm

    the array of names

    Definition Classes
    Clusterer
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. def normalize(): Unit

    Normalize the matrix t so that each column sums to 1, i.e., convert the adjacency matrix of a graph into a Markov transition matrix.

  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  27. def processMatrix(): MatriD

    Return the processed matrix t.

    Return the processed matrix t. The matrix is processed by repeated steps of expansion and inflation until convergence is detected.

  28. def setStream(s: Int): Unit

    Set the random stream to 's'.

    Set the random stream to 's'. Method must be called in implemeting classes before creating any random generators.

    s

    the new value for the random number stream

    Definition Classes
    Clusterer
  29. def sse(x: MatriD, c: Int, to_c: Array[Int]): Double

    Compute the sum of squared errors from the points in cluster 'c' to the cluster's centroid.

    Compute the sum of squared errors from the points in cluster 'c' to the cluster's centroid.

    x

    the data matrix holding the points

    c

    the current cluster

    to_c

    the cluster assignments

    Definition Classes
    Clusterer
  30. def sse(x: MatriD, to_c: Array[Int]): Double

    Compute the sum of squared errors within all clusters, where error is indicated by e.g., the distance from a point to its centroid.

    Compute the sum of squared errors within all clusters, where error is indicated by e.g., the distance from a point to its centroid.

    x

    the data matrix holding the points

    to_c

    the cluster assignments

    Definition Classes
    Clusterer
  31. def sst(x: MatriD): Double

    Compute the sum of squares total for all the points from the mean.

    Compute the sum of squares total for all the points from the mean.

    x

    the data matrix holding the points

    Definition Classes
    Clusterer
  32. val stream: Int
    Attributes
    protected
    Definition Classes
    Clusterer
  33. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. def train(): MarkovClusterer

    Cluster the nodes in the graph by interpreting the processed matrix t.

    Cluster the nodes in the graph by interpreting the processed matrix t. Nodes not clustered will be in group 0; otherwise, they will be grouped with their strongest positive attractor.

    Definition Classes
    MarkovClustererClusterer
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Error

Inherited from Clusterer

Inherited from AnyRef

Inherited from Any

Ungrouped