Skip to content

Latest commit

 

History

History
70 lines (70 loc) · 17.3 KB

transcript.md

File metadata and controls

70 lines (70 loc) · 17.3 KB

Transcript

[nbrown ~/vagrant/pa2] [master ●] ❯ irb
2.1.0 :001 > require './movie_data'
 => true
2.1.0 :002 > require 'benchmark'
 => true
2.1.0 :003 > md = MovieData.new('ml-100k')
 => #<MovieData:0x0000010138fe08 ...>
2.1.0 :004 > md.popularity_list
 => [50, 100, 181, 258, 174, 127, 286, 1, 98, 288, 56, 300, 172, 294, 7, 313, 121, 237, 117, 79, 173, 204, 222, 318, 210, 168, 64, 269, 69, 302, 22, 151, 195, 96, 183, 12, 9, 423, 191, 405, 89, 257, 357, 216, 176, 15, 276, 28, 483, 275, 234, 202, 135, 328, 25, 132, 238, 748, 196, 197, 185, 194, 742, 475, 82, 97, 268, 186, 496, 111, 118, 144, 427, 153, 228, 70, 603, 11, 333, 180, 182, 655, 265, 187, 8, 125, 179, 282, 435, 134, 515, 272, 568, 95, 143, 71, 474, 211, 471, 273, 175, 208, 200, 527, 215, 508, 289, 546, 480, 588, 161, 301, 479, 124, 88, 23, 209, 245, 385, 4, 298, 511, 14, 83, 514, 323, 203, 651, 285, 199, 403, 230, 250, 271, 340, 322, 137, 274, 133, 419, 307, 732, 283, 432, 315, 393, 523, 154, 597, 147, 684, 591, 58, 566, 99, 498, 433, 13, 188, 443, 751, 235, 678, 193, 284, 845, 654, 582, 150, 24, 692, 628, 86, 327, 218, 402, 156, 367, 326, 248, 484, 255, 660, 66, 223, 451, 42, 462, 657, 31, 293, 226, 55, 319, 705, 178, 205, 739, 164, 431, 87, 690, 213, 229, 321, 735, 177, 227, 685, 304, 239, 169, 310, 190, 91, 482, 198, 520, 410, 531, 170, 763, 408, 528, 77, 332, 550, 303, 129, 472, 270, 246, 476, 48, 47, 347, 192, 485, 750, 510, 116, 411, 526, 1016, 455, 157, 659, 316, 242, 252, 504, 509, 418, 428, 346, 521, 281, 68, 241, 663, 1028, 109, 879, 73, 746, 559, 240, 259, 136, 631, 596, 501, 478, 291, 447, 94, 249, 292, 2, 709, 93, 72, 233, 148, 65, 62, 382, 184, 331, 317, 470, 473, 866, 324, 81, 762, 380, 343, 231, 421, 1047, 429, 214, 53, 306, 217, 699, 92, 162, 378, 358, 507, 404, 529, 123, 756, 430, 126, 919, 38, 661, 1039, 815, 381, 449, 747, 219, 1012, 131, 652, 708, 436, 506, 517, 52, 895, 10, 59, 54, 33, 693, 519, 549, 163, 356, 260, 45, 159, 232, 679, 928, 518, 604, 325, 530, 243, 792, 744, 225, 755, 212, 305, 425, 67, 513, 201, 642, 736, 32, 477, 29, 682, 155, 465, 673, 1014, 290, 1011, 152, 114, 420, 525, 636, 399, 924, 90, 578, 554, 647, 448, 17, 5, 39, 715, 969, 729, 576, 662, 710, 458, 665, 781, 1101, 51, 633, 287, 487, 584, 221, 311, 264, 689, 463, 707, 505, 926, 488, 864, 19, 280, 189, 3, 625, 658, 648, 778, 49, 461, 606, 44, 724, 165, 295, 607, 497, 820, 713, 720, 558, 60, 676, 629, 434, 312, 63, 650, 491, 469, 171, 1073, 26, 825, 207, 354, 141, 122, 696, 481, 516, 640, 493, 277, 855, 20, 386, 486, 262, 499, 627, 392, 338, 923, 160, 873, 101, 615, 166, 823, 949, 993, 887, 21, 128, 717, 512, 1074, 492, 61, 417, 632, 538, 412, 544, 831, 494, 416, 220, 387, 959, 345, 1048, 409, 813, 616, 740, 414, 727, 930, 495, 1035, 334, 1119, 609, 939, 1009, 401, 299, 489, 468, 502, 371, 847, 106, 826, 553, 780, 619, 490, 108, 344, 741, 297, 934, 167, 1041, 595, 988, 140, 251, 946, 384, 754, 278, 675, 770, 790, 1007, 581, 105, 614, 898, 880, 466, 80, 721, 1065, 602, 524, 467, 921, 76, 686, 716, 569, 561, 871, 27, 694, 1142, 672, 963, 85, 737, 656, 452, 142, 806, 589, 206, 535, 102, 649, 722, 794, 955, 789, 611, 40, 896, 638, 956, 671, 886, 236, 749, 224, 664, 391, 1017, 57, 702, 768, 902, 145, 1197, 158, 712, 945, 942, 827, 833, 366, 1050, 900, 562, 570, 365, 1098, 254, 244, 339, 1067, 342, 1118, 396, 120, 1063, 329, 450, 772, 610, 687, 639, 646, 107, 1046, 30, 395, 875, 1021, 369, 849, 413, 892, 952, 1010, 503, 139, 844, 943, 840, 641, 975, 541, 941, 674, 441, 1135, 728, 547, 697, 1020, 1221, 856, 612, 824, 761, 846, 622, 522, 841, 653, 620, 877, 881, 977, 644, 1051, 922, 542, 810, 350, 944, 752, 1044, 552, 1025, 872, 937, 1194, 363, 876, 379, 1134, 874, 936, 984, 444, 16, 330, 971, 1008, 809, 731, 1188, 1019, 760, 931, 500, 785, 961, 1060, 372, 406, 43, 355, 1110, 1091, 1228, 683, 932, 608, 41, 623, 637, 1137, 575, 583, 882, 925, 979, 1217, 796, 456, 336, 373, 819, 1226, 539, 261, 1022, 370, 802, 966, 613, 537, 540, 951, 929, 771, 580, 407, 670, 723, 1126, 1244, 1210, 605, 645, 948, 769, 990, 783, 1136, 1018, 1070, 630, 1079, 567, 1129, 364, 837, 1149, 805, 1115, 836, 1267, 995, 1220, 1109, 585, 1152, 797, 253, 1059, 974, 573, 464, 46, 1160, 266, 863, 389, 1240, 774, 6, 577, 989, 279, 426, 586, 843, 1042, 634, 1133, 738, 972, 808, 349, 1090, 459, 1218, 829, 348, 1033, 308, 765, 753, 1013, 905, 680, 950, 1139, 460, 730, 1061, 1170, 878, 842, 1132, 1203, 890, 1053, 960, 1084, 1089, 1045, 320, 688, 1005, 78, 764, 362, 601, 1121, 309, 1023, 572, 779, 110, 1147, 543, 940, 445, 965, 800, 743, 1095, 1168, 532, 953, 1284, 1176, 704, 422, 865, 719, 980, 571, 1157, 563, 1093, 938, 1315, 1113, 1103, 962, 811, 869, 775, 624, 1411, 415, 734, 818, 1086, 904, 1034, 617, 978, 703, 149, 376, 906, 681, 821, 1204, 968, 1199, 618, 388, 1040, 1296, 1277, 1163, 1153, 1036, 1006, 1222, 1097, 1049, 383, 1286, 635, 359, 985, 1143, 1078, 1245, 745, 560, 1278, 335, 1117, 835, 1219, 1451, 986, 551, 368, 1258, 1401, 718, 1215, 565, 1265, 916, 903, 1172, 256, 352, 564, 812, 533, 834, 691, 982, 832, 1248, 1231, 1069, 115, 1208, 947, 991, 1107, 1052, 853, 84, 1024, 958, 557, 398, 351, 1054, 337, 854, 1105, 915, 888, 773, 1131, 1283, 130, 1057, 1206, 587, 1120, 908, 795, 933, 579, 816, 138, 1478, 733, 400, 1066, 909, 112, 1038, 1058, 1037, 1071, 1407, 1116, 1032, 1030, 454, 1062, 1178, 1444, 457, 1124, 801, 1285, 1446, 375, 1099, 534, 889, 1263, 1232, 1428, 1187, 883, 1303, 787, 1404, 1313, 725, 1280, 1112, 1171, 1192, 1183, 714, 1239, 394, 1483, 1281, 1211, 1185, 998, 1311, 1273, 1169, 1154, 859, 263, 701, 1161, 1140, 1068, 1225, 1159, 695, 593, 1193, 954, 1207, 1209, 786, 1266, 1190, 1469, 1166, 700, 1449, 113, 1167, 967, 862, 1269, 828, 996, 361, 1518, 894, 1195, 1421, 860, 1128, 793, 758, 590, 983, 1375, 536, 848, 1114, 390, 341, 1251, 1001, 360, 1524, 1230, 1127, 1419, 1298, 997, 893, 1297, 1268, 1055, 1015, 1473, 574, 1085, 1249, 353, 621, 1224, 1291, 726, 1056, 914, 1000, 556, 267, 1615, 698, 1092, 899, 397, 1148, 1182, 1503, 592, 453, 964, 1400, 1141, 103, 999, 377, 1150, 36, 1088, 912, 1029, 1252, 1282, 885, 776, 1229, 18, 1335, 1202, 1094, 1314, 1262, 766, 1004, 1540, 1076, 1620, 1174, 548, 807, 1425, 1165, 1558, 1181, 146, 1243, 1238, 1180, 374, 970, 782, 1459, 1184, 1462, 870, 1434, 424, 1381, 1279, 1456, 667, 791, 1480, 1077, 1426, 917, 901, 1531, 35, 803, 1081, 1413, 759, 918, 1198, 1075, 804, 976, 545, 1299, 1111, 1264, 1043, 1514, 1512, 935, 1475, 1439, 1368, 867, 1466, 884, 1415, 1479, 767, 1200, 446, 1294, 1471, 1145, 440, 1100, 1276, 1233, 1388, 1300, 74, 1409, 1396, 1468, 1254, 1326, 669, 1337, 798, 555, 1379, 1405, 1082, 1237, 296, 1312, 1288, 1367, 1173, 1179, 119, 1522, 1274, 1064, 868, 1271, 1336, 1302, 1175, 1138, 1474, 1406, 1072, 1234, 1495, 1394, 1227, 1087, 1328, 1212, 1295, 1591, 1592, 34, 1399, 1205, 37, 1214, 1316, 1255, 1435, 1003, 1393, 1437, 1253, 1441, 1125, 927, 1216, 1102, 1305, 1301, 1454, 1527, 1431, 1322, 1376, 1628, 1344, 891, 1496, 1485, 1517, 973, 1270, 1002, 1158, 1293, 1643, 1333, 799, 1598, 850, 851, 1385, 994, 1427, 1397, 1355, 1189, 1501, 1223, 1537, 1380, 1612, 1443, 1529, 706, 1600, 1031, 1440, 1289, 1597, 1511, 1151, 1395, 1083, 75, 981, 1241, 1386, 643, 1191, 1499, 1442, 1261, 1664, 1213, 594, 1623, 668, 1104, 1177, 1106, 666, 1242, 1324, 1535, 1589, 1534, 822, 1438, 1416, 992, 1331, 1108, 1346, 1353, 1164, 1470, 1516, 1488, 1521, 1605, 626, 1383, 1639, 1377, 1555, 1392, 1347, 1196, 1538, 1378, 1418, 1389, 1487, 1410, 1422, 1275, 1412, 1369, 1246, 1423, 1123, 1144, 1463, 1500, 1553, 1642, 1608, 1467, 1445, 1250, 1560, 1338, 1330, 1247, 1602, 911, 1398, 920, 1186, 1490, 1372, 1272, 1607, 598, 1506, 1504, 839, 1402, 1489, 1260, 757, 987, 1545, 1403, 838, 1448, 1155, 1594, 247, 1429, 1658, 1530, 1026, 1544, 1472, 1080, 1096, 1528, 1287, 1162, 1508, 438, 1450, 1327, 910, 1317, 1465, 1539, 1646, 1509, 1622, 817, 1629, 1027, 1356, 1257, 1259, 1631, 1656, 1370, 1464, 861, 1484, 1357, 1319, 104, 1430, 1323, 1361, 1424, 1382, 1541, 1590, 1588, 1617, 1351, 1436, 957, 1304, 1482, 1650, 1420, 1547, 913, 1235, 1513, 1452, 1515, 1523, 1342, 1662, 1292, 1391, 1653, 788, 1362, 1498, 1550, 600, 1613, 1306, 1332, 1130, 1652, 1519, 1616, 1505, 1146, 1384, 1256, 1526, 1585, 1672, 814, 1481, 1477, 1318, 439, 1455, 1433, 437, 1610, 1573, 1497, 1532, 1533, 777, 1593, 442, 711, 1551, 1554, 1525, 1321, 1390, 1345, 1458, 907, 1578, 1417, 1542, 1358, 1599, 1556, 1122, 1201, 1611, 1604, 1625, 1552, 1636, 1536, 1387, 1645, 1651, 1492, 1609, 314, 1674, 1491, 1374, 1641, 1414, 1630, 1637, 1614, 1640, 1236, 1682, 1310, 1619, 1502, 857, 1408, 1649, 1460, 1675, 1667, 1507, 1638, 1681, 1670, 1461, 1453, 1596, 1603, 1665, 1510, 1457, 1549, 1644, 1595, 1543, 1668, 1655, 1432, 677, 1680, 1657, 1359, 1676, 1447, 1660, 1290, 897, 1365, 1156, 784, 1354, 1648, 1307, 1308, 1350, 1632, 1635, 1647, 1520, 1666, 1476, 1679, 1677, 1669, 1633, 1334, 1624, 1673, 1663, 858, 1371, 1634, 1360, 1606, 1627, 1563, 1329, 1494, 852, 1557, 1562, 1586, 1584, 1581, 1577, 1580, 1363, 1618, 1621, 1339, 1565, 1561, 1566, 1349, 1373, 1678, 1567, 599, 1309, 1546, 1661, 830, 1587, 1366, 1654, 1548, 1564, 1571, 1574, 1575, 1671, 1343, 1579, 1325, 1572, 1341, 1352, 1582, 1559, 1348, 1576, 1569, 1568, 1340, 1626, 1601, 1659, 1320, 1364, 1570, 1493, 1486, 1583]
