Search in sources :

Example 1 with PrimitiveMeanSummarizer

use of edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveMeanSummarizer in project clusterMaker2 by RBVI.

the class RunHopachPAM method kcluster.

@Override
public int kcluster(int nClusters, int nIterations, CyMatrix matrix, DistanceMetric metric, int[] clusterId) {
    monitor.setProgress(0);
    Summarizer summarizer;
    PrimitiveSummarizer psummarizer;
    switch(summaryMethod) {
        case MEDIAN:
            summarizer = new MedianSummarizer();
            psummarizer = new PrimitiveMedianSummarizer();
            break;
        case MEAN:
        default:
            summarizer = new MeanSummarizer();
            psummarizer = new PrimitiveMeanSummarizer();
            break;
    }
    HopachablePAM partitioner = new HopachablePAM(network, matrix, metric);
    partitioner.setParameters(K, L, splitCost, summarizer);
    HopachPAM hopachPam = new HopachPAM(partitioner);
    hopachPam.setParameters(maxLevel, minCostReduction, forceInitSplit, psummarizer);
    Clusters c = hopachPam.run();
    // copy results into clusterId
    for (int i = 0; i < c.size(); ++i) {
        clusterId[i] = c.getClusterIndex(i);
    }
    return c.getNumberOfClusters();
}
Also used : PrimitiveMeanSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveMeanSummarizer) MeanSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.MeanSummarizer) PrimitiveMeanSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveMeanSummarizer) PrimitiveSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveSummarizer) PrimitiveMedianSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveMedianSummarizer) Clusters(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.attributeClusterers.Clusters) HopachablePAM(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.attributeClusterers.pam.HopachablePAM) PrimitiveMeanSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveMeanSummarizer) MedianSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.MedianSummarizer) PrimitiveSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveSummarizer) MeanSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.MeanSummarizer) PrimitiveMedianSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveMedianSummarizer) Summarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.Summarizer) MedianSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.MedianSummarizer) PrimitiveMedianSummarizer(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveMedianSummarizer)

Aggregations

Clusters (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.attributeClusterers.Clusters)1 HopachablePAM (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.attributeClusterers.pam.HopachablePAM)1 MeanSummarizer (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.MeanSummarizer)1 MedianSummarizer (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.MedianSummarizer)1 PrimitiveMeanSummarizer (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveMeanSummarizer)1 PrimitiveMedianSummarizer (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveMedianSummarizer)1 PrimitiveSummarizer (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.PrimitiveSummarizer)1 Summarizer (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.numeric.Summarizer)1