templates2/danube.scala
changeset 284 9a04eb6a2291
parent 203 eb188f9ac038
child 333 24bc76d97db2
equal deleted inserted replaced
283:ef5f62bf5987 284:9a04eb6a2291
     1 // Part 2 and 3 about Movie Recommendations 
     1 // Core Part about Movie Recommendations 
     2 // at Danube.co.uk
     2 // at Danube.co.uk
     3 //===========================================
     3 //===========================================
       
     4 
       
     5 object CW7b {
     4 
     6 
     5 import io.Source
     7 import io.Source
     6 import scala.util._
     8 import scala.util._
     7 
     9 
     8 // (1) Implement the function get_csv_url which takes an url-string
    10 // (1) Implement the function get_csv_url which takes an url-string
    48 //val movie_names = process_movies(movies)
    50 //val movie_names = process_movies(movies)
    49 
    51 
    50 //good_ratings.length   //48580
    52 //good_ratings.length   //48580
    51 //movie_names.length    // 9742
    53 //movie_names.length    // 9742
    52 
    54 
    53 
       
    54 
       
    55 //==============================================
       
    56 // Do not change anything below, unless you want 
       
    57 // to submit the file for the advanced part 3!
       
    58 //==============================================
       
    59 
    55 
    60 
    56 
    61 
    57 
    62 // (3) Implement a grouping function that calculates a Map
    58 // (3) Implement a grouping function that calculates a Map
    63 //     containing the userIDs and all the corresponding recommendations 
    59 //     containing the userIDs and all the corresponding recommendations 
   166 //val all = for (name <- movie_names.map(_._1)) yield {
   162 //val all = for (name <- movie_names.map(_._1)) yield {
   167 //  recommendations(ratings_map, movies_map, name)
   163 //  recommendations(ratings_map, movies_map, name)
   168 //}
   164 //}
   169 
   165 
   170 // helper functions
   166 // helper functions
   171 //List().take(2
   167 //List().take(2)
   172 //List(1).take(2)
   168 //List(1).take(2)
   173 //List(1,2).take(2)
   169 //List(1,2).take(2)
   174 //List(1,2,3).take(2)
   170 //List(1,2,3).take(2)
   175 
   171 
   176 
   172 
       
   173 }