2.1.0 :005 > md.popularity(50)
 => 100.0
2.1.0 :006 > md.popularity(202)
 => 41.5
2.1.0 :007 > md.popularity(1561)
 => 0.0
2.1.0 :008 > md.similarity(900, 570)
 => 100.0
2.1.0 :009 > md.similarity(800, 570)
 => 25.0
2.1.0 :010 > md.similarity(800, 24)
 => 87.5
2.1.0 :012 > ms = nil
 => nil
2.1.0 :013 > pr = nil
 => nil
2.1.0 :014 > Benchmark.bm do |x|
2.1.0 :015 >     x.report('ms') { ms = md.most_similar(1) }
2.1.0 :016?>   x.report('pr') { pr = md.predict(747, 1659) }
2.1.0 :017?>   end; nil
       user     system      total        real
ms 31.010000   0.100000  31.110000 ( 31.104047)
pr  0.000000   0.000000   0.000000 (  0.000259)
 => nil
2.1.0 :018 > puts "most_similar(1): #{ms}"
most_similar(1): [155, 418, 812, 876, 105, 691, 895, 662, 273, 433, 111, 351, 767, 309, 702, 516, 800, 237, 803, 53, 359, 69, 696, 842, 9, 252, 520, 247, 117, 8, 549, 226, 923, 867, 60, 344, 473, 664, 600, 51, 476, 485, 278, 628, 107, 260, 501, 785, 315, 123, 770, 413, 540, 776, 136, 794, 941, 135, 556, 138, 550, 267, 583, 283, 799, 623, 151, 292, 419, 730, 232, 701, 814, 738, 479, 468, 928, 528, 694, 643, 96, 397, 210, 22, 215, 467, 66, 29, 394, 45, 718, 754, 687, 613, 412, 640, 28, 886, 165, 848, 697, 306, 573, 686, 25, 122, 32, 592, 27, 142, 251, 276, 892, 861, 453, 457, 65, 916, 360, 57, 59, 680, 264, 514, 758, 579, 429, 115, 661, 757, 836, 134, 815, 282, 169, 402, 185, 46, 469, 564, 244, 345, 379, 748, 877, 883, 257, 932, 249, 503, 114, 64, 320, 826, 781, 41, 339, 369, 743, 274, 744, 415, 398, 192, 700, 94, 253, 889, 238, 303, 323, 10, 543, 905, 926, 361, 791, 755, 581, 860, 769, 44, 487, 804, 629, 213, 494, 864, 187, 880, 350, 875, 504, 334, 370, 184, 328, 311, 296, 874, 582, 806, 924, 420, 435, 75, 84, 659, 481, 263, 682, 156, 765, 597, 291, 621, 55, 381, 554, 118, 763, 392, 591, 624, 218, 929, 484, 569, 645, 67, 879, 91, 52, 378, 447, 615, 647, 823, 42, 840, 474, 870, 746, 120, 910, 199, 909, 197, 139, 176, 936, 890, 844, 715, 407, 295, 294, 58, 793, 301, 545, 674, 641, 121, 266, 577, 92, 386, 216, 322, 603, 737, 93, 893, 409, 411, 343, 442, 449, 233, 70, 421, 375, 391, 606, 30, 87, 590, 16, 497, 103, 526, 77, 455, 862, 780, 97, 523, 373, 741, 788, 558, 331, 710, 389, 506, 903, 525, 566, 11, 512, 822, 222, 275, 846, 899, 679, 508, 851, 658, 144, 290, 308, 622, 178, 131, 439, 268, 817, 539, 692, 773, 871, 829, 789, 650, 711, 72, 560, 500, 778, 535, 299, 307, 786, 884, 272, 76, 203, 584, 2, 430, 248, 150, 160, 522, 838, 346, 246, 703, 95, 89, 368, 911, 79, 922, 709, 221, 23, 162, 768, 99, 530, 145, 585, 259, 667, 175, 383, 717, 749, 298, 352, 395, 329, 188, 882, 458, 542, 24, 177, 119, 12, 493, 894, 934, 605, 73, 835, 488, 198, 6, 200, 830, 62, 727, 271, 747, 533, 293, 86, 632, 390, 172, 364, 638, 387, 665, 920, 536, 5, 531, 631, 208, 80, 802, 792, 671, 426, 436, 676, 604, 400, 797, 406, 356, 440, 509, 683, 863, 925, 611, 820, 689, 54, 670, 229, 17, 14, 444, 448, 898, 313, 340, 859, 841, 513, 297, 695, 39, 845, 242, 333, 287, 663, 716, 906, 824, 678, 552, 850, 574, 149, 441, 721, 158, 722, 408, 725, 729, 492, 728, 648, 852, 736, 888, 740, 106, 240, 34, 310, 751, 811, 491, 827, 831, 651, 220, 627, 897, 766, 795, 527, 666, 625, 684, 18, 499, 456, 532, 13, 450, 243, 128, 553, 555, 37, 521, 425, 567, 48, 56, 367, 896, 805, 460, 913, 839, 227, 256, 595, 154, 354, 790, 472, 417, 707, 834, 90, 235, 157, 85, 83, 148, 182, 363, 43, 348, 416, 224, 254, 214, 464, 108, 270, 480, 807, 194, 495, 618, 653, 189, 742, 285, 7, 250, 496, 377, 324, 338, 130, 68, 594, 602, 759, 614, 376, 524, 289, 868, 312, 636, 634, 908, 423, 332, 538, 102, 881, 225, 31, 109, 163, 239, 132, 580, 940, 735, 21, 724, 318, 576, 124, 82, 633, 466, 125, 828, 619, 437, 337, 422, 452, 885, 371, 901, 465, 568, 347, 116, 71, 561, 204, 486, 764, 719, 796, 854, 821, 690, 565, 779, 546, 305, 593, 380, 393, 938, 572, 284, 907, 626, 137, 943, 164, 414, 171, 933, 349, 517, 26, 601, 654, 183, 919, 756, 733, 110, 288, 280, 672, 849, 353, 498, 720, 174, 921, 463, 847, 255, 557, 81, 286, 608, 212, 236, 321, 586, 777, 477, 559, 336, 607, 365, 610, 342, 201, 819, 510, 706, 327, 319, 858, 193, 234, 279, 207, 869, 714, 630, 470, 912, 708, 180, 669, 541, 693, 705, 230, 588, 461, 113, 330, 649, 575, 190, 47, 656, 396, 878, 191, 61, 544, 104, 529, 571, 179, 551, 660, 403, 195, 399, 753, 891, 699, 939, 635, 245, 478, 704, 325, 843, 262, 887, 784, 100, 133, 563, 609, 454, 374, 726, 4, 642, 655, 534, 927, 483, 277, 917, 723, 782, 74, 668, 537, 902, 833, 401, 548, 101, 404, 787, 140, 598, 147, 410, 519, 432, 825, 734, 438, 837, 209, 612, 798, 518, 357, 937, 942, 443, 173, 482, 141, 931, 152, 505, 98, 731, 739, 217, 40, 750, 372, 570, 616, 657, 652, 63, 620, 168, 712, 314, 562, 196, 382, 490, 20, 853, 813, 596, 269, 857, 385, 19, 326, 872, 761, 644, 639, 745, 760, 159, 219, 507, 801, 599, 166, 241, 3, 547, 810, 677, 78, 146, 775, 167, 459, 930, 900, 223, 771, 127, 15, 698, 49, 475, 206, 126, 935, 231, 302, 462, 300, 774, 918, 186, 211, 832, 675, 428, 388, 865, 587, 904, 434, 265, 637, 866, 772, 856, 646, 915, 143, 384, 873, 809, 50, 713, 316, 855, 129, 762, 366, 424, 818, 362, 33, 446, 355, 489, 304, 808, 205, 202, 161, 471, 673, 358, 181, 405, 502, 38, 617, 752, 515, 816, 732, 35, 578, 685, 341, 317, 431, 112, 783, 427, 451, 153, 445, 335, 258, 170, 914, 261, 228, 281, 589, 36, 681, 511]
 => nil
