Skip to content

Commit

Permalink
Update link to download the filmtrust dataset (PreferredAI#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqtg authored Sep 17, 2020
1 parent 97b2efc commit 1cd0a9f
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions cornac/datasets/filmtrust.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


def _get_cache_dir():
cache_dir = get_cache_path('filmtrust')[0]
cache_dir = get_cache_path("filmtrust")[0]
if not os.path.exists(cache_dir):
os.makedirs(cache_dir)
return cache_dir
Expand All @@ -44,10 +44,14 @@ def load_feedback(reader: Reader = None) -> List:
data: array-like
Data in the form of a list of tuples (user, item, rating).
"""
fpath = cache(url='https://www.librec.net/datasets/filmtrust.zip',
unzip=True, cache_dir=_get_cache_dir(), relative_path='ratings.txt')
fpath = cache(
url="https://static.preferred.ai/cornac/datasets/filmtrust/filmtrust.zip",
unzip=True,
cache_dir=_get_cache_dir(),
relative_path="ratings.txt",
)
reader = Reader() if reader is None else reader
return reader.read(fpath, sep=' ')
return reader.read(fpath, sep=" ")


def load_trust(reader: Reader = None) -> List:
Expand All @@ -63,7 +67,11 @@ def load_trust(reader: Reader = None) -> List:
data: array-like
Data in the form of a list of tuples (user, user, 1).
"""
fpath = cache(url='https://www.librec.net/datasets/filmtrust.zip',
unzip=True, cache_dir=_get_cache_dir(),relative_path='trust.txt')
fpath = cache(
url="https://static.preferred.ai/cornac/datasets/filmtrust/filmtrust.zip",
unzip=True,
cache_dir=_get_cache_dir(),
relative_path="trust.txt",
)
reader = Reader() if reader is None else reader
return reader.read(fpath, sep=' ')
return reader.read(fpath, sep=" ")

0 comments on commit 1cd0a9f

Please sign in to comment.