Example #1
0
        public virtual void calc_confidence_method_base(string[] frqitmset, string[] tmpdt, int initial, int stop, int no, int r, int confidence, string[] articles, int a, string file)
        {
            Apriori inst4 = new Apriori();
            Apriori inst5 = new Apriori();

            if (no == r)
            {
                for (int j = 0; j < a; j++)
                {
                    for (int k = 0; k < r; k++)
                    {
                        if (articles[j].Equals(tmpdt[k]))
                        {
                            return;
                        }
                    }
                }
                inst4.result(confidence, r, file, tmpdt, articles, a);
                return;
            }
            for (int u = initial; u <= stop && stop - u + 1 >= r - no; u++)
            {
                tmpdt[no] = frqitmset[u];
                inst5.calc_confidence_method_base(frqitmset, tmpdt, u + 1, stop, no + 1, r, confidence, articles, a, file);
            }
        }
Example #2
0
        public virtual void calc_confidence_method(string[] frqitmset, string[] articles, int initial, int stop, int no, int a, int confidence, string file)
        {
            Apriori inst3 = new Apriori();

            if (no == a)
            {
                for (int r = 1; r < stop; r++)
                {
                    string[] tmpdt = new string[r];
                    inst3.calc_confidence_method_base(frqitmset, tmpdt, 0, stop - 1, 0, r, confidence, articles, a, file);
                }
                return;
            }
            for (int i = initial; i <= stop && stop - i + 1 >= a - no; i++)
            {
                articles[no] = frqitmset[i];
                inst3.calc_confidence_method(frqitmset, articles, i + 1, stop, no + 1, a, confidence, file);
            }
        }