Пример #1
0
        private Dictionary <int, int> byKmeans(double[][] v)
        {
            K_means k_mean = new K_means();

            //k_mean.addSetting(k, maxLoop, Normalized(x), epsilon, sigma, T, M);
            k_mean.addSetting(k, maxLoop, x, epsilon, sigma, T, M);
            k_mean.run(v);
            v_Last = k_mean.getV();
            return(k_mean.get_Clustered_Data());
        }
Пример #2
0
        public void run()
        {
            int n = x.Length;                               // n is number of user of group
            int d = x[0].Length;                            // d is number of Item of rating matrix

            double[][] v = new double[k][];
            v = CREATE_V_Init_01(x, k);

            for (int i = 0; i < 3; i++)
            {
                int     loop   = 1;
                K_means k_mean = new K_means();
                k_mean.addSetting(k, loop, x, epsilon, sigma, T, M);
                k_mean.run(v);
                v = k_mean.getV();

                //K_means_DCA k_mean_DCA = new K_means_DCA();
                //k_mean_DCA.addSetting(k, loop, x, epsilon, sigma, T, M);
                //k_mean_DCA.run(v);
                //v = k_mean_DCA.getV();
            }

            Repeat(n, d, v);
        }
Пример #3
0
 private Dictionary<int, int> byKmeans(double[][] v)
 {
     K_means k_mean = new K_means();
     //k_mean.addSetting(k, maxLoop, Normalized(x), epsilon, sigma, T, M);
     k_mean.addSetting(k, maxLoop, x, epsilon, sigma, T, M);
     k_mean.run(v);
     v_Last = k_mean.getV();
     return k_mean.get_Clustered_Data();
 }
Пример #4
0
        public void run()
        {
            int n = x.Length;                               // n is number of user of group
            int d = x[0].Length;                            // d is number of Item of rating matrix
            double[][] v = new double[k][];
            v = CREATE_V_Init_01(x, k);

            for (int i = 0; i < 3; i++)
            {
                int loop = 1;
                K_means k_mean = new K_means();
                k_mean.addSetting(k, loop, x, epsilon, sigma, T, M);
                k_mean.run(v);
                v = k_mean.getV();

                //K_means_DCA k_mean_DCA = new K_means_DCA();
                //k_mean_DCA.addSetting(k, loop, x, epsilon, sigma, T, M);
                //k_mean_DCA.run(v);
                //v = k_mean_DCA.getV();
            }

            Repeat(n, d, v);
        }