#NEWLINE# def range_recommend_items( self , dataset , user_start , user_end , max_items = 10 , return_scores = True , item_features = None ) : #NEWLINE# #INDENT# "\n        Recommend new items for a range of users in the training dataset.\n        Assumes you've already called fit() to learn the similarity matrix.\n\n        Parameters\n        ==========\n        dataset : scipy.sparse.csr_matrix\n            User-item matrix containing known items.\n        user_start : int\n            Index of first user in the range to recommend.\n        user_end : int\n            Index one beyond last user in the range to recommend.\n        max_items : int\n            Maximum number of recommended items to return.\n        return_scores : bool\n            If true return a score along with each recommended item.\n        item_features : array_like, shape = [num_items, num_features]\n            Features for items in training set, required by some recommenders.\n\n        Returns\n        =======\n        recs : list of lists\n            Each entry is a list of (idx,score) pairs if return_scores is True,\n            else just a list of idxs.\n        " #NEWLINE# recs = self . item_similarity_recommender . range_recommend_items ( dataset , user_start , user_end , self . num_candidates , return_scores = False , item_features = item_features ) #NEWLINE# for ( u , candidates ) in enumerate ( recs ) : #NEWLINE# #INDENT# recs [ u ] = self . rerank ( ( user_start + u ) , candidates , max_items , return_scores = return_scores ) #NEWLINE# #UNINDENT# return recs