Skip to content
Snippets Groups Projects
Commit c50f3cb6 authored by Athanasios Xygkis's avatar Athanasios Xygkis Committed by Erick Lavoie
Browse files

Json

parent 4621019d
No related branches found
No related tags found
No related merge requests found
......@@ -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
````
......
......@@ -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)
}
......
......@@ -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)
}
......
......@@ -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)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment