def test_run_netflix_3(self):
     reader = StringIO(
         "10624:\n1544919\n964645\n1712360\n1943448\n608114\n10063:\n1544919\n964645\n1712360\n1943448\n608114\n10066:\n1544919\n964645\n1712360\n1943448\n608114\n10:\n1544919\n964645\n1712360\n1943448\n608114\n")
     writer = StringIO()
     run_netflix(reader, writer, ACTUAL_RATINGS,
                 CUST_AVG, MOVIE_AVG, CUST_YEAR_AVG, MOVIE_YEARS)
     self.assertEqual(
         writer.getvalue(), "10624:\n3.6\n3.9\n3.8\n4.3\n4.6\n10063:\n3.9\n4.3\n4.1\n4.6\n4.9\n10066:\n1.0\n2.3\n2.2\n2.7\n2.9\n10:\n3.7\n4.0\n3.9\n5.0\n4.7\nRMSE: 1.24\n")
Beispiel #2
0
 def test_run_netflix_2(self):
     reader = StringIO("10069:\n2140139\n1555169\n562543\n1007:\n95090\n468346\n84508\n2202141\n2383688\n10070:\n1611581\n2116105\n2126134\n")
     writer = StringIO()
     run_netflix(reader, writer)
     self.assertEqual(
         writer.getvalue(), "10069:\n3.8\n2.8\n2.6\n1007:\n4.1\n3.3\n4.7\n3.1\n4.1\n10070:\n3.6\n2.0\n1.9\nRMSE: 0.62\n")
Beispiel #3
0
 def test_run_netflix_3(self):
     reader = StringIO("1021:\n1157667\n2618351\n1435902\n1331\n1780588\n964825\n620832\n1645064\n894553\n1676997\n1632247\n868733\n1429332\n754567\n2303740\n302344\n1108131\n2131301\n510712\n2289237\n990036\n2633644\n2543516\n379005\n2170900\n1587712\n481433\n2632868\n1305371\n1343436\n2447225\n353669\n1183731\n366775\n2427961\n229634\n1694254\n474566\n2528435\n972040\n1688898\n1082864\n2278872\n571455\n581616\n607220\n2442028\n1174108\n1610929\n927271\n509331\n373838\n1151836\n1019775\n697818\n2487578\n148404\n1838848\n1122480\n2031549\n1677426\n1437925\n1184761\n920617\n1463238\n188630\n1482840\n1909324\n309719\n10210:\n2282309\n114388\n")
     writer = StringIO()
     run_netflix(reader, writer)
     self.assertEqual(
         writer.getvalue(), "1021:\n1.7\n3.4\n1.9\n3.4\n4.0\n4.3\n4.3\n3.7\n3.5\n3.7\n3.1\n4.1\n4.1\n3.2\n3.4\n3.8\n3.9\n4.3\n3.5\n3.5\n3.2\n4.5\n3.4\n4.8\n3.6\n4.3\n3.1\n2.3\n4.7\n3.4\n2.2\n4.9\n4.6\n3.9\n3.5\n3.1\n3.4\n4.0\n3.9\n2.6\n2.4\n3.7\n5.0\n3.4\n3.3\n3.5\n3.8\n4.1\n4.4\n3.3\n3.8\n3.4\n3.9\n5.0\n3.5\n5.0\n3.4\n5.0\n3.5\n2.7\n3.3\n3.8\n2.9\n4.5\n5.0\n3.7\n2.7\n3.3\n5.0\n10210:\n1.7\n1.8\nRMSE: 0.66\n")
Beispiel #4
0
 def test_run_netflix_1(self):
     reader = StringIO("1:\n30878\n2647871\n1283744\n2488120\n317050\n1904905\n1989766\n14756\n1027056\n1149588\n1394012\n1406595\n2529547\n1682104\n2625019\n2603381\n1774623\n470861\n712610\n1772839\n1059319\n2380848\n548064\n10:\n1952305\n1531863\n")
     writer = StringIO()
     run_netflix(reader, writer)
     self.assertEqual(
         writer.getvalue(), "1:\n3.7\n3.0\n3.8\n5.0\n4.9\n4.1\n3.8\n3.9\n3.6\n3.6\n2.9\n3.8\n3.9\n4.1\n2.4\n4.3\n4.0\n5.0\n4.3\n5.0\n2.4\n5.0\n3.3\n10:\n3.1\n3.0\nRMSE: 0.70\n")