scalation.modeling.clustering

Members list

Type members

Classlikes

enum Algorithm

The Algorithm enum specifies which algorithm to use.

The Algorithm enum specifies which algorithm to use.

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Cluster

The Cluster object is used for creating auto-increment identifiers for cluster ids.

The Cluster object is used for creating auto-increment identifiers for cluster ids.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Cluster.type
case class Cluster(c: Int, var np: Int)

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.

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.

Value parameters

c

the cluster id

np

the number of points in the cluster (size)

Attributes

See also

package.scala for the definition of the 'distance' method

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Clusterer

The Clusterer object provides a simple dataset (matrix of data points) for initial testing of clustering algorithms.

The Clusterer object provides a simple dataset (matrix of data points) for initial testing of clustering algorithms.

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Clusterer.type
trait Clusterer

The Clusterer trait provides a common framework for several clustering algorithms.

The Clusterer trait provides a common framework for several clustering algorithms.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class ClusteringPredictor(x: MatrixD, y: VectorD, fname_: Array[String], hparam: HyperParameter) extends Predictor, Fit

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.

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.

Value parameters

fname_

the names for all features/variables

hparam

the number of nearest neighbors to consider

x

the vectors/points of predictor data stored as rows of a matrix

y

the response value for each vector in x

Attributes

Companion
object
Supertypes
trait Fit
trait FitM
trait Predictor
trait Model
class Object
trait Matchable
class Any
Show all

The ClusteringPredictor companion object provides a factory functions.

The ClusteringPredictor companion object provides a factory functions.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
object GapStatistic

Attributes

See also

web.stanford.edu/~hastie/Papers/gap.pdf

Supertypes
class Object
trait Matchable
class Any
Self type
class HierClusterer(x: MatrixD, k: Int) extends Clusterer

Cluster several vectors/points using hierarchical clustering. Start with each point forming its own cluster and merge clusters until there are only 'k'.

Cluster several vectors/points using hierarchical clustering. Start with each point forming its own cluster and merge clusters until there are only 'k'.

Value parameters

k

stop when the number of clusters equals k

x

the vectors/points to be clustered stored as rows of a matrix

Attributes

Supertypes
trait Clusterer
class Object
trait Matchable
class Any
class KMeansClusterer(x: MatrixD, k: Int, val flags: Array[Boolean]) extends Clusterer

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.

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.

Value parameters

flags

the array of flags used to adjust the algorithm default: no post processing, no immediate return upon change

k

the number of clusters to make

x

the vectors/points to be clustered stored as rows of a matrix

Attributes

See also
Supertypes
trait Clusterer
class Object
trait Matchable
class Any
Known subtypes
class KMeansClusterer2(x: MatrixD, k: Int, flags: Array[Boolean]) extends KMeansClusterer

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.

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.

Value parameters

flags

the flags used to adjust the algorithm

k

the number of clusters to make

x

the vectors/points to be clustered stored as rows of a matrix

Attributes

See also
Supertypes
trait Clusterer
class Object
trait Matchable
class Any
class KMeansClustererHW(x: MatrixD, k: Int, flags: Array[Boolean]) extends KMeansClusterer

The KMeansClustererHW class cluster several vectors/points using the Hartigan-Wong algorithm.

The KMeansClustererHW class cluster several vectors/points using the Hartigan-Wong algorithm.

Value parameters

flags

the flags used to adjust the algorithm

k

the number of clusters to make

x

the vectors/points to be clustered stored as rows of a matrix

Attributes

Supertypes
trait Clusterer
class Object
trait Matchable
class Any
Known subtypes
class KMeansClustererPP(x: MatrixD, k: Int, flags: Array[Boolean]) extends KMeansClustererHW

The KMeansClustererPP class cluster several vectors/points using the Hartigan-Wong algorithm.

The KMeansClustererPP class cluster several vectors/points using the Hartigan-Wong algorithm.

Value parameters

flags

the flags used to adjust the algorithm

k

the number of clusters to make

x

the vectors/points to be clustered stored as rows of a matrix

Attributes

Supertypes
trait Clusterer
class Object
trait Matchable
class Any
Show all
class KMeansPPClusterer(x: MatrixD, k: Int, algo: Algorithm, flags: Array[Boolean]) extends KMeansClusterer

Value parameters

algo

the clustering algorithm to use

flags

the flags used to adjust the algorithm

k

the number of clusters to make

x

the vectors/points to be clustered stored as rows of a matrix

Attributes

See also
Companion
object
Supertypes
trait Clusterer
class Object
trait Matchable
class Any

The KMeansPPClusterer companion object supplies a factory function.

The KMeansPPClusterer companion object supplies a factory function.

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

The KMeansPPClustererTester object includes test methods to aid in the testing of the KMeansPPClusterer class.

The KMeansPPClustererTester object includes test methods to aid in the testing of the KMeansPPClusterer class.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
class MarkovClusterer(t: MatrixD, k: Int, r: Double) extends Clusterer

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.

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.

Value parameters

k

the strength of expansion

r

the strength of inflation

t

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

Attributes