2.1.0 :019 > puts "md.predict(747, 1659): #{pr}"
md.predict(747, 1659): 1.0
 => nil
2.1.0 :020 > md.rating(747, 1659)
 => 1
2.1.0 :021 > md.movies(1)
 => [242, 51, 265, 86, 257, 222, 40, 29, 144, 118, 1, 95, 234, 246, 98, 193, 88, 194, 32, 16, 201, 241, 4, 100, 181, 196, 143, 20, 219, 26, 232, 15, 165, 248, 5, 229, 237, 54, 111, 25, 154, 209, 23, 208, 132, 174, 96, 151, 21, 195, 200, 264, 245, 135, 140, 272, 14, 268, 117, 177, 231, 2, 137, 164, 79, 258, 172, 216, 61, 48, 77, 220, 255, 202, 235, 228, 178, 10, 127, 106, 69, 214, 109, 171, 65, 68, 7, 218, 145, 56, 89, 141, 133, 153, 146, 11, 82, 3, 198, 189, 64, 215, 204, 33, 160, 227, 191, 183, 134, 212, 256, 271, 197, 199, 169, 175, 66, 206, 62, 12, 163, 250, 186, 71, 176, 78, 188, 97, 173, 17, 80, 238, 60, 47, 217, 259, 211, 210, 252, 156, 182, 50, 187, 185, 94, 168, 150, 184, 57, 249, 142, 126, 8, 58, 55, 121, 81, 22, 240, 70, 13, 225, 128, 49, 147, 161, 39, 120, 44, 28, 52, 230, 99, 190, 269, 179, 92, 129, 9, 152, 233, 203, 122, 110, 251, 155, 53, 91, 93, 162, 38, 131, 87, 72, 125, 105, 73, 239, 107, 213, 180, 59, 148, 27, 85, 221, 138, 114, 24, 43, 223, 263, 166, 253, 113, 116, 243, 207, 83, 254, 115, 36, 205, 102, 192, 42, 157, 226, 244, 34, 103, 90, 101, 267, 260, 167, 63, 139, 67, 170, 123, 262, 31, 149, 124, 159, 30, 104, 37, 266, 136, 74, 45, 158, 41, 270, 84, 261, 108, 76, 224, 6, 19, 119, 112, 236, 46, 18, 247, 35, 130, 75]
