Returns the reddit dataset, downloading locally if necessary.

    This dataset was released here:
    https://www.reddit.com/r/redditdev/comments/dtg4j/want_to_help_reddit_build_a_recommender_a_public/
    and contains 23M up/down votes from 44K users on 3.4M links.

    Returns a CSR matrix of (item, user, rating

def get_reddit():
    """ Returns the reddit dataset, downloading locally if necessary.

    This dataset was released here:
    https://www.reddit.com/r/redditdev/comments/dtg4j/want_to_help_reddit_build_a_recommender_a_public/
    and contains 23M up/down votes from 44K users on 3.4M links.

    Returns a CSR matrix of (item, user, rating """

    filename = os.path.join(_download.LOCAL_CACHE_DIR, "reddit.hdf5")
    if not os.path.isfile(filename):
        log.info("Downloading dataset to '%s'", filename)
        _download.download_file(URL, filename)
    else:
        log.info("Using cached dataset at '%s'", filename)

    with h5py.File(filename, 'r') as f:
        m = f.get('item_user_ratings')
        return csr_matrix((m.get('data'), m.get('indices'), m.get('indptr')))