get_data( books, ratings )
: The
function must read data about books and raters and return the
information in a list and dictionary. (see
details)books
argument must be a txt
file of books (supplied with the snarf or get here):author,bookTitle
author,bookTitle
....
ratings
argument must be a txt
file of raters (supplied with the snarf or get here):
ratername
,bookRatings
ratername
,bookRatings
....
The call get_data( books, ratings )
must return two things:
itlist
a list of items being rated: [
"author,
bookTitle
", "
author,
bookTitle
",
... ]
rdict
a dictionary of raters
and their ratings of the books:
{"ratername" : [integer ratings for each movie], "ratername" : [integer ratings for each movie], ... }
get_data( movieratings )
The movieratings
argument must be a txt
file of movies (supplied with the snarf or get here):ratername title rating
ratername title rating
ratername title rating
....
Return valuesThe get_data( movieratings )
must return two things:
itlist
a list of items being rated: [
"
title
", "
title
",
"
title
", ... ]
(see details and examples here)
rdict
a dictionary of raters and
their ratings of the movies:
{"ratername" : [integer ratings for each movie], "ratername" : [integer ratings for each movie], ... }
Note that both functions get_data
return the same types: a
list of strings (each item being rated) and a dictionary in which
keys are raters and values are lists of integer ratings by each rater.
Recommender.py
you must write the three
functions shown in the details pages:
averages
, similarities
, and
recommended
. You must also (either in Recommender.py or
another module you write that imports and calls Recommender).
obtain the list and dictionary from either a book or movie module's get_data
function, and then report on at three different ratings:
averages
).
similarities
).
recommended
).
Recommender.py
are correct. What did you do to
verify the results, how did you debug the code, and so on.
recommended
with different values of n
for one of the data sets to
determine what items are recommended. FoodReader.py
module to write code in
Recommender.py
BookReader.py
module or the
MovieReader.py
module, but not both.
Recommender.py
in order
from simplest to most complex, with average
first,
then
similarities
, then recommended
.