diff --git a/README.md b/README.md index aa1b7d9cc6276266f11f3e75fde2ee109d953a4b..51ce785640d02990c1ae4ced3fc21e5d8781edd1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Should be available by default on the IC Cluster. Otherwise, refer to each proje Download the ````ml-100k.zip```` dataset in the ````data/```` folder: ```` -> mkdir data +> mkdir -p data > cd data > wget http://files.grouplens.org/datasets/movielens/ml-100k.zip ```` diff --git a/src/main/scala/predict/Predictor.scala b/src/main/scala/predict/Predictor.scala index d9b871a9fedc8a99cc6d2fb26255527ba1a2e97d..013030adc90f2d3ead2f83dbf2669a5e2161a91c 100644 --- a/src/main/scala/predict/Predictor.scala +++ b/src/main/scala/predict/Predictor.scala @@ -65,9 +65,36 @@ object Predictor extends App { // Limiting the scope of implicit formats with {} implicit val formats = org.json4s.DefaultFormats val answers: Map[String, Any] = Map( - "3.1.4" -> Map( - "global-mae" -> globalMae - ) + "Q3.1.4" -> Map( + "MaeGlobalMethod" -> 0.0, // Datatype of answer: Double + "MaePerUserMethod" -> 0.0, // Datatype of answer: Double + "MaePerItemMethod" -> 0.0, // Datatype of answer: Double + "MaeBaselineMethod" -> 0.0 // Datatype of answer: Double + ), + + "Q3.1.5" -> Map( + "DurationInMicrosecForGlobalMethod" -> Map( + "min" -> 0.0, // Datatype of answer: Double + "max" -> 0.0, // Datatype of answer: Double + "average" -> 0.0 // Datatype of answer: Double + ), + "DurationInMicrosecForPerUserMethod" -> Map( + "min" -> 0.0, // Datatype of answer: Double + "max" -> 0.0, // Datatype of answer: Double + "average" -> 0.0 // Datatype of answer: Double + ), + "DurationInMicrosecForPerItemMethod" -> Map( + "min" -> 0.0, // Datatype of answer: Double + "max" -> 0.0, // Datatype of answer: Double + "average" -> 0.0 // Datatype of answer: Double + ), + "DurationInMicrosecForBaselineMethod" -> Map( + "min" -> 0.0, // Datatype of answer: Double + "max" -> 0.0, // Datatype of answer: Double + "average" -> 0.0 // Datatype of answer: Double + ), + "RatioBetweenBaselineMethodAndGlobalMethod" -> 0.0 // Datatype of answer: Double + ), ) json = Serialization.writePretty(answers) } diff --git a/src/main/scala/recommend/Recommender.scala b/src/main/scala/recommend/Recommender.scala index 27461544d75e54b8c4cf63ba2955222380af995f..6e14620ef5ebd9916412ed1093366bec9e6db0e0 100644 --- a/src/main/scala/recommend/Recommender.scala +++ b/src/main/scala/recommend/Recommender.scala @@ -61,13 +61,18 @@ object Recommender extends App { // Limiting the scope of implicit formats with {} implicit val formats = org.json4s.DefaultFormats val answers: Map[String, Any] = Map( - "4.1.1" -> List[Any]( - List(0,"Tron", 5.0), - List(0,"Tron", 5.0), - List(0,"Tron", 5.0), - List(0,"Tron", 5.0), - List(0,"Tron", 5.0) - ) + + // IMPORTANT: To break ties and ensure reproducibility of results, + // please report the top-5 recommendations that have the smallest + // movie identifier. + + "Q4.1.1" -> List[Any]( + List(254, "Batman & Robin (1997)", 5.0), // Datatypes for answer: Int, String, Double + List(338, "Bean (1997)", 5.0), + List(615, "39 Steps", 5.0), + List(741, "Last Supper", 5.0), + List(587, "Hour of the Pig", 5.0) + ) ) json = Serialization.writePretty(answers) } diff --git a/src/main/scala/stats/Analyzer.scala b/src/main/scala/stats/Analyzer.scala index 35076d5e0d7b173a56e9dc4e9dfce6506d4b65f3..97a9ee9c26276a6b343e5cff7965f0a9d98b9482 100644 --- a/src/main/scala/stats/Analyzer.scala +++ b/src/main/scala/stats/Analyzer.scala @@ -53,9 +53,31 @@ object Analyzer extends App { // Limiting the scope of implicit formats with {} implicit val formats = org.json4s.DefaultFormats val answers: Map[String, Any] = Map( - "3.1.1" -> Map( - "global-avg-rating" -> 3.0 - ) + "Q3.1.1" -> Map( + "GlobalAverageRating" -> 0.0 // Datatype of answer: Double + ), + "Q3.1.2" -> Map( + "UsersAverageRating" -> Map( + // Using as your input data the average rating for each user, + // report the min, max and average of the input data. + "min" -> 0.0, // Datatype of answer: Double + "max" -> 0.0, // Datatype of answer: Double + "average" -> 0.0 // Datatype of answer: Double + ), + "AllUsersCloseToGlobalAverageRating" -> true, // Datatype of answer: Boolean + "RatioUsersCloseToGlobalAverageRating" -> 0.0 // Datatype of answer: Double + ), + "Q3.1.3" -> Map( + "ItemsAverageRating" -> Map( + // Using as your input data the average rating for each item, + // report the min, max and average of the input data. + "min" -> 0.0, // Datatype of answer: Double + "max" -> 0.0, // Datatype of answer: Double + "average" -> 0.0 // Datatype of answer: Double + ), + "AllItemsCloseToGlobalAverageRating" -> true, // Datatype of answer: Boolean + "RatioItemsCloseToGlobalAverageRating" -> 0.0 // Datatype of answer: Double + ), ) json = Serialization.writePretty(answers) }