#NEWLINE# def test_advanced( self ) : #NEWLINE# #INDENT# ( n , given_items , expected ) = [ 5 , [ 11 , 121 , 8587 ] , '11,1891,5.69,1892,5.65,243,5.00,1894,4.72,2164,4.11\n121,122,4.74,120,3.82,2164,3.40,243,3.26,1894,3.22\n8587,10020,4.18,812,4.03,7443,2.63,9331,2.46,786,2.39' ] #NEWLINE# self . data . load ( 'testdata/ratings.csv' ) #NEWLINE# self . rs = Recommender ( recs . data , model . PreferenceModel ( verbose = False ) , sc . cooc_advanced , sg . top_ns , verbose = False ) #NEWLINE# self . rs . build ( ) #NEWLINE# given_items = self . data . translate_items ( given_items ) #NEWLINE# recs = self . rs . recommend ( given_items , n ) #NEWLINE# self . assertTrue ( ( self . data . print_recs ( recs , given_items = given_items , printer = pr . coursera_pa1_printer ) == expected ) )