Exemple #1
0
        public List <Recommendation_Meta_Item> getListRecommendation_R1_TraditionalUsers(Predict_DAO_MCol a, int nbR1)
        {
            //Predict_DAO_MC a = new Predict_DAO_MC();
            List <Recommendation_Meta_Item> list = new List <Recommendation_Meta_Item>();
            List <Recommendation_Meta_Item> RC   = new List <Recommendation_Meta_Item>();
            List <string> lstCluster             = new List <string>();
            List <string> User_OfCluster         = new List <string>();

            //Settings r = GetRecommendationSeting(a);
            lstCluster = a.GetListClusterID();
            //Check number of recommendations
            if (nbR1 <= 0)
            {
                nbR1 = 1;
            }

            //int i = 0;

            foreach (string cluster in lstCluster)
            {
                User_OfCluster = a.GetListUser_OfCluster(cluster);

                foreach (string u in User_OfCluster)
                {
                    RC = a.GetRecommendC6_ForTraditionalUser(u, nbR1);//2
                    list.AddRange(RC);
                }
            }
            return(list);
        }
Exemple #2
0
        //public List<Recommendation_Meta_Item> GetListRecommendC6_ForTraditionalUser()
        //{
        //    Predict_DAO_MC a = new Predict_DAO_MC();
        //    List<Recommendation_Meta_Item> list = new List<Recommendation_Meta_Item>();
        //    List<Recommendation_Meta_Item> RC = new List<Recommendation_Meta_Item>();
        //    try
        //    {
        //        a.beginTransaction();
        //        List<User> list_users_tra = a.getTraditionalUser_UnBlocked();

        //        foreach (User u in list_users_tra)
        //        {

        //            RC = a.GetRecommendC6_ForTraditionalUser(u, 1);
        //            list.AddRange(RC);

        //        }
        //        a.commitTransaction();
        //        return list;
        //    }
        //    catch (Exception ex)
        //    {
        //        a.rollbackTransaction();
        //        throw ex;
        //    }
        //}

        //----------------------------------------------------------------------------------------------
        //This function calls GetRecommendC6_ForTraditionalUser from Predict_DAO_MC to give R1
        //Created by MC. NGUYEN
        //Corrected by MC. NGUYEN, 22.10.2014
        //Changed: 24.10.2014: the formule to calculate SCORE for each Meta Produit (based on Count(*)).
        //----------------------------------------------------------------------------------------------
        public List <Recommendation_Meta_Item> getListRecommendation_R1_TraditionalUsers(Predict_DAO_MCol a)
        {
            List <Recommendation_Meta_Item> list1 = new List <Recommendation_Meta_Item>();
            List <Recommendation_Meta_Item> list2 = new List <Recommendation_Meta_Item>();
            List <string> list3 = new List <string>();
            List <string> list4 = new List <string>();

            foreach (string cluster in a.GetListClusterID())
            {
                foreach (string u in a.GetListUser_OfCluster(cluster))
                {
                    List <Recommendation_Meta_Item> forTraditionalUser = a.GetRecommendC6_ForTraditionalUser(u, 2);
                    list1.AddRange((IEnumerable <Recommendation_Meta_Item>)forTraditionalUser);
                }
            }
            return(list1);
        }