private static List<ComponentEvaluationMetric> GenerateAccuracyMetrics(double minimumSupport)
        {
            var idList = new int[] { 434, 482, 483, 502, 505 };
            var componentList = new List<ComponentEvaluationMetric>();

            foreach (var productId in idList)
            {
                var query = string.Format(@"select nouns_in_review from reviewdata where product_ref_id = {0}", productId);
                var dataSet = Utility.MySqlAccess.ExecuteQuery(query);

                var transactions = new List<string>();
                var distinctNounList = new List<string>();
                foreach (DataRow row in dataSet.Tables[0].Rows)
                {
                    var nounArray = row[0].ToString().Split(',');
                    foreach (var noun in nounArray)
                        distinctNounList.Add(noun);
                    transactions.Add(row[0].ToString().Replace(",", "|"));
                }

                AprioriAlgorithm.IApriori ap = new AprioriAlgorithm.Apriori();
                var output = ap.ProcessTransaction(minimumSupport, minimumSupport, distinctNounList.Distinct(), transactions.ToArray());
                var actualComponentSet = Utility.MySqlAccess.ExecuteQuery(string.Format("select component_list from manually_labelled_components where product_ref_id ={0}", productId));

                if (actualComponentSet.Tables[0].Rows.Count > 0)
                {
                    var actualComponents = actualComponentSet.Tables[0].Rows[0][0].ToString().Split(',');
                    componentList.Add(new ComponentEvaluationMetric { ProductId = productId, MinimumSupport = minimumSupport, PredictedComponentList = output.FrequentItems.Select(a => a.Name).ToList(), ActualComponentList = actualComponents.ToList() });

                    foreach (var component in componentList)
                    {
                        Console.WriteLine(component.ProductId);
                        Console.WriteLine(string.Join(",", component.PredictedComponentList.OrderBy(x => x).ToArray()));
                        Console.WriteLine("MetricValue: " + component.MetricValue);
                        Console.WriteLine("Support: " + minimumSupport);
                        Console.WriteLine("----------------------------------------");
                    }
                }
            }
            return componentList;

        }
        private static void ConsoleTesting()
        {
        start:
            Console.WriteLine("Enter Product ID: ");
            var productId = 0; // 434,482,483,502,505
            var input = Console.ReadLine();

            if (int.TryParse(input, out productId))
            {
                //get the noun list for every product
                //var productId = 2213;
                Console.WriteLine("Product Name : " + Utility.MySqlAccess.ExecuteQuery(string.Format("select item_name from item where item_id ={0}", productId)).Tables[0].Rows[0][0].ToString());
                var query = string.Format(@"select nouns_in_review from reviewdata where product_ref_id = {0}", productId);
                var dataSet = Utility.MySqlAccess.ExecuteQuery(query);

                var transactions = new List<string>();
                var distinctNounList = new List<string>();
                foreach (DataRow row in dataSet.Tables[0].Rows)
                {
                    var nounArray = row[0].ToString().Split(',');
                    foreach (var noun in nounArray)
                        distinctNounList.Add(noun);
                    transactions.Add(row[0].ToString().Replace(",", "|"));
                }

                AprioriAlgorithm.IApriori ap = new AprioriAlgorithm.Apriori();
                var output = ap.ProcessTransaction(0.3, 0.3, distinctNounList.Distinct(), transactions.ToArray());
                Console.WriteLine("Total Reviews : " + transactions.Count);
                foreach (var item in output.FrequentItems)
                    Console.WriteLine(item.Name + " | " + item.Support);
                if (output.FrequentItems.Count == 0)
                    Console.WriteLine("No components found.");

                //Console.ReadLine();
                goto start;
            }
            Console.WriteLine("Exiting...");
        }