def get_similar_items(self,j,max_similar_items=30,dataset=None):
        """
        Get the most similar items to a supplied item.

        Parameters
        ==========
        j : int
            Index of item for which to get similar items.
        max_similar_items : int
            Maximum number of similar items to return.
        dataset : mrec.sparse.fast_sparse_matrix
            The user-item matrix. Not required if you've already called fit()
            to learn the similarity matrix.

        Returns
        =======
        sims : list
            Sorted list of similar items, best first.  Each entry is
            a tuple of the form (i,score).
        """
        if hasattr(self,'similarity_matrix') and self.similarity_matrix is not None:
            w = zip(self.similarity_matrix[j].indices,self.similarity_matrix[j].data)
            sims = sorted(w,key=itemgetter(1),reverse=True)[:max_similar_items]
            sims = [(i,f) for i,f in sims if f > 0]
        else:
            w = self.compute_similarities(dataset,j)
            sims = [(i,w[i]) for i in w.argsort()[-1:-max_similar_items-1:-1] if w[i] > 0]
        return sims
dataset/ETHPy150Open Mendeley/mrec/mrec/item_similarity/recommender.py/ItemSimilarityRecommender.get_similar_items/original