Supertypes
trait Clusterer
class Object
trait Matchable
class Any
class RandomGraph(n: Int, p: Double, c: Int)

The RandomGraph class generates random undirected graphs with clusters (as adjacency matrices).

The RandomGraph class generates random undirected graphs with clusters (as adjacency matrices).

Value parameters

c

the number of clusters to generate

n

the number of nodes in the graph

p

the probability that any two nodes are connected

Attributes

Supertypes
class Object
trait Matchable
class Any
class TightClusterer(x: MatrixD, k0: Int, kmin: Int, s: Int)

The TightClusterer class uses tight clustering to eliminate points that do not not fit well in any cluster.

The TightClusterer class uses tight clustering to eliminate points that do not not fit well in any cluster.

Value parameters

k0

the number of clusters to make

kmin

the minimum number of clusters to make

s

the random number stream (to vary the clusters made)

x

the vectors/points to be clustered stored as rows of a matrix

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
final class gapStatisticTest

Attributes

Supertypes
class Object
trait Matchable
class Any
final class gapStatisticTest2

Attributes

Supertypes
class Object
trait Matchable
class Any
final class hierClustererTest

Attributes

Supertypes
class Object
trait Matchable
class Any
final class hierClustererTest2

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClusterer2Test

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClusterer2Test2

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClusterer2Test3

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClusterer2Test4

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClustererHWTest

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClustererPPTest

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClustererTest

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClustererTest2

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClustererTest3

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansClustererTest4

Attributes

Supertypes
class Object
trait Matchable
class Any
final class kMeansPPClustererTest

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any

Attributes

Supertypes
class Object
trait Matchable
class Any
final class markovClustererTest

Attributes

Supertypes
class Object
trait Matchable
class Any
final class markovClustererTest2

Attributes

Supertypes
class Object
trait Matchable
class Any
final class randomGraphTest

Attributes

Supertypes
class Object
trait Matchable
class Any
final class tightClustererTest

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

The clusteringPredictorTest object is used to test the ClusteringPredictor class.

The clusteringPredictorTest object is used to test the ClusteringPredictor class.

runMain scalation.modeling.clustering.clusteringPredictorTest

Attributes

The clusteringPredictorTest2 object is used to test the ClusteringPredictor class.

The clusteringPredictorTest2 object is used to test the ClusteringPredictor class.

runMain scalation.modeling.clustering.clusteringPredictorTest2

Attributes

The clusteringPredictorTest3 object is used to test the ClusteringPredictor class. Test on AutoMPG dataset and compare with KNN_Regression.

The clusteringPredictorTest3 object is used to test the ClusteringPredictor class. Test on AutoMPG dataset and compare with KNN_Regression.

runMain scalation.modeling.clustering.clusteringPredictorTest3

Attributes

inline def dist(x: VectorD, z: VectorD): Double

Compute a distance metric (e.g., distance squared) between vectors/points x and z. Override this methods to use a different metric, e.g., norm - the Euclidean distance, 2-norm norm1 - the Manhattan distance, 1-norm Currently uses squared Euclidean norm used for efficiency, may use other norms.

Compute a distance metric (e.g., distance squared) between vectors/points x and z. Override this methods to use a different metric, e.g., norm - the Euclidean distance, 2-norm norm1 - the Manhattan distance, 1-norm Currently uses squared Euclidean norm used for efficiency, may use other norms.

Value parameters

x

the first vector/point

z

the second vector/point

Attributes

def gapStatisticTest(): Unit

The gapStatisticTest main function is used to test the GapStatistic object.

The gapStatisticTest main function is used to test the GapStatistic object.

runMain scalation.modeling.clustering.gapStatisticTest

Attributes

def gapStatisticTest2(): Unit

The gapStatisticTest2 main function is used to test the GapStatistic object.

The gapStatisticTest2 main function is used to test the GapStatistic object.

runMain scalation.modeling.clustering.gapStatisticTest2

Attributes

def hierClustererTest(): Unit

The hierClustererTest object is used to test the HierClusterer class.

The hierClustererTest object is used to test the HierClusterer class.

runMain scalation.modeling.clustering.hierClustererTest

Attributes

def hierClustererTest2(): Unit

The hierClustererTest2 object is used to test the HierClusterer class.

The hierClustererTest2 object is used to test the HierClusterer class.

runMain scalation.modeling.clustering.hierClustererTest2

Attributes

def kMeansClusterer2Test(): Unit

The kMeansClusterer2Test object is used to test the KMeansClusterer2 class.

The kMeansClusterer2Test object is used to test the KMeansClusterer2 class.

runMain scalation.modeling.clusterer.kMeansClusterer2Test

Attributes

def kMeansClusterer2Test2(): Unit

The kMeansClusterer2Test2 object is used to test the KMeansClusterer2 class.

The kMeansClusterer2Test2 object is used to test the KMeansClusterer2 class.

runMain scalation.modeling.clusterer.kMeansClusterer2Test2

Attributes

def kMeansClusterer2Test3(): Unit

The kMeansClusterer2Test2 object is used to test the KMeansClusterer2 class.

The kMeansClusterer2Test2 object is used to test the KMeansClusterer2 class.

