Beispiel #1
0
        public static double[] clusterProportions(string clusterModelPath)
        {
            dataPrepClusterKmean cls = new dataPrepClusterKmean();

            cls.buildModel(clusterModelPath);
            int nClusters = ((Accord.MachineLearning.KMeans)cls.Model).Clusters.Count;

            double[] prop = new double[nClusters];
            for (int i = 0; i < nClusters; i++)
            {
                Accord.MachineLearning.KMeansCluster k = ((Accord.MachineLearning.KMeans)cls.Model).Clusters[i];
                prop[i] = k.Proportion;
            }
            return(prop);
        }
Beispiel #2
0
        public static int[] sampleSizeMaxCluster(string clusterModelPath, double proportionOfMean = 0.1, double alpha = 0.05)
        {
            dataPrepClusterKmean cls = new dataPrepClusterKmean();

            cls.buildModel(clusterModelPath);
            int nClusters = ((Accord.MachineLearning.KMeans)cls.Model).Clusters.Count;

            int[] maxN = new int[nClusters];
            for (int i = 0; i < nClusters; i++)
            {
                Accord.MachineLearning.KMeansCluster k = ((Accord.MachineLearning.KMeans)cls.Model).Clusters[i];
                int mx = sampleSizeMaxMean(k.Covariance, k.Mean, proportionOfMean, alpha)[0];
                maxN[i] = mx;
            }
            return(maxN);
        }
Beispiel #3
0
        public static int[] sampleSizeMaxStrata(string strataModelPath, double proportionOfMean = 0.1, double alpha = 0.05)
        {
            dataPrepStrata strata = new dataPrepStrata();

            strata.buildModel(strataModelPath);
            int nStrata = strata.Labels.Count;

            int[] maxN = new int[nStrata];
            for (int i = 0; i < nStrata; i++)
            {
                Accord.MachineLearning.KMeansCluster k = ((Accord.MachineLearning.KMeans)strata.Model).Clusters[i];
                int mx = sampleSizeMaxMean(k.Covariance, k.Mean, proportionOfMean, alpha)[0];
                maxN[i] = mx;
            }
            return(maxN);
        }