Weighted clustering is performed with the function WeightedClust
. Given a
list of the data matrices, a dissimilarity matrix is computed of each with
the provided distance measures. These matrices are then combined resulting
in a weighted dissimilarity matrix. Hierarchical clustering is performed
on this weighted combination with the agnes function and the ward link
WeightedClust(List,type=c("data","dist","clusters"),
distmeasure = c("tanimoto", "tanimoto"),normalize=FALSE,method=NULL,
weight = seq(1, 0, -0.1), WeightClust = 0.5, clust="agnes",
linkage = "ward",alpha=0.625,StopRange=FALSE)
A list of matrices of the same type. It is assumed the rows are corresponding with the objects.
Type indicates whether the provided matrices in "List" are either data matrices, distance matrices or clustering results obtained from the data. If type="dist" the calculation of the distance matrices is skipped and if type="clusters" the single source clustering is skipped. Type should be one of "data", "dist" or"clusters".
A vector of the distance measures to be used on each data matrix. Should be of "tanimoto", "euclidean", "jaccard","hamming".
Logical. Indicates whether to normalize the distance matrices or not.
This is recommended if different distance types are used. More details
on standardization in Normalization
.
A method of normalization. Should be one of "Quantile","Fisher-Yates", "standardize","Range" or any of the first letters of these names.
Optional. A list of different weight combinations for the data sets in List. If NULL, the weights are determined to be rqual for each data set. It is further possible to fix weights for some data matrices and to let it vary randomly for the remaining data sets. An example is provided in the details.
A weight for which the result will be put aside of the other results. This was done for comparative reason and easy access.
Choice of clustering function (character). Defaults to "agnes".
Choice of inter group dissimilarity (character). Defaults to "ward".
The parameter alpha to be used in the "flexible" linkage of the agnes function. Defaults to 0.625 and is only used if the linkage is set to "flexible"
Logical. Indicates whether the distance matrices with values not between zero and one should be standardized to have so.
If FALSE the range normalization is performed. See Normalization
. If TRUE, the distance matrices are not changed.
This is recommended if different types of data are used such that these are comparable.
The returned value is a list of four elements:
A list with the distance matrix for each data structure
A list with the weighted distance matrices
The hierarchical clustering result for each element in IncidenceComb
The result for the weight specified in Clustweight
The weight combinations should be provided as elements in a list. For three data matrices an example could be: weights=list(c(0.5,0.2,0.3),c(0.1,0.5,0.4)). To provide a fixed weight for some data sets and let it vary randomly for others, the element "x" indicates a free parameter. An example is weights=list(c(0.7,"x","x")). The weight 0.7 is now fixed for the first data matrix while the remaining 0.3 weight will be divided over the other two data sets. This implies that every combination of the sequence from 0 to 0.3 with steps of 0.1 will be reported and clustering will be performed for each.
# NOT RUN {
data(fingerprintMat)
data(targetMat)
L=list(fingerprintMat,targetMat)
MCF7_Weighted=WeightedClust(L,type="data", distmeasure=c("tanimoto","tanimoto"),
normalize=FALSE,method=NULL,weight=seq(1,0,-0.1),WeightClust=0.5,clust="agnes",linkage="ward"
,alpha=0.625,StopRange=FALSE)
# }
Run the code above in your browser using DataLab