public class ClusterKDDMatrix extends KDDMatrix
The ClusterKDDMatrix is a subclass of KDDMatrix that provides a cluster method that produces a set of Clusters.
Constructor and Description |
---|
ClusterKDDMatrix()
The Constructor
|
ClusterKDDMatrix(java.util.ArrayList<java.lang.Double> elements,
int nRows,
int nCols) |
ClusterKDDMatrix(IDataProvider data)
The constructor, takes a valid set of IData and constructs this matrix.
|
ClusterKDDMatrix(IDataProvider data,
DistanceMeasure measure)
The constructor, for injecting a realization of the DistanceMeasure
interface.
|
Modifier and Type | Method and Description |
---|---|
void |
cluster(int nClusters,
int nIterations)
This method performs a KMeans cluster algorithm on this matrix-structured
data set.
|
void |
copy(KDDMatrix other)
Create a copy of this KDDMatrix and return it.
|
java.util.ArrayList<KDDMatrix> |
getClusterMeans()
Return the cluster mean vectors.
|
int |
getNumberOfClusterElements(int index)
Return the number of elements in the cluster indexed by the argument.
|
int |
getNumberOfClusters()
Return the number of Clusters.
|
boolean |
isClustered()
This method indicates whether or not this matrix has been clustered.
|
java.net.URI |
plot()
Plot this data and return the URI to the corresponding plot.
|
void |
scaleData(int dimensions)
This method allows this ClusterKDDMatrix to perform a multi-dimensional
scaling algorithm to put the clustered data in a form suitable for
visualization.
|
add, addColumn, addRow, columnNormalize, deleteColumn, deleteRow, equals, getColumn, getDataProvider, getElement, getRow, hashCode, numberOfColumns, numberOfRows, printMatrix, rowNormalize, scaleByUncertainty, setData, setElement, subtract, transpose, zeroMatrix
public ClusterKDDMatrix(IDataProvider data) throws java.lang.IllegalArgumentException
The constructor, takes a valid set of IData and constructs this matrix. Initializes a EuclideanDistanceMeasure by default.
data
- java.lang.IllegalArgumentException
public ClusterKDDMatrix(java.util.ArrayList<java.lang.Double> elements, int nRows, int nCols)
public ClusterKDDMatrix(IDataProvider data, DistanceMeasure measure) throws java.lang.IllegalArgumentException
The constructor, for injecting a realization of the DistanceMeasure interface.
data
- measure
- java.lang.IllegalArgumentException
public ClusterKDDMatrix()
The Constructor
public void cluster(int nClusters, int nIterations)
This method performs a KMeans cluster algorithm on this matrix-structured data set. It produces an ArrayList of Clusters, each holding a map of data indices to vectors in an N-dimensional space represented as KDDMatrices with number of columns equal to 1 and number of rows equal to N. It takes as argument the number of cluster centroids to produce, as well as the number of iterations to use in refining the clusters.
nClusters
- nIterations
- public int getNumberOfClusters()
Return the number of Clusters.
public java.util.ArrayList<KDDMatrix> getClusterMeans()
Return the cluster mean vectors.
public void scaleData(int dimensions)
This method allows this ClusterKDDMatrix to perform a multi-dimensional scaling algorithm to put the clustered data in a form suitable for visualization. It takes the number of dimensions to visualize the data in, which can be one, two, or three.
dimensions
- public java.net.URI plot()
Plot this data and return the URI to the corresponding plot.
public boolean isClustered()
This method indicates whether or not this matrix has been clustered.
public int getNumberOfClusterElements(int index)
Return the number of elements in the cluster indexed by the argument. Returns -1 if invalid index.
index
-