runMain scalation.modeling.clustering.kMeansClusterer2Test3

Attributes

def kMeansClusterer2Test4(): Unit

The kMeansClusterer2Test4 object is used to test the KMeansClusterer2 class.

The kMeansClusterer2Test4 object is used to test the KMeansClusterer2 class.

runMain scalation.modeling.clustering.kMeansClusterer2Test4

Attributes

def kMeansClustererHWTest(): Unit

The kMeansClustererTestHW object is used to test the KMeansClustererHW class.

The kMeansClustererTestHW object is used to test the KMeansClustererHW class.

runMain scalation.modeling.clustering.kMeansClustererHWTest

Attributes

The kMeansClustererHWTest2 object is used to test the KMeansClustererHW class.

The kMeansClustererHWTest2 object is used to test the KMeansClustererHW class.

runMain scalation.modeling.clustering.kMeansClustererHWTest2

Attributes

The kMeansClustererHWTest3 object is used to test the KMeansClustererHW class.

The kMeansClustererHWTest3 object is used to test the KMeansClustererHW class.

runMain scalation.modeling.clustering.kMeansClustererHWTest3

Attributes

def kMeansClustererPPTest(): Unit

The kMeansClustererTestPP object is used to test the KMeansClustererPP class.

The kMeansClustererTestPP object is used to test the KMeansClustererPP class.

runMain scalation.modeling.clustering.kMeansClustererPPTest

Attributes

The kMeansClustererPPTest object is used to test the KMeansClustererPP class.

The kMeansClustererPPTest object is used to test the KMeansClustererPP class.

runMain scalation.modeling.clustering.kMeansClustererPPTest2

Attributes

The kMeansClustererPPTest3 object is used to test the KMeansClustererPP class.

The kMeansClustererPPTest3 object is used to test the KMeansClustererPP class.

runMain scalation.modeling.clustering.kMeansClustererPPTest3

Attributes

def kMeansClustererTest(): Unit

The kMeansClustererTest object is used to test the KMeansClusterer class.

The kMeansClustererTest object is used to test the KMeansClusterer class.

runMain scalation.modeling.clustering.kMeansClustererTest

Attributes

def kMeansClustererTest2(): Unit

The kMeansClustererTest2 object is used to test the KMeansClusterer class.

The kMeansClustererTest2 object is used to test the KMeansClusterer class.

runMain scalation.modeling.clustering.kMeansClustererTest2

Attributes

def kMeansClustererTest3(): Unit

The kMeansClustererTest3 object is used to test the KMeansClusterer class.

The kMeansClustererTest3 object is used to test the KMeansClusterer class.

runMain scalation.modeling.clustering.kMeansClustererTest3

Attributes

def kMeansClustererTest4(): Unit

The kMeansClustererTest4 object is used to test the KMeansClusterer class.

The kMeansClustererTest4 object is used to test the KMeansClusterer class.

runMain scalation.modeling.clustering.kMeansClustererTest4

Attributes

def kMeansPPClustererTest(): Unit

The kMeansPPClustererTest main function is used to test the KMeansPPClusterer class.

The kMeansPPClustererTest main function is used to test the KMeansPPClusterer class.

runMain scalation.modeling.clustering.kMeansPPClustererTest

Attributes

The kMeansPPClustererTest2 main function is used to test the KMeansPPClusterer class.

The kMeansPPClustererTest2 main function is used to test the KMeansPPClusterer class.

runMain scalation.modeling.clustering.kMeansPPClustererTest2

Attributes

The kMeansPPClustererTest3 main function is used to test the KMeansPPClusterer class.

The kMeansPPClustererTest3 main function is used to test the KMeansPPClusterer class.

runMain scalation.modeling.clustering.kMeansPPClustererTest3

Attributes

The kMeansPPClustererTest4 main function is used to test the KMeansPPClusterer class.

The kMeansPPClustererTest4 main function is used to test the KMeansPPClusterer class.

runMain scalation.modeling.clustering.kMeansPPClustererTest4

Attributes

def markovClustererTest(): Unit

The markovClustererTest object is used to test the MarkovClusterer class.

The markovClustererTest object is used to test the MarkovClusterer class.

Attributes

See also

www.cs.ucsb.edu/~xyan/classes/CS595D-2009winter/MCL_Presentation2.pdf ^ > runMain scalation.modeling.clustering.markovClustererTest

def markovClustererTest2(): Unit

The markovClustererTest2 object is used to test the MarkovClusterer class. ^ > runMain scalation.modeling.clustering.markovClustererTest2

The markovClustererTest2 object is used to test the MarkovClusterer class. ^ > runMain scalation.modeling.clustering.markovClustererTest2

Attributes

def randomGraphTest(): Unit

The randomGraphTest object is used to test the RandomGraph class.

The randomGraphTest object is used to test the RandomGraph class.

runMain scalation.modeling.clustering.randomGraphTest

Attributes

def tightClustererTest(): Unit

The tightClustererTest main function is used to test the TightClusterer class.

The tightClustererTest main function is used to test the TightClusterer class.

runMain scalation.modeling.clustering.tightClustererTest

Attributes