Exemple #1
0
        public IClusterer <T, U> Create(GenericClusteringAlgorithmType clusterType)
        {
            IClusterer <T, U> clusterer = null;

            switch (clusterType)
            {
            case GenericClusteringAlgorithmType.AverageLinkage:
                clusterer = new UMCAverageLinkageClusterer <T, U>();
                break;

            case GenericClusteringAlgorithmType.Centroid:
                clusterer = new UMCCentroidClusterer <T, U>();
                break;

            case GenericClusteringAlgorithmType.SingleLinkage:
                clusterer = new UMCSingleLinkageClusterer <T, U>();
                break;

            case GenericClusteringAlgorithmType.Prims:
                clusterer = new UMCPrimsClustering <T, U>();
                break;

            case GenericClusteringAlgorithmType.BinarySearchTree:
                clusterer = new Clustering.MsFeatureTreeClusterer <T, U>();
                break;

            default:
                throw new ArgumentOutOfRangeException(string.Format("Cannot create generic {0} clusterer.", clusterType));
            }

            return(clusterer);
        }
Exemple #2
0
        public static Clustering.IClusterer <MSFeatureLight, UMCLight> Create(
            MsFeatureClusteringAlgorithmType clusterType)
        {
            Clustering.IClusterer <MSFeatureLight, UMCLight> clusterer = null;
            switch (clusterType)
            {
            case MsFeatureClusteringAlgorithmType.AverageLinkage:
                clusterer = new Clustering.UMCAverageLinkageClusterer <MSFeatureLight, UMCLight>();
                break;

            case MsFeatureClusteringAlgorithmType.SingleLinkage:
                clusterer = new Clustering.MSFeatureSingleLinkageClustering <MSFeatureLight, UMCLight>();
                break;

            case MsFeatureClusteringAlgorithmType.Centroid:
                clusterer = new Clustering.UMCCentroidClusterer <MSFeatureLight, UMCLight>();
                break;

            case MsFeatureClusteringAlgorithmType.Prims:
                clusterer = new Clustering.UMCPrimsClustering <MSFeatureLight, UMCLight>();
                break;

            case MsFeatureClusteringAlgorithmType.BinarySearchTree:
                clusterer = new Clustering.MsFeatureTreeClusterer <MSFeatureLight, UMCLight>();
                break;

            default:
                throw new ArgumentOutOfRangeException("clusterType");
            }

            return(clusterer);
        }