2.1.0 :022 > md.viewers(242)
 => [1, 2, 6, 9, 12, 13, 14, 18, 21, 30, 34, 35, 40, 63, 86, 90, 111, 113, 123, 129, 131, 139, 144, 145, 154, 173, 181, 195, 196, 199, 201, 202, 204, 205, 206, 207, 209, 226, 234, 239, 240, 249, 270, 271, 279, 296, 305, 306, 309, 331, 354, 355, 360, 408, 416, 417, 428, 439, 440, 451, 460, 461, 463, 473, 485, 486, 492, 497, 500, 520, 523, 532, 533, 537, 539, 566, 568, 574, 592, 594, 597, 617, 624, 628, 639, 641, 651, 655, 673, 675, 680, 695, 697, 707, 720, 721, 724, 733, 735, 740, 743, 753, 758, 765, 767, 771, 794, 803, 845, 861, 863, 866, 869, 871, 894, 898, 937]
2.1.0 :023 > mt = MovieData.new('ml-100k', :u1)
 => #<MovieData:0x000001030d3c08 ...>
2.1.0 :024 > t = nil
 => nil
2.1.0 :025 > Benchmark.bm do |x|
2.1.0 :026 >     x.report('t') { t = mt.run_test(10) }
2.1.0 :027?>   end; nil
       user     system      total        real
t 26.580000   0.110000  26.690000 ( 26.713253)
 => nil
2.1.0 :028 > t
 => #<MovieTest:0x000001013a02a8 @test_results=[[1, 6, 5, 3.4], [1, 10, 3, 3.9], [1, 12, 5, 4.4], [1, 14, 5, 3.9], [1, 17, 3, 3.2], [1, 20, 4, 3.5], [1, 23, 4, 4.1], [1, 24, 3, 3.4], [1, 27, 2, 3.2], [1, 31, 3, 3.7]]>
2.1.0 :029 > t.mean
 => 0.7299999999999999
2.1.0 :030 > t.stddev
 => 0.5
2.1.0 :031 > t.rms
 => 0.9
2.1.0 :032 > t.to_a
 => [[1, 6, 5, 3.4], [1, 10, 3, 3.9], [1, 12, 5, 4.4], [1, 14, 5, 3.9], [1, 17, 3, 3.2], [1, 20, 4, 3.5], [1, 23, 4, 4.1], [1, 24, 3, 3.4], [1, 27, 2, 3.2], [1, 31, 3, 3.7]]
2.1.0 :033 > puts "all done!"
all done!
 => nil
2.1.0 :034 >