public IEnumerable <IRecommendation> GenerateRecommendations(IUser user, TSvdBoostedKnnModel model, List <IArtist> artists, int nearestNeighboursCount)
        {
            var svdBoostedKnnUser = SvdBoostedKnnUser.FromIUser(user, NewUserFeatureGenerator.GetNewUserFeatures(model, user));
            var neighbours        = CalculateKNearestNeighbours(svdBoostedKnnUser, model.Users, nearestNeighboursCount);

            if (neighbours.Count == 0)
            {
                return(null);
            }

            return(RecommendationGenerator.GenerateRecommendations(svdBoostedKnnUser, neighbours, model, artists));
        }
        public float PredictRatingForArtist(IUser user, TSvdBoostedKnnModel model, List <IArtist> artists, int artistIndex, int nearestNeighboursCount)
        {
            var svdBoostedKnnUser = SvdBoostedKnnUser.FromIUser(user, NewUserFeatureGenerator.GetNewUserFeatures(model, user));
            var neighbours        = CalculateKNearestNeighbours(svdBoostedKnnUser, model.Users, nearestNeighboursCount);

            if (neighbours.Count == 0)
            {
                return(1.0f);
            }

            return(RecommendationGenerator.PredictRatingForArtist(svdBoostedKnnUser, neighbours, model, artists, artistIndex));
        }
        public float PredictRatingForArtist(IUser user, ISimpleKnnModel model, List <IArtist> artists, int artistIndex, int nearestNeighboursCount)
        {
            var knnUser    = SimpleKnnUser.FromIUser(user);
            var neighbours = CalculateKNearestNeighbours(knnUser, model.Users, nearestNeighboursCount);

            if (neighbours.Count == 0)
            {
                return(1.0f);
            }

            return(RecommendationGenerator.PredictRatingForArtist(knnUser, neighbours, model, artists, artistIndex));
        }
        public IEnumerable <IRecommendation> GenerateRecommendations(IUser user, ISimpleKnnModel model, List <IArtist> artists, int nearestNeighboursCount)
        {
            var knnUser = SimpleKnnUser.FromIUser(user);

            var neighbours = CalculateKNearestNeighbours(knnUser, model.Users, nearestNeighboursCount);

            if (neighbours.Count == 0)
            {
                return(null);
            }

            return(RecommendationGenerator.GenerateRecommendations(knnUser, neighbours, model, artists));
        }