File size: 120,248 Bytes
a67be9a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 |
WEBVTT Kind: captions; Language: en-US
NOTE
Created on 2024-02-07T20:52:49.1946189Z by ClassTranscribe
00:01:20.650 --> 00:01:21.930
Alright, good morning everybody.
00:01:25.660 --> 00:01:27.860
So I just wanted to start with a little
00:01:27.860 --> 00:01:28.850
Review.
00:01:28.940 --> 00:01:29.540
00:01:30.320 --> 00:01:32.885
So first question, and don't yell out
00:01:32.885 --> 00:01:34.190
the answer I'll give you.
00:01:34.190 --> 00:01:35.960
I want to give everyone a couple a
00:01:35.960 --> 00:01:37.150
little bit to think about it.
00:01:37.150 --> 00:01:39.420
Which of these tend to be decreased as
00:01:39.420 --> 00:01:40.790
the number of training examples
00:01:40.790 --> 00:01:41.287
increase?
00:01:41.287 --> 00:01:43.350
The Training Error, test error
00:01:43.350 --> 00:01:45.380
Generalization could be more than one.
00:01:46.750 --> 00:01:47.700
I'll give you.
00:01:47.850 --> 00:01:49.840
A little bit to think about it.
00:02:02.100 --> 00:02:04.545
Alright, so well, would you expect the
00:02:04.545 --> 00:02:06.540
Training Error to decrease as the
00:02:06.540 --> 00:02:08.530
number of training examples increases?
00:02:09.920 --> 00:02:11.190
Raise your hand if so.
00:02:13.140 --> 00:02:14.430
And raise your hand if not.
00:02:16.110 --> 00:02:20.580
So is have it a lot of abstains, but if
00:02:20.580 --> 00:02:21.440
I don't count them.
00:02:21.440 --> 00:02:25.980
So yeah, actually the Training Error
00:02:25.980 --> 00:02:28.125
will actually increase as the number of
00:02:28.125 --> 00:02:30.230
training examples increases because the
00:02:30.230 --> 00:02:31.330
model gets harder to fit.
00:02:32.030 --> 00:02:33.390
So assuming the Training Error is
00:02:33.390 --> 00:02:35.170
nonzero, then it will increase or the
00:02:35.170 --> 00:02:36.895
loss that you're fitting is going to
00:02:36.895 --> 00:02:38.620
increase because as you get more
00:02:38.620 --> 00:02:40.110
Training examples then.
00:02:42.710 --> 00:02:44.780
Then, given a single model, you're
00:02:44.780 --> 00:02:46.380
Error is going to go up all right.
00:02:46.380 --> 00:02:47.310
What about test Error?
00:02:47.310 --> 00:02:49.580
Would you expect that to increase or
00:02:49.580 --> 00:02:51.100
decrease or stay the same?
00:02:51.100 --> 00:02:53.820
I guess first just do you expect it to
00:02:53.820 --> 00:02:54.180
decrease?
00:02:55.920 --> 00:02:57.160
Raise your hand for decreased.
00:02:57.940 --> 00:02:59.030
All right, raise your hand for
00:02:59.030 --> 00:02:59.520
increase.
00:03:00.820 --> 00:03:02.370
Everyone expects to test their to
00:03:02.370 --> 00:03:02.870
decrease.
00:03:03.910 --> 00:03:05.930
And Generalization Error, do you expect
00:03:05.930 --> 00:03:08.056
that to increase or I mean sorry, do
00:03:08.056 --> 00:03:09.060
you expect it to decrease?
00:03:10.110 --> 00:03:12.220
Raise your hand if Generalization Error
00:03:12.220 --> 00:03:12.990
should decrease.
00:03:14.860 --> 00:03:16.380
And raise your hand if it should
00:03:16.380 --> 00:03:16.770
increase.
00:03:18.520 --> 00:03:19.508
Right, so you expect.
00:03:19.508 --> 00:03:21.960
So the Generalization Error should also
00:03:21.960 --> 00:03:22.650
decrease.
00:03:22.650 --> 00:03:25.172
And remember that the Generalization
00:03:25.172 --> 00:03:26.710
error is the.
00:03:27.920 --> 00:03:31.000
Test Error minus the Training error, so
00:03:31.000 --> 00:03:32.930
the typical curve you see.
00:03:35.010 --> 00:03:37.080
The typical curve you would see if this
00:03:37.080 --> 00:03:39.720
is the number of train.
00:03:41.550 --> 00:03:43.080
And this is the Error.
00:03:43.880 --> 00:03:45.220
Is that Training Error?
00:03:45.220 --> 00:03:47.600
We'll go like something like that.
00:03:47.600 --> 00:03:49.020
So this is the train.
00:03:49.670 --> 00:03:52.230
And the test error will go something
00:03:52.230 --> 00:03:52.960
like this.
00:03:55.050 --> 00:03:58.389
And this is the generalization error is
00:03:58.390 --> 00:04:01.010
a gap between training and test error.
00:04:01.010 --> 00:04:02.540
So actually.
00:04:02.610 --> 00:04:05.345
The generalization error will decrease
00:04:05.345 --> 00:04:08.600
the fastest because that gap is closing
00:04:08.600 --> 00:04:10.419
faster than the test error is going
00:04:10.420 --> 00:04:10.920
down.
00:04:10.920 --> 00:04:12.920
That has to be the case because the
00:04:12.920 --> 00:04:13.790
Training Error is going up.
00:04:14.750 --> 00:04:17.230
And then the test error decreased the
00:04:17.230 --> 00:04:18.840
second fastest, and the Training error
00:04:18.840 --> 00:04:20.205
is actually going to increase, so the
00:04:20.205 --> 00:04:21.350
Training loss will increase.
00:04:22.560 --> 00:04:26.330
Alright, second question and these are
00:04:26.330 --> 00:04:28.655
just Review questions that I took from
00:04:28.655 --> 00:04:31.480
the thing that I linked but wanted to
00:04:31.480 --> 00:04:32.290
do them here.
00:04:32.290 --> 00:04:35.780
So Classify the X with the plus using
00:04:35.780 --> 00:04:37.710
one nearest neighbor and three Nearest
00:04:37.710 --> 00:04:39.475
neighbor where you've got 2 features on
00:04:39.475 --> 00:04:40.270
the axis there.
00:04:42.110 --> 00:04:45.370
Alright, 41 Nearest neighbor.
00:04:45.370 --> 00:04:47.220
How many people think it's an X?
00:04:48.790 --> 00:04:50.540
OK, how many people think it's an O?
00:04:51.700 --> 00:04:52.700
Everyone said 784x1.
00:04:52.700 --> 00:04:53.840
That's correct.
00:04:53.840 --> 00:04:55.100
For three Nearest neighbor.
00:04:55.100 --> 00:04:56.750
How many people think it's an X?
00:04:58.010 --> 00:04:59.300
How many people think it's to know?
00:05:00.460 --> 00:05:01.040
Right.
00:05:01.040 --> 00:05:02.130
Yeah, you guys got that.
00:05:02.130 --> 00:05:04.100
So 3 Nearest neighbor, it's a no.
00:05:05.650 --> 00:05:06.700
Right now these I think.
00:05:08.910 --> 00:05:10.670
Also, I have a couple of probability
00:05:10.670 --> 00:05:11.780
questions.
00:05:13.330 --> 00:05:15.340
Alright, so first, just what assumption
00:05:15.340 --> 00:05:16.890
does the Naive based model make if
00:05:16.890 --> 00:05:19.860
there are two features X1 and X2?
00:05:19.860 --> 00:05:21.710
Give you a second to think about it,
00:05:21.710 --> 00:05:22.030
there's.
00:05:22.730 --> 00:05:23.980
Really two options there.
00:05:23.980 --> 00:05:26.180
They either it's one of it's either A
00:05:26.180 --> 00:05:27.880
or B, neither or both.
00:05:29.280 --> 00:05:30.140
I'll give you a moment.
00:05:49.590 --> 00:05:52.900
Alright, so how many say that A is an
00:05:52.900 --> 00:05:54.960
assumption that Naive Bayes makes?
00:05:57.940 --> 00:05:58.180
Right.
00:05:58.180 --> 00:05:59.910
How many people say that B is an
00:05:59.910 --> 00:06:01.430
assumption that Naive Bayes makes?
00:06:03.950 --> 00:06:06.480
How many say that neither of those are
00:06:06.480 --> 00:06:06.860
true?
00:06:09.740 --> 00:06:12.120
And how many say that both of those are
00:06:12.120 --> 00:06:13.582
true, that they're the same thing and
00:06:13.582 --> 00:06:14.130
they're both true?
00:06:16.390 --> 00:06:18.810
So I think there are maybe at least one
00:06:18.810 --> 00:06:19.780
vote for each of them.
00:06:19.780 --> 00:06:23.410
But so the answer is B that Naive Bayes
00:06:23.410 --> 00:06:25.070
assumes that the features are
00:06:25.070 --> 00:06:27.675
independent of each other given the
00:06:27.675 --> 00:06:30.626
given the Prediction given the label.
00:06:30.626 --> 00:06:32.676
And I'll consistently use X for
00:06:32.676 --> 00:06:33.826
features and Y for label.
00:06:33.826 --> 00:06:34.089
So.
00:06:34.810 --> 00:06:36.920
Hopefully that part is clear.
00:06:36.920 --> 00:06:39.270
So A is not true because it's not
00:06:39.270 --> 00:06:42.180
assuming that the in fact A is just
00:06:42.180 --> 00:06:44.390
never true or?
00:06:45.200 --> 00:06:46.420
Is that ever true?
00:06:46.420 --> 00:06:48.230
I guess it could be true if Y is always
00:06:48.230 --> 00:06:50.180
one or under certain weird
00:06:50.180 --> 00:06:52.930
circumstances, but a is like a bad
00:06:52.930 --> 00:06:54.370
probability statement.
00:06:55.080 --> 00:06:58.555
And then B assumes that X1 and X2 are
00:06:58.555 --> 00:07:00.370
independent given Y because remember
00:07:00.370 --> 00:07:01.979
that if A&B are independent.
00:07:02.930 --> 00:07:04.496
Then probability of AB equals
00:07:04.496 --> 00:07:06.150
probability of a times probability B.
00:07:06.850 --> 00:07:08.580
And similarly, even if it's
00:07:08.580 --> 00:07:10.440
conditional, if X1 and X2 are
00:07:10.440 --> 00:07:12.700
independent, then probability of X1 and
00:07:12.700 --> 00:07:14.832
X2 given Y is equal to probability of
00:07:14.832 --> 00:07:16.642
X1 given Y times probability of X2
00:07:16.642 --> 00:07:17.150
given Y.
00:07:18.450 --> 00:07:21.660
And they're and they're not equivalent,
00:07:21.660 --> 00:07:24.010
they're different expressions.
00:07:24.010 --> 00:07:26.090
OK, so now this one is probably the.
00:07:26.090 --> 00:07:27.190
This one is the most.
00:07:28.600 --> 00:07:30.040
Complicated to work through I guess.
00:07:30.900 --> 00:07:33.060
So let's say X1 and X2 are binary
00:07:33.060 --> 00:07:35.780
features and Y is a binary label.
00:07:36.410 --> 00:07:37.180
And.
00:07:38.100 --> 00:07:40.830
And then all I've set the probabilities
00:07:40.830 --> 00:07:44.794
so we know what X 1 = 1 given y = 0, X
00:07:44.794 --> 00:07:46.712
2 = 1 given y = 0.
00:07:46.712 --> 00:07:48.130
So I didn't fill out the whole
00:07:48.130 --> 00:07:49.820
probability table, but I gave enough
00:07:49.820 --> 00:07:51.710
maybe to do the first part.
00:07:52.920 --> 00:07:55.190
So if we make an app as assumption.
00:07:55.800 --> 00:07:57.760
So that's the assumption under B there.
00:07:58.810 --> 00:08:01.860
What is probability of y = 1?
00:08:02.900 --> 00:08:06.920
Given X 1 = 1 and X 2 = 1.
00:08:08.240 --> 00:08:09.890
I'll give you a little bit of time to
00:08:09.890 --> 00:08:12.086
start thinking about it, but I won't
00:08:12.086 --> 00:08:12.504
ask.
00:08:12.504 --> 00:08:14.650
I won't ask anyone to call it the
00:08:14.650 --> 00:08:15.275
answer.
00:08:15.275 --> 00:08:17.220
I'll just start working through it.
00:08:19.050 --> 00:08:21.810
So think about how you would solve it.
00:08:22.230 --> 00:08:22.840
00:08:24.940 --> 00:08:26.030
What things you have to multiply
00:08:26.030 --> 00:08:26.860
together, et cetera.
00:08:35.800 --> 00:08:36.110
Nice.
00:08:45.670 --> 00:08:48.020
Alright, so I'll start working it out.
00:08:48.020 --> 00:08:51.390
So probability of Y1 given X1 and X2.
00:08:52.190 --> 00:08:53.580
So let's see.
00:08:53.580 --> 00:08:56.940
So probability of y = 1.
00:08:57.750 --> 00:09:02.530
Given X 1 = 1 and X 2 = 1.
00:09:05.000 --> 00:09:10.400
That's the probability of y = 1 X.
00:09:11.390 --> 00:09:12.160
1.
00:09:13.210 --> 00:09:14.550
Equals one.
00:09:15.350 --> 00:09:17.180
X 2 = 1.
00:09:18.690 --> 00:09:19.830
Divided by.
00:09:20.740 --> 00:09:21.870
Probability.
00:09:22.300 --> 00:09:22.650
00:09:24.810 --> 00:09:26.830
I'll just do sum over K to save myself
00:09:26.830 --> 00:09:27.490
some rating.
00:09:27.490 --> 00:09:28.920
I don't like writing by hand much.
00:09:30.120 --> 00:09:33.220
So sum K in the values of zero to 1
00:09:33.220 --> 00:09:34.430
probability of Y.
00:09:35.310 --> 00:09:41.530
Equals K&X 1 = 1 and X 2 = 1.
00:09:42.810 --> 00:09:45.100
So the reason for this, whoops, the
00:09:45.100 --> 00:09:46.740
reason for that is that.
00:09:46.810 --> 00:09:47.420
00:09:49.330 --> 00:09:51.910
I'm marginalizing out the Y so that is
00:09:51.910 --> 00:09:53.430
just equal to probability.
00:09:53.430 --> 00:09:54.916
On the denominator I have probability
00:09:54.916 --> 00:09:58.889
of X 1 = 1 and probability of X 2 = 1.
00:10:05.270 --> 00:10:08.570
And then this guy is going to be.
00:10:09.770 --> 00:10:10.690
I can get there.
00:10:11.450 --> 00:10:15.750
By probability of Y given X1 and X2.
00:10:16.690 --> 00:10:18.440
Equals probability.
00:10:19.300 --> 00:10:20.960
Sorry, I meant to flip that.
00:10:23.670 --> 00:10:26.130
Probability of X1 and X2.
00:10:28.920 --> 00:10:31.812
Given Y is equal to probability of X1
00:10:31.812 --> 00:10:35.919
given Y times probability of X 2 = y.
00:10:35.920 --> 00:10:37.490
That's the Naive Bayes assumption part.
00:10:38.520 --> 00:10:39.570
So the numerator.
00:10:40.540 --> 00:10:41.630
Is.
00:10:41.740 --> 00:10:43.250
Let's see.
00:10:43.250 --> 00:10:46.790
So the numerator will be 1/4 * 1/2.
00:10:47.900 --> 00:10:50.590
And then probability of Y is 5.
00:10:50.590 --> 00:10:53.240
So on the numerator of this expression
00:10:53.240 --> 00:10:56.730
here I have 1/4 * 1/2 * 5.
00:10:58.030 --> 00:11:01.966
And on the denominator I have 1/4 * 1/2
00:11:01.966 --> 00:11:03.230
* 1.5.
00:11:04.370 --> 00:11:05.140
Plus.
00:11:07.090 --> 00:11:11.180
2/3 * 1/3 * .5, right?
00:11:11.180 --> 00:11:13.775
This is a probability of X = 1 given y
00:11:13.775 --> 00:11:16.730
= 0 times that, times that or times.
00:11:16.730 --> 00:11:18.678
And then it's times 5 because the
00:11:18.678 --> 00:11:20.561
probability of y = 1 is .5.
00:11:20.561 --> 00:11:23.249
Then probability of y = 0 is 1 -, .5,
00:11:23.250 --> 00:11:24.370
which is also 05.
00:11:25.650 --> 00:11:27.210
That's how I solve that first part.
00:11:29.150 --> 00:11:31.520
And then under Naive base assumption,
00:11:31.520 --> 00:11:34.340
is it possible to calculate this given
00:11:34.340 --> 00:11:35.990
the information I provided in those
00:11:35.990 --> 00:11:36.630
equations?
00:11:43.020 --> 00:11:45.180
So it's not.
00:11:45.180 --> 00:11:47.010
Under first glance it might look like
00:11:47.010 --> 00:11:49.480
it is, but it's not because I don't
00:11:49.480 --> 00:11:52.106
know what the probability of X = 0
00:11:52.106 --> 00:11:53.091
given Y is.
00:11:53.091 --> 00:11:54.810
I didn't give any information about
00:11:54.810 --> 00:11:54.965
that.
00:11:54.965 --> 00:11:57.436
I only said what the probability of X1
00:11:57.436 --> 00:11:59.916
given Y is, and I can't figure out the
00:11:59.916 --> 00:12:02.683
probability of X0 given Y from the
00:12:02.683 --> 00:12:04.149
probability of X1 given Y.
00:12:05.960 --> 00:12:07.340
Or as I at least.
00:12:08.090 --> 00:12:09.870
I haven't thought through it in great
00:12:09.870 --> 00:12:11.245
detail, but I don't think I can figure
00:12:11.245 --> 00:12:11.500
it out.
00:12:13.090 --> 00:12:13.490
Alright.
00:12:13.490 --> 00:12:16.180
So then with without the Naive's
00:12:16.180 --> 00:12:18.580
assumption, yeah, under the nibs,
00:12:18.580 --> 00:12:18.970
sorry.
00:12:19.710 --> 00:12:21.020
I made a I was.
00:12:21.180 --> 00:12:21.400
OK.
00:12:22.240 --> 00:12:24.030
Under the name's assumption.
00:12:24.030 --> 00:12:26.560
Is it possible to figure that out?
00:12:26.560 --> 00:12:27.250
Let me think.
00:12:28.140 --> 00:12:29.570
Probability of X1.
00:12:38.260 --> 00:12:39.630
Yeah, sorry about that.
00:12:39.630 --> 00:12:42.530
I was I switched these in my head.
00:12:42.530 --> 00:12:44.620
So under the knob is assumption.
00:12:44.620 --> 00:12:47.310
Actually I can figure this out because.
00:12:47.400 --> 00:12:47.990
00:12:49.270 --> 00:12:52.470
If because if X, since X is binary,
00:12:52.470 --> 00:12:56.020
then if X probability of X 1 = 1 given
00:12:56.020 --> 00:12:56.779
y = 0.
00:12:57.440 --> 00:13:00.891
Is 2/3 then probability of X 1 = 0
00:13:00.891 --> 00:13:04.403
given y = 0 is 1/3 and probability of
00:13:04.403 --> 00:13:08.306
X2 given equals zero given y = 0 is 2/3
00:13:08.306 --> 00:13:12.599
and probability of X 1 = 0 given y = 1
00:13:12.599 --> 00:13:13.379
is 3/4.
00:13:13.380 --> 00:13:17.979
So I know probability of X = 0 given Y.
00:13:18.940 --> 00:13:22.590
Equals 0 or y = 1 so I can solve this
00:13:22.590 --> 00:13:22.800
one.
00:13:23.520 --> 00:13:25.720
And then I kind of gave it away, but
00:13:25.720 --> 00:13:28.440
without the nib is assumption is it
00:13:28.440 --> 00:13:30.860
possible to calculate the probability
00:13:30.860 --> 00:13:34.179
of y = 1 given X 1 = 1 and X 2 = 1?
00:13:37.370 --> 00:13:39.600
No, I mean I already I said it, but.
00:13:40.670 --> 00:13:41.520
But no, it's not.
00:13:41.520 --> 00:13:43.090
And the reason is because I don't have
00:13:43.090 --> 00:13:44.520
any of the joint probabilities here.
00:13:44.520 --> 00:13:45.740
For that I would need to know
00:13:45.740 --> 00:13:48.785
something, the probability of X1 and X2
00:13:48.785 --> 00:13:51.440
and Y the full probability table.
00:13:51.440 --> 00:13:53.205
Or I would need to be given the
00:13:53.205 --> 00:13:55.359
probability of Y given X1 and X2.
00:14:04.200 --> 00:14:06.700
Alright, so that was just a little
00:14:06.700 --> 00:14:07.795
Review and warm up.
00:14:07.795 --> 00:14:10.410
So today I'm going to mainly talk about
00:14:10.410 --> 00:14:13.418
Linear models and in particular I'll
00:14:13.418 --> 00:14:15.938
talk about Linear, Logistic Regression
00:14:15.938 --> 00:14:17.522
and Linear Regression.
00:14:17.522 --> 00:14:19.240
And then as part of that I'll talk
00:14:19.240 --> 00:14:20.290
about this concept called
00:14:20.290 --> 00:14:21.180
regularization.
00:14:24.880 --> 00:14:27.179
Right, So what is the Linear model?
00:14:27.179 --> 00:14:31.925
A Linear model is a model in a model is
00:14:31.925 --> 00:14:36.949
linear in X if it is a X plus some plus
00:14:36.950 --> 00:14:38.360
maybe some constant value.
00:14:39.030 --> 00:14:41.940
So I can write that as W transpose X +
00:14:41.940 --> 00:14:44.850
B and remember using your linear
00:14:44.850 --> 00:14:46.510
algebra that that's the same as the sum
00:14:46.510 --> 00:14:50.113
over I of wixi plus B.
00:14:50.113 --> 00:14:53.920
So for any values of X&B these are WI
00:14:53.920 --> 00:14:55.260
and B are scalars.
00:14:55.260 --> 00:14:57.835
XI would be a scalar, so X is a vector,
00:14:57.835 --> 00:14:58.370
W vector.
00:14:59.290 --> 00:15:02.680
So this is a Linear model no matter how
00:15:02.680 --> 00:15:03.990
I choose those coefficients.
00:15:05.750 --> 00:15:07.730
And there's two main kinds of Linear
00:15:07.730 --> 00:15:08.330
models.
00:15:08.330 --> 00:15:10.603
There's a Linear classifier and a
00:15:10.603 --> 00:15:11.570
Linear regressor.
00:15:12.370 --> 00:15:15.210
So in a Linear classifier.
00:15:16.180 --> 00:15:19.450
This W transpose X + B is giving you a
00:15:19.450 --> 00:15:21.490
score for how likely.
00:15:22.190 --> 00:15:27.400
A feature vector is to belong to one
00:15:27.400 --> 00:15:28.790
class or the other class.
00:15:30.020 --> 00:15:31.300
So that's shown down here.
00:15:31.300 --> 00:15:33.854
We have like some O's and some
00:15:33.854 --> 00:15:34.320
triangles.
00:15:34.320 --> 00:15:36.240
I've got a Linear model here.
00:15:36.240 --> 00:15:40.555
This is the West transpose X + B and
00:15:40.555 --> 00:15:44.270
that gives me a score that say that say
00:15:44.270 --> 00:15:46.220
that class is equal to 1.
00:15:46.220 --> 00:15:48.170
Maybe I'm saying the triangles are ones
00:15:48.170 --> 00:15:49.370
are y = 1.
00:15:50.220 --> 00:15:54.692
So if I this line will project all of
00:15:54.692 --> 00:15:57.242
these different points onto the line.
00:15:57.242 --> 00:15:59.847
The West transpose X + B projects all
00:15:59.847 --> 00:16:01.640
of these points onto this line.
00:16:02.650 --> 00:16:05.146
And then we tend to look at when you
00:16:05.146 --> 00:16:07.140
when you see like diagrams of Linear
00:16:07.140 --> 00:16:07.990
Classifiers.
00:16:07.990 --> 00:16:09.480
Often what people are showing is the
00:16:09.480 --> 00:16:10.150
boundary.
00:16:10.890 --> 00:16:13.550
Which is where W transpose X + b is
00:16:13.550 --> 00:16:14.400
equal to 0.
00:16:16.460 --> 00:16:18.580
So all the points that project on one
00:16:18.580 --> 00:16:20.699
side of the boundary will be one class
00:16:20.700 --> 00:16:22.264
and all the ones that project on the
00:16:22.264 --> 00:16:24.132
other side of the boundary or the other
00:16:24.132 --> 00:16:24.366
class.
00:16:24.366 --> 00:16:26.670
Or in other words, if W transpose X + B
00:16:26.670 --> 00:16:27.830
is greater than 0.
00:16:28.470 --> 00:16:29.270
It's one class.
00:16:29.270 --> 00:16:30.675
If it's less than zero, it's the other
00:16:30.675 --> 00:16:30.960
class.
00:16:32.640 --> 00:16:34.020
A Linear regressor.
00:16:34.020 --> 00:16:36.720
You're directly fitting the data
00:16:36.720 --> 00:16:40.790
points, and you're solving for a line
00:16:40.790 --> 00:16:42.430
that passes through.
00:16:43.630 --> 00:16:45.130
The target and features.
00:16:46.030 --> 00:16:48.495
So that you're more directly so that
00:16:48.495 --> 00:16:50.880
you're able to predict the target
00:16:50.880 --> 00:16:54.310
value, the Y given your features and so
00:16:54.310 --> 00:16:57.740
in 2D I can plot that as a 2D line, but
00:16:57.740 --> 00:16:59.740
it can be ND it could be a high
00:16:59.740 --> 00:17:00.600
dimensional line.
00:17:01.300 --> 00:17:04.890
And you have y = W transpose X + B.
00:17:06.290 --> 00:17:09.150
So in Classification, typically it's
00:17:09.150 --> 00:17:11.550
not Y equals W transpose X + B, it's
00:17:11.550 --> 00:17:15.210
some kind of score for how it's a score
00:17:15.210 --> 00:17:17.340
for Y, and in Regression you're
00:17:17.340 --> 00:17:20.290
directly fitting Y with that line.
00:17:21.820 --> 00:17:22.200
Question.
00:17:27.440 --> 00:17:33.335
I almost all situations so at the so at
00:17:33.335 --> 00:17:35.740
the end of the day, like for example if
00:17:35.740 --> 00:17:36.890
you're doing deep learning.
00:17:37.520 --> 00:17:40.510
All of the different layers of the most
00:17:40.510 --> 00:17:42.503
of the layers of the feature, I mean of
00:17:42.503 --> 00:17:43.960
the network, you can think of as
00:17:43.960 --> 00:17:46.260
learning a feature representation and
00:17:46.260 --> 00:17:47.510
at the end of it you have a Linear
00:17:47.510 --> 00:17:50.190
classifier that maps from the features
00:17:50.190 --> 00:17:51.420
into the target label.
00:18:06.090 --> 00:18:06.560
00:18:14.220 --> 00:18:16.592
So the so the question is if you were
00:18:16.592 --> 00:18:18.170
if you were trying to predict whether
00:18:18.170 --> 00:18:20.400
or not somebody is caught based on a
00:18:20.400 --> 00:18:21.150
bunch of features.
00:18:22.260 --> 00:18:23.979
You could use the Linear classifier for
00:18:23.980 --> 00:18:24.250
that.
00:18:24.250 --> 00:18:26.840
So a Linear classifier is always a
00:18:26.840 --> 00:18:28.843
binary classifier, but you can also use
00:18:28.843 --> 00:18:30.530
it in Multiclass cases.
00:18:30.530 --> 00:18:33.777
So for example if you want to Classify
00:18:33.777 --> 00:18:35.860
if you have a picture of some animal
00:18:35.860 --> 00:18:37.366
and you want to Classify what kind of
00:18:37.366 --> 00:18:37.900
animal it is.
00:18:38.890 --> 00:18:40.634
And you have a bunch of features.
00:18:40.634 --> 00:18:43.470
Features could be like image Pixels, or
00:18:43.470 --> 00:18:45.950
it could be more complicated features
00:18:45.950 --> 00:18:48.420
than you would have a Linear model for
00:18:48.420 --> 00:18:50.860
each of the possible kinds of animals,
00:18:50.860 --> 00:18:54.040
and you would score each of the classes
00:18:54.040 --> 00:18:55.665
according to that model, and then you
00:18:55.665 --> 00:18:56.930
would choose the one with the highest
00:18:56.930 --> 00:18:57.280
score.
00:18:58.790 --> 00:19:00.930
So there's so some examples of Linear
00:19:00.930 --> 00:19:03.720
models are support vector.
00:19:03.720 --> 00:19:06.570
The only the two main examples I would
00:19:06.570 --> 00:19:08.936
say are support vector machines and
00:19:08.936 --> 00:19:10.009
Logistic Regression.
00:19:10.009 --> 00:19:11.619
Linear Logistic Regression.
00:19:12.630 --> 00:19:14.750
Naive Bayes is also a Linear model,
00:19:14.750 --> 00:19:15.220
but.
00:19:16.230 --> 00:19:18.080
And many other kinds of Classifiers.
00:19:18.080 --> 00:19:19.670
If you like, do the math, you can show
00:19:19.670 --> 00:19:21.150
that it's also a Linear model at the
00:19:21.150 --> 00:19:23.565
end of the day, but it's less thought
00:19:23.565 --> 00:19:24.510
that way.
00:19:31.680 --> 00:19:35.210
Cannon is not a Linear model.
00:19:35.210 --> 00:19:37.390
It has a non linear decision boundary.
00:19:38.070 --> 00:19:40.948
And boosted decision trees you can
00:19:40.948 --> 00:19:42.677
think of it as.
00:19:42.677 --> 00:19:45.180
So first like I will talk about trees
00:19:45.180 --> 00:19:47.750
and Bruce the decision trees next week.
00:19:47.750 --> 00:19:50.020
So I'm not going to fill in the details
00:19:50.020 --> 00:19:51.140
for those who don't know what they are.
00:19:51.140 --> 00:19:53.109
But basically you can think of it as
00:19:53.110 --> 00:19:55.010
that the tree is creating a
00:19:55.010 --> 00:19:56.280
partitioning of the features.
00:19:57.470 --> 00:19:59.115
Given that partitioning, you then have
00:19:59.115 --> 00:20:02.160
a Linear model on top of it, so you can
00:20:02.160 --> 00:20:03.570
think of it as an encoding of the
00:20:03.570 --> 00:20:04.850
features plus a Linear model.
00:20:06.030 --> 00:20:06.300
Yeah.
00:20:24.510 --> 00:20:26.290
How many like different models you need
00:20:26.290 --> 00:20:26.610
or.
00:20:26.610 --> 00:20:28.350
So it's the.
00:20:28.350 --> 00:20:29.020
It depends.
00:20:29.020 --> 00:20:30.800
It's kind of given by the problem
00:20:30.800 --> 00:20:32.440
setup, so if you're told.
00:20:33.930 --> 00:20:35.890
If you for example.
00:20:36.970 --> 00:20:37.750
00:20:38.900 --> 00:20:39.590
00:20:40.930 --> 00:20:42.670
OK, I'll just choose an image example
00:20:42.670 --> 00:20:44.010
because this pop into my head most
00:20:44.010 --> 00:20:44.680
easily.
00:20:44.680 --> 00:20:45.970
So if you're trying to Classify
00:20:45.970 --> 00:20:47.720
something between male or female,
00:20:47.720 --> 00:20:49.670
Classify an image between is it a male
00:20:49.670 --> 00:20:50.210
or female?
00:20:50.210 --> 00:20:51.678
Then you know you have two classes so
00:20:51.678 --> 00:20:54.164
you need to fit two models, one or need
00:20:54.164 --> 00:20:54.820
to fit.
00:20:55.640 --> 00:20:57.200
And the two class model you only have
00:20:57.200 --> 00:20:58.670
to fit one model because either it's
00:20:58.670 --> 00:20:59.270
one or the other.
00:20:59.980 --> 00:21:03.445
If you have, if you're trying to
00:21:03.445 --> 00:21:05.153
Classify, let's say you're trying to
00:21:05.153 --> 00:21:06.845
Classify a face into different age
00:21:06.845 --> 00:21:07.160
groups.
00:21:07.160 --> 00:21:09.460
Is it somebody that's under 10, between
00:21:09.460 --> 00:21:11.832
10 and 2020 and 30 and so on, then you
00:21:11.832 --> 00:21:13.660
would need like one model for each of
00:21:13.660 --> 00:21:14.930
those age groups.
00:21:14.930 --> 00:21:17.566
So usually as a problem set up you say
00:21:17.566 --> 00:21:19.880
I have these like features available to
00:21:19.880 --> 00:21:22.194
make my Prediction, and I have these
00:21:22.194 --> 00:21:23.890
things that I want to Predict.
00:21:23.890 --> 00:21:28.460
And if the things are a like a set of
00:21:28.460 --> 00:21:30.560
categories, then you would need one
00:21:30.560 --> 00:21:32.060
Linear model per category.
00:21:33.040 --> 00:21:35.390
And if the thing that you're trying to
00:21:35.390 --> 00:21:38.990
Predict is a set of continuous values,
00:21:38.990 --> 00:21:40.940
then you would need one Linear model
00:21:40.940 --> 00:21:42.030
per continuous value.
00:21:42.710 --> 00:21:45.160
If you're using like Linear models.
00:21:45.860 --> 00:21:46.670
Does that make sense?
00:21:47.400 --> 00:21:49.980
And then you mentioned like.
00:21:50.790 --> 00:21:52.850
You mentioned hidden hidden layers or
00:21:52.850 --> 00:21:54.230
something, but that would be part of
00:21:54.230 --> 00:21:56.650
neural networks and that would be like.
00:21:57.450 --> 00:22:00.790
A design choice for the network that we
00:22:00.790 --> 00:22:02.320
can talk about when we get to network.
00:22:05.500 --> 00:22:05.810
OK.
00:22:09.100 --> 00:22:12.500
A Linear classifier, you would say that
00:22:12.500 --> 00:22:16.150
the label is 1 if W transpose X + B is
00:22:16.150 --> 00:22:16.950
greater than 0.
00:22:17.960 --> 00:22:19.410
And then there's this important concept
00:22:19.410 --> 00:22:21.040
called linearly separable.
00:22:21.040 --> 00:22:22.200
So that just means that you can
00:22:22.200 --> 00:22:24.425
separate the points, the features of
00:22:24.425 --> 00:22:25.530
the two classes.
00:22:26.450 --> 00:22:27.750
Cleanly so.
00:22:30.220 --> 00:22:33.780
So for example, which of these is
00:22:33.780 --> 00:22:36.000
linearly separable, the left or the
00:22:36.000 --> 00:22:36.460
right?
00:22:38.250 --> 00:22:41.130
Right the left is linearly separable
00:22:41.130 --> 00:22:42.950
because I can put a line between them
00:22:42.950 --> 00:22:44.680
and all the triangles will be on one
00:22:44.680 --> 00:22:46.290
side and the circles will be on the
00:22:46.290 --> 00:22:46.520
other.
00:22:47.210 --> 00:22:48.660
But the right side is not linearly
00:22:48.660 --> 00:22:49.190
separable.
00:22:49.190 --> 00:22:51.910
I can't put any line to separate those
00:22:51.910 --> 00:22:53.780
from the triangles.
00:22:55.970 --> 00:22:58.595
So it's important to note that.
00:22:58.595 --> 00:23:01.150
So sometimes, like the fact that I have
00:23:01.150 --> 00:23:03.230
to draw everything in 2D on slides can
00:23:03.230 --> 00:23:04.240
be a little misleading.
00:23:04.860 --> 00:23:07.220
It may make you think that Linear
00:23:07.220 --> 00:23:09.200
Classifiers are not very powerful.
00:23:10.080 --> 00:23:11.930
Because in two dimensions they're not
00:23:11.930 --> 00:23:13.860
very powerful, I can create lots of
00:23:13.860 --> 00:23:16.070
combinations of points where I just
00:23:16.070 --> 00:23:17.580
can't get very good Classification
00:23:17.580 --> 00:23:18.170
accuracy.
00:23:19.410 --> 00:23:21.410
But as you get into higher dimensions,
00:23:21.410 --> 00:23:23.340
the Linear Classifiers become more and
00:23:23.340 --> 00:23:24.140
more powerful.
00:23:25.210 --> 00:23:28.434
And in fact, if you have D dimensions,
00:23:28.434 --> 00:23:31.460
if you have D features, that's what I
00:23:31.460 --> 00:23:32.419
mean by D dimensions.
00:23:33.050 --> 00:23:35.850
Then you can separate D + 1 points with
00:23:35.850 --> 00:23:37.700
any arbitrary labeling.
00:23:37.700 --> 00:23:40.370
So as an example, if I have one
00:23:40.370 --> 00:23:42.300
dimension, I only have one feature
00:23:42.300 --> 00:23:42.880
value.
00:23:43.610 --> 00:23:45.350
I can separate two points whether I
00:23:45.350 --> 00:23:47.740
label this as X and this is O or
00:23:47.740 --> 00:23:49.400
reverse I can separate them.
00:23:50.930 --> 00:23:52.430
But I can't separate these three
00:23:52.430 --> 00:23:53.100
points.
00:23:53.100 --> 00:23:55.730
So if it were like XI could separate
00:23:55.730 --> 00:23:58.519
it, but when it's Oxo I can't separate
00:23:58.520 --> 00:24:02.050
that with A1 dimensional 1 dimensional
00:24:02.050 --> 00:24:02.880
linear separator.
00:24:04.770 --> 00:24:07.090
In 2 dimensions, I can separate these
00:24:07.090 --> 00:24:08.730
three points no matter how I label
00:24:08.730 --> 00:24:11.570
them, whether it's ox or ox, no matter
00:24:11.570 --> 00:24:13.365
how I do it, I can put a line between
00:24:13.365 --> 00:24:13.590
them.
00:24:14.240 --> 00:24:16.220
But I can't separate four points.
00:24:16.220 --> 00:24:18.030
So that's a concept called shattering
00:24:18.030 --> 00:24:20.926
and an idea and Generalization theory
00:24:20.926 --> 00:24:22.017
called the VC dimension.
00:24:22.017 --> 00:24:24.120
The more points you can shatter, like
00:24:24.120 --> 00:24:26.175
the more powerful your classifier, but
00:24:26.175 --> 00:24:27.630
more importantly.
00:24:28.430 --> 00:24:30.910
The If you think about if you have 1000
00:24:30.910 --> 00:24:31.590
features.
00:24:32.320 --> 00:24:34.630
That means that if you have 1000 data
00:24:34.630 --> 00:24:38.130
points, random feature points, and you
00:24:38.130 --> 00:24:40.386
label them arbitrarily, there's two to
00:24:40.386 --> 00:24:41.274
the one.
00:24:41.274 --> 00:24:43.939
There's two to the 1000 different
00:24:43.940 --> 00:24:45.960
labels that you could assign different
00:24:45.960 --> 00:24:47.478
like label sets that you could assign
00:24:47.478 --> 00:24:49.965
to those 1000 points because either one
00:24:49.965 --> 00:24:50.440
could be.
00:24:50.440 --> 00:24:51.650
Every point can be positive or
00:24:51.650 --> 00:24:51.940
negative.
00:24:53.320 --> 00:24:55.150
For all of those two to the 1000
00:24:55.150 --> 00:24:57.110
different labelings, you can linearly
00:24:57.110 --> 00:24:59.110
separate it perfectly with 1000
00:24:59.110 --> 00:24:59.560
features.
00:25:00.500 --> 00:25:02.490
So that's pretty crazy.
00:25:02.490 --> 00:25:04.080
So this Linear classifier.
00:25:04.720 --> 00:25:07.480
Can deal with these two to the 1000
00:25:07.480 --> 00:25:09.370
different cases perfectly.
00:25:11.010 --> 00:25:12.420
So as you get into very high
00:25:12.420 --> 00:25:14.315
dimensions, Linear classifier gets very
00:25:14.315 --> 00:25:15.100
very powerful.
00:25:22.530 --> 00:25:23.060
00:25:23.940 --> 00:25:26.850
So the question is, more dimensions
00:25:26.850 --> 00:25:28.110
mean more storage?
00:25:28.110 --> 00:25:30.970
Yes, but it's only Linear, so.
00:25:31.040 --> 00:25:33.710
So that's not usually too much of a
00:25:33.710 --> 00:25:34.290
concern.
00:25:37.990 --> 00:25:38.230
Yes.
00:26:14.610 --> 00:26:16.100
So the question is like how do you
00:26:16.100 --> 00:26:18.160
visualize 1000 features?
00:26:18.830 --> 00:26:20.260
And.
00:26:20.400 --> 00:26:23.870
And so I will talk about essentially
00:26:23.870 --> 00:26:25.180
you have to map it down into 2
00:26:25.180 --> 00:26:26.750
dimensions or one dimension in
00:26:26.750 --> 00:26:29.390
different ways and I'll talk about that
00:26:29.390 --> 00:26:30.945
later in this semester.
00:26:30.945 --> 00:26:33.890
So there's the simplest methods are
00:26:33.890 --> 00:26:36.720
Linear Linear projections, principal
00:26:36.720 --> 00:26:38.490
component analysis, where you'd project
00:26:38.490 --> 00:26:40.230
it down under the dominant directions.
00:26:41.180 --> 00:26:43.220
There's also like nonlinear local
00:26:43.220 --> 00:26:46.640
embeddings that will create a better
00:26:46.640 --> 00:26:48.100
mapping out of all the features.
00:26:49.700 --> 00:26:51.880
You can also do things like analyze
00:26:51.880 --> 00:26:53.490
each feature by itself to see how
00:26:53.490 --> 00:26:54.380
predictive it is.
00:26:55.260 --> 00:26:56.750
And.
00:26:56.860 --> 00:26:57.750
But like.
00:26:58.850 --> 00:27:00.807
Ultimately you kind of need to do a
00:27:00.807 --> 00:27:01.010
test.
00:27:01.010 --> 00:27:03.120
So you what you would do is you do some
00:27:03.120 --> 00:27:04.936
kind of validation test where you would
00:27:04.936 --> 00:27:08.640
train a train a Linear model on say
00:27:08.640 --> 00:27:10.600
like 80% of the data and test it on the
00:27:10.600 --> 00:27:12.860
other 20% to see if you're able to
00:27:12.860 --> 00:27:15.200
predict the remaining 20% or if you
00:27:15.200 --> 00:27:16.439
want to just see if it's linearly
00:27:16.439 --> 00:27:16.646
separable.
00:27:16.646 --> 00:27:18.678
Then if you train it on all the data,
00:27:18.678 --> 00:27:20.633
if you get perfect Training Error then
00:27:20.633 --> 00:27:21.471
it's linearly separable.
00:27:21.471 --> 00:27:23.317
And if you don't get perfect Training
00:27:23.317 --> 00:27:25.180
Error then it's then it's not.
00:27:25.180 --> 00:27:27.830
Unless you like if you didn't apply a
00:27:27.830 --> 00:27:29.070
very strong regularization.
00:27:30.640 --> 00:27:31.060
You're welcome.
00:27:31.930 --> 00:27:33.380
Yeah, but you can't really visualize
00:27:33.380 --> 00:27:34.310
more than two dimensions.
00:27:34.310 --> 00:27:36.870
That's always a challenge, and it leads
00:27:36.870 --> 00:27:38.820
sometimes to bad intuitions.
00:27:40.520 --> 00:27:41.370
So.
00:27:42.610 --> 00:27:44.100
The thing is though that there is still
00:27:44.100 --> 00:27:45.970
like there might be many different ways
00:27:45.970 --> 00:27:48.560
that I can separate the points, so all
00:27:48.560 --> 00:27:50.500
of these will achieve 0 training error.
00:27:50.500 --> 00:27:53.000
So the different Classifiers, the
00:27:53.000 --> 00:27:54.860
different Linear Classifiers just have
00:27:54.860 --> 00:27:56.680
different ways of choosing the line
00:27:56.680 --> 00:27:58.600
essentially that make different
00:27:58.600 --> 00:27:59.200
assumptions.
00:28:00.850 --> 00:28:02.360
The.
00:28:02.420 --> 00:28:04.450
Common principles are that you want to
00:28:04.450 --> 00:28:06.670
get everything correct if you can, so
00:28:06.670 --> 00:28:08.295
it's kind of obvious like ideally you
00:28:08.295 --> 00:28:10.190
want to separate the positive from
00:28:10.190 --> 00:28:11.700
negative examples with your Linear
00:28:11.700 --> 00:28:12.210
classifier.
00:28:13.030 --> 00:28:14.860
Or you want the scores to predict the
00:28:14.860 --> 00:28:15.460
correct label?
00:28:17.150 --> 00:28:18.820
But you also want to have some high
00:28:18.820 --> 00:28:22.160
margin, so I would generally prefer
00:28:22.160 --> 00:28:25.110
this separating boundary than this one.
00:28:26.090 --> 00:28:28.465
Because this one, like everything, has
00:28:28.465 --> 00:28:30.340
like at least this distance away from
00:28:30.340 --> 00:28:32.860
the line, where with this boundary some
00:28:32.860 --> 00:28:34.415
of the points come pretty close to the
00:28:34.415 --> 00:28:34.630
line.
00:28:35.230 --> 00:28:37.420
And there's theory that shows that the
00:28:37.420 --> 00:28:40.340
bigger your margin for the same like
00:28:40.340 --> 00:28:41.320
weight size.
00:28:41.950 --> 00:28:44.590
The more likely you're classifier is to
00:28:44.590 --> 00:28:45.360
generalize.
00:28:45.360 --> 00:28:46.820
It kind of makes sense if you think of
00:28:46.820 --> 00:28:48.055
this as a random sample.
00:28:48.055 --> 00:28:50.346
If I were to Generate like more
00:28:50.346 --> 00:28:52.400
triangles from the sample, you could
00:28:52.400 --> 00:28:54.118
imagine that maybe one of the triangles
00:28:54.118 --> 00:28:55.595
would fall on the wrong side of the
00:28:55.595 --> 00:28:56.690
line and then this would make a
00:28:56.690 --> 00:28:58.800
Classification Error, while that seems
00:28:58.800 --> 00:29:00.270
less likely given this line.
00:29:05.420 --> 00:29:07.760
So that brings us to Linear Logistic
00:29:07.760 --> 00:29:08.390
Regression.
00:29:09.230 --> 00:29:12.440
And in Linear Logistic Regression, we
00:29:12.440 --> 00:29:14.390
want to maximize the probability of the
00:29:14.390 --> 00:29:15.560
labels given the data.
00:29:17.530 --> 00:29:19.747
And the probability of the label equals
00:29:19.747 --> 00:29:21.950
one given the data is given by this
00:29:21.950 --> 00:29:24.210
expression, here 1 / 1 + e to the
00:29:24.210 --> 00:29:25.710
negative my Linear model.
00:29:26.730 --> 00:29:29.620
This function 1 / 1 / 1 + E to the
00:29:29.620 --> 00:29:32.023
negative whatever is a Logistic
00:29:32.023 --> 00:29:34.056
function, that's called the Logistic
00:29:34.056 --> 00:29:34.449
function.
00:29:34.450 --> 00:29:37.132
So that's why this is Logistic Linear
00:29:37.132 --> 00:29:39.270
Logistic Regression because I've got a
00:29:39.270 --> 00:29:41.020
Linear model inside my Logistic
00:29:41.020 --> 00:29:41.500
function.
00:29:42.170 --> 00:29:44.060
So I'm regressing the Logistic function
00:29:44.060 --> 00:29:44.900
with a Linear model.
00:29:46.860 --> 00:29:48.240
This is called a logic.
00:29:48.240 --> 00:29:51.270
So this statement up here the second
00:29:51.270 --> 00:29:53.410
line implies that my Linear model.
00:29:54.200 --> 00:29:56.225
Is fitting the.
00:29:56.225 --> 00:29:59.210
It's called the odds log ratio.
00:29:59.210 --> 00:30:01.469
So it's the log or log odds ratio.
00:30:02.210 --> 00:30:04.673
It's the log of the probability of y =
00:30:04.673 --> 00:30:06.962
1 given X over the probability of y = 0
00:30:06.962 --> 00:30:07.450
given X.
00:30:08.360 --> 00:30:10.390
So if this is greater than zero, it
00:30:10.390 --> 00:30:13.373
means that probability of y = 1 given X
00:30:13.373 --> 00:30:16.216
is more likely than probability of y =
00:30:16.216 --> 00:30:18.480
0 given X, and if it's less than zero
00:30:18.480 --> 00:30:19.590
then the reverse is true.
00:30:20.780 --> 00:30:24.042
This ratio is always 2 alternatives, so
00:30:24.042 --> 00:30:24.807
it's one.
00:30:24.807 --> 00:30:26.350
It's either going to be one class or
00:30:26.350 --> 00:30:27.980
the other class, and this is the ratio
00:30:27.980 --> 00:30:29.060
of those probabilities.
00:30:34.620 --> 00:30:37.640
So if we think about Linear Logistic
00:30:37.640 --> 00:30:39.900
Regression versus Naive Bayes.
00:30:41.460 --> 00:30:43.350
They actually both have this Linear
00:30:43.350 --> 00:30:45.620
model for at least Naive Bayes does for
00:30:45.620 --> 00:30:47.420
many different probability functions.
00:30:48.070 --> 00:30:49.810
For all the probability functions and
00:30:49.810 --> 00:30:52.710
exponential family, which includes
00:30:52.710 --> 00:30:55.000
Bernoulli, multinomial, Gaussian,
00:30:55.000 --> 00:30:57.790
Laplacian, and many others, they're the
00:30:57.790 --> 00:31:00.010
favorite favorite probability family of
00:31:00.010 --> 00:31:00.970
statisticians.
00:31:02.600 --> 00:31:04.970
The Naive Bayes predictor is also
00:31:04.970 --> 00:31:07.610
Linear in X, but the difference is that
00:31:07.610 --> 00:31:09.580
in Logistic Regression you're free to
00:31:09.580 --> 00:31:11.460
independently tune these weights in
00:31:11.460 --> 00:31:14.580
order to achieve your overall label
00:31:14.580 --> 00:31:15.250
likelihood.
00:31:16.110 --> 00:31:17.835
While in Naive Bayes you're restricted
00:31:17.835 --> 00:31:19.650
to solve for each coefficient
00:31:19.650 --> 00:31:22.260
independently in order to maximize the
00:31:22.260 --> 00:31:24.580
probability of each feature given the
00:31:24.580 --> 00:31:24.940
label.
00:31:25.980 --> 00:31:27.620
So for that reason, I would say
00:31:27.620 --> 00:31:29.430
Logistic Regression model is typically
00:31:29.430 --> 00:31:31.060
more expressive than IBS.
00:31:31.870 --> 00:31:33.736
It's possible for your data to be
00:31:33.736 --> 00:31:35.610
linearly separable, but Naive Bayes
00:31:35.610 --> 00:31:37.980
does not achieve 0 training error while
00:31:37.980 --> 00:31:39.080
four Logistic Regression.
00:31:39.080 --> 00:31:40.637
You could always achieve 0 training
00:31:40.637 --> 00:31:42.335
error if your data is linearly
00:31:42.335 --> 00:31:42.830
separable.
00:31:45.160 --> 00:31:47.470
And then finally, it's important to
00:31:47.470 --> 00:31:48.930
note that Logistic Regression is
00:31:48.930 --> 00:31:50.810
directly fitting this discriminative
00:31:50.810 --> 00:31:52.500
function, so it's mapping from the
00:31:52.500 --> 00:31:54.826
features to a label and solving for
00:31:54.826 --> 00:31:55.339
that mapping.
00:31:56.050 --> 00:31:58.364
While many bees is trying to model the
00:31:58.364 --> 00:32:00.773
probability of the features given the
00:32:00.773 --> 00:32:02.405
data, so Logistic Regression doesn't
00:32:02.405 --> 00:32:02.840
model that.
00:32:02.840 --> 00:32:04.541
It just cares about the probability of
00:32:04.541 --> 00:32:06.383
the label given the data, not the
00:32:06.383 --> 00:32:07.486
probability of the data given the
00:32:07.486 --> 00:32:07.670
label.
00:32:09.020 --> 00:32:10.190
That probably features.
00:32:12.600 --> 00:32:13.050
Question.
00:32:14.990 --> 00:32:18.900
So Logistic Regression, sometimes
00:32:18.900 --> 00:32:20.520
people will say it's a discriminative
00:32:20.520 --> 00:32:22.529
function because you're trying to
00:32:22.530 --> 00:32:23.980
discriminate between the different
00:32:23.980 --> 00:32:25.330
things you're trying to Predict,
00:32:25.330 --> 00:32:28.130
meaning that you're trying to fit the
00:32:28.130 --> 00:32:29.560
probability of the thing that you're
00:32:29.560 --> 00:32:30.190
trying to Predict.
00:32:30.860 --> 00:32:33.170
Given the features or given the data.
00:32:34.120 --> 00:32:36.870
Where sometimes people say that.
00:32:36.940 --> 00:32:40.000
That, like Naive Bayes model is a
00:32:40.000 --> 00:32:42.490
generative model and they mean that
00:32:42.490 --> 00:32:45.270
you're trying to fit the probability of
00:32:45.270 --> 00:32:47.706
the data or the features given the
00:32:47.706 --> 00:32:48.100
label.
00:32:48.100 --> 00:32:49.719
So with Naive Bayes you end up with a
00:32:49.720 --> 00:32:52.008
joint distribution of all the data and
00:32:52.008 --> 00:32:52.384
features.
00:32:52.384 --> 00:32:54.500
With Logistic Regression you would just
00:32:54.500 --> 00:32:56.222
have the probability of the label given
00:32:56.222 --> 00:32:56.730
the features.
00:33:02.750 --> 00:33:03.200
So.
00:33:03.960 --> 00:33:06.140
With Linear Logistic Regression, the
00:33:06.140 --> 00:33:07.510
further you are from the lion, the
00:33:07.510 --> 00:33:08.700
higher the confidence.
00:33:08.700 --> 00:33:10.875
So if you're like way over here, then
00:33:10.875 --> 00:33:11.990
you're really confident you're a
00:33:11.990 --> 00:33:12.360
triangle.
00:33:12.360 --> 00:33:14.086
If you're just like right over here,
00:33:14.086 --> 00:33:15.076
then you're not very confident.
00:33:15.076 --> 00:33:16.595
And if you're right on the line, then
00:33:16.595 --> 00:33:18.165
you have equal confidence in triangle
00:33:18.165 --> 00:33:18.820
and circle.
00:33:21.820 --> 00:33:23.626
So the Logistic Regression algorithm
00:33:23.626 --> 00:33:25.300
there's always, as always, there's a
00:33:25.300 --> 00:33:26.710
Training and a Prediction phase.
00:33:27.790 --> 00:33:30.690
So in Training, you're trying to find
00:33:30.690 --> 00:33:31.810
the weights.
00:33:32.420 --> 00:33:35.450
That minimize this expression here
00:33:35.450 --> 00:33:36.635
which has two parts.
00:33:36.635 --> 00:33:39.750
The first part is a negative sum of log
00:33:39.750 --> 00:33:42.030
probability of Y given X and the
00:33:42.030 --> 00:33:42.400
weights.
00:33:43.370 --> 00:33:46.160
So breaking this down, South the reason
00:33:46.160 --> 00:33:47.022
for negative.
00:33:47.022 --> 00:33:49.177
So this is the negative.
00:33:49.177 --> 00:33:52.400
This is the same as.
00:33:52.470 --> 00:33:57.010
Maximizing the total probability of the
00:33:57.010 --> 00:33:58.100
labels given the data.
00:34:00.030 --> 00:34:01.670
The reason for the negative is just so
00:34:01.670 --> 00:34:03.960
I can write argument instead of argmax,
00:34:03.960 --> 00:34:05.830
because generally we tend to minimize
00:34:05.830 --> 00:34:07.320
things in machine learning, not
00:34:07.320 --> 00:34:07.960
maximize them.
00:34:08.680 --> 00:34:13.630
But the log is making it so that I turn
00:34:13.630 --> 00:34:14.220
my.
00:34:14.220 --> 00:34:15.820
Normally if I want to model a joint
00:34:15.820 --> 00:34:18.210
distribution, I have to take a product
00:34:18.210 --> 00:34:19.630
over all the different.
00:34:20.340 --> 00:34:21.760
Over all the different likelihood
00:34:21.760 --> 00:34:22.150
terms.
00:34:23.020 --> 00:34:24.570
But when I take the log of the product,
00:34:24.570 --> 00:34:25.940
it becomes the sum of the logs.
00:34:26.840 --> 00:34:29.360
And now another thing is that I'm
00:34:29.360 --> 00:34:31.940
assuming here that all of that each
00:34:31.940 --> 00:34:34.419
label only depends on its own features.
00:34:34.420 --> 00:34:36.764
So if I have 1000 data points, then
00:34:36.764 --> 00:34:38.938
each of the thousand labels only
00:34:38.938 --> 00:34:40.483
depends on the features for its own
00:34:40.483 --> 00:34:41.677
data point, it doesn't depend on all
00:34:41.677 --> 00:34:42.160
the others.
00:34:43.610 --> 00:34:45.700
And then I'm assuming that they all
00:34:45.700 --> 00:34:47.110
come from the same distribution.
00:34:47.110 --> 00:34:50.470
So I'm assuming IID independent and
00:34:50.470 --> 00:34:52.520
identically distributed data, which is
00:34:52.520 --> 00:34:55.120
always an almost always an unspoken
00:34:55.120 --> 00:34:56.390
assumption in machine learning.
00:34:58.540 --> 00:35:00.360
Alright, so the first term is saying I
00:35:00.360 --> 00:35:02.370
want to maximize the likelihood of my
00:35:02.370 --> 00:35:04.040
labels given the features over the
00:35:04.040 --> 00:35:04.610
Training set.
00:35:05.220 --> 00:35:06.460
So that's reasonable.
00:35:07.200 --> 00:35:08.880
And then the second term is a
00:35:08.880 --> 00:35:11.000
regularization term that says I prefer
00:35:11.000 --> 00:35:12.246
some models over others.
00:35:12.246 --> 00:35:14.280
I prefer models that have smaller
00:35:14.280 --> 00:35:16.280
weights, and I'll get into that a
00:35:16.280 --> 00:35:17.660
little bit more in a later slide.
00:35:20.460 --> 00:35:22.170
So that Prediction is straightforward,
00:35:22.170 --> 00:35:23.910
it's just I kind of already went
00:35:23.910 --> 00:35:24.680
through it.
00:35:24.680 --> 00:35:26.360
Once you have the weights, all you have
00:35:26.360 --> 00:35:28.160
to do is multiply your weights by your
00:35:28.160 --> 00:35:30.330
features, and that gives you the score
00:35:30.330 --> 00:35:31.180
question.
00:35:38.860 --> 00:35:40.590
Yeah, so I should explain the notation.
00:35:40.590 --> 00:35:42.090
There's different ways of denoting
00:35:42.090 --> 00:35:42.960
this, so.
00:35:44.230 --> 00:35:48.050
Usually when somebody puts a bar, they
00:35:48.050 --> 00:35:50.680
mean that it's given some features,
00:35:50.680 --> 00:35:52.440
given some data points or whatever.
00:35:53.130 --> 00:35:55.156
And then when somebody puts like a semi
00:35:55.156 --> 00:35:56.330
colon, or at least when I do it.
00:35:56.330 --> 00:35:58.450
But I see this a lot, if somebody puts
00:35:58.450 --> 00:36:00.660
like a semi colon here, then they're
00:36:00.660 --> 00:36:02.580
saying that these are the parameters.
00:36:02.580 --> 00:36:04.070
So what we're saying is that this
00:36:04.070 --> 00:36:05.380
probability function.
00:36:06.360 --> 00:36:08.830
Is like parameterized by W.
00:36:09.640 --> 00:36:13.536
And the input to that function is X and
00:36:13.536 --> 00:36:15.030
the output of the function.
00:36:15.810 --> 00:36:18.590
Is that probability of Y?
00:36:23.080 --> 00:36:24.688
The other way that you can write it
00:36:24.688 --> 00:36:26.676
that you it sometimes, and I first had
00:36:26.676 --> 00:36:28.443
it this way and then I switched it, is
00:36:28.443 --> 00:36:30.890
you might write like a subscript, so it
00:36:30.890 --> 00:36:33.635
might be P under score West.
00:36:33.635 --> 00:36:35.590
And part of the reason why you put this
00:36:35.590 --> 00:36:37.480
in here is just because otherwise it's
00:36:37.480 --> 00:36:39.776
not obvious that this term depends on
00:36:39.776 --> 00:36:40.480
West at all.
00:36:40.480 --> 00:36:43.405
And if you were like if you looked at
00:36:43.405 --> 00:36:45.170
it quickly and you were like trying to
00:36:45.170 --> 00:36:46.440
solve, you just be like, I don't care
00:36:46.440 --> 00:36:47.620
about that term, I'm just doing
00:36:47.620 --> 00:36:48.380
regularization.
00:36:49.600 --> 00:36:50.260
Question.
00:36:57.930 --> 00:37:00.370
So I forgot to say this out loud.
00:37:04.110 --> 00:37:06.070
So it is simplify the notation.
00:37:06.070 --> 00:37:08.980
I may omit the B which can be avoided
00:37:08.980 --> 00:37:10.971
by putting A1 at the end of the feature
00:37:10.971 --> 00:37:11.225
vector.
00:37:11.225 --> 00:37:12.702
So basically you can always take your
00:37:12.702 --> 00:37:14.326
feature vector and add a one to the end
00:37:14.326 --> 00:37:16.763
of all your features and then the B
00:37:16.763 --> 00:37:19.230
just becomes one of the W's and so I'm
00:37:19.230 --> 00:37:20.830
going to leave out the BA lot of times
00:37:20.830 --> 00:37:21.950
because otherwise it just kind of
00:37:21.950 --> 00:37:23.060
clutters up the equations.
00:37:27.540 --> 00:37:28.080
Thanks for.
00:37:28.970 --> 00:37:30.430
Pointing out though.
00:37:32.040 --> 00:37:34.090
Alright, so as I said before, one
00:37:34.090 --> 00:37:34.390
second.
00:37:34.390 --> 00:37:36.430
As I said before the this is the
00:37:36.430 --> 00:37:38.370
probability function that Logistic
00:37:38.370 --> 00:37:39.390
Regression assumes.
00:37:39.390 --> 00:37:41.691
If I multiply the top and the bottom by
00:37:41.691 --> 00:37:44.115
east to the West transpose X, then it's
00:37:44.115 --> 00:37:46.478
this because east to the West transpose
00:37:46.478 --> 00:37:47.630
X times that is 1.
00:37:48.540 --> 00:37:50.370
And then this generalizes.
00:37:50.370 --> 00:37:53.020
If I have multiple classes, then I
00:37:53.020 --> 00:37:54.740
would have a different weight vector
00:37:54.740 --> 00:37:55.640
for each class.
00:37:55.640 --> 00:37:57.435
So this is summing over all the classes
00:37:57.435 --> 00:37:59.545
and the final probability is given by
00:37:59.545 --> 00:38:02.120
this expression, so it's east to the
00:38:02.120 --> 00:38:02.980
Linear model.
00:38:04.170 --> 00:38:06.028
Divided by E to the sum of all the
00:38:06.028 --> 00:38:06.830
other Linear models.
00:38:06.830 --> 00:38:08.780
So it's basically your score for one
00:38:08.780 --> 00:38:10.646
model, divided by the score for all the
00:38:10.646 --> 00:38:12.513
other models, sum of score for all the
00:38:12.513 --> 00:38:12.979
other models.
00:38:14.140 --> 00:38:15.060
Was there a question?
00:38:15.060 --> 00:38:16.859
I thought somebody had a question,
00:38:16.860 --> 00:38:17.010
yeah.
00:38:25.670 --> 00:38:26.490
Yeah, good question.
00:38:26.490 --> 00:38:28.010
It's just the log of the probability.
00:38:28.820 --> 00:38:31.700
And the sum over N is just the
00:38:31.700 --> 00:38:33.690
probability term, it's not summing
00:38:33.690 --> 00:38:36.080
over, it's not the regularization times
00:38:36.080 --> 00:38:36.370
north.
00:38:39.350 --> 00:38:39.700
Question.
00:38:46.280 --> 00:38:50.170
If you're doing back prop, it depends
00:38:50.170 --> 00:38:51.770
on your activation functions, so.
00:38:52.600 --> 00:38:55.500
We will get into neural networks, but
00:38:55.500 --> 00:38:59.120
so you would if all your if at the end
00:38:59.120 --> 00:39:01.250
you have a Linear Logistic regressor.
00:39:01.880 --> 00:39:03.580
Then you would basically calculate the
00:39:03.580 --> 00:39:06.170
error due to your predictions in the
00:39:06.170 --> 00:39:08.170
last layer and then you would like
00:39:08.170 --> 00:39:10.234
accumulate those into the previous
00:39:10.234 --> 00:39:11.684
features and the previous features in
00:39:11.684 --> 00:39:12.409
the previous features.
00:39:13.980 --> 00:39:15.900
But sometimes people use like Velu or
00:39:15.900 --> 00:39:17.580
other activation functions, so then it
00:39:17.580 --> 00:39:18.100
would be different.
00:39:22.890 --> 00:39:24.900
So how do we train this thing?
00:39:24.900 --> 00:39:26.210
How do we optimize West?
00:39:27.330 --> 00:39:28.880
First, I want to explain the
00:39:28.880 --> 00:39:29.790
regularization term.
00:39:30.510 --> 00:39:31.710
There's two main kinds of
00:39:31.710 --> 00:39:32.610
regularization.
00:39:32.610 --> 00:39:35.740
There's L2 2 regularization and L1
00:39:35.740 --> 00:39:36.420
regularization.
00:39:37.080 --> 00:39:39.280
So L2 2 regularization is that you're
00:39:39.280 --> 00:39:41.756
minimizing the sum of the square values
00:39:41.756 --> 00:39:42.680
of the weights.
00:39:43.330 --> 00:39:45.908
I can write that as an L2 norm squared.
00:39:45.908 --> 00:39:48.985
That double bar thing is means like
00:39:48.985 --> 00:39:52.635
norm and the two under it means it's an
00:39:52.635 --> 00:39:55.132
L2 and the two above it means it's
00:39:55.132 --> 00:39:55.340
squared.
00:39:56.380 --> 00:39:58.500
Or I can write or I can do A1
00:39:58.500 --> 00:40:00.210
regularization, which is a sum of the
00:40:00.210 --> 00:40:01.660
absolute values of the weights.
00:40:02.920 --> 00:40:03.570
And.
00:40:05.220 --> 00:40:07.540
And I can write that as the norm like
00:40:07.540 --> 00:40:08.210
subscript 1.
00:40:09.350 --> 00:40:11.700
And then those are weighted by some
00:40:11.700 --> 00:40:13.670
Lambda which is a parameter that has to
00:40:13.670 --> 00:40:15.910
be set by the algorithm designer.
00:40:17.180 --> 00:40:20.100
Or based on some data like validation
00:40:20.100 --> 00:40:20.710
optimization.
00:40:21.820 --> 00:40:23.910
So these may look really similar
00:40:23.910 --> 00:40:25.650
squared absolute value.
00:40:25.650 --> 00:40:28.140
What's the difference as W goes higher?
00:40:28.140 --> 00:40:30.580
It means that you get a bigger penalty
00:40:30.580 --> 00:40:31.180
in either case.
00:40:31.890 --> 00:40:33.420
But they behave actually like quite
00:40:33.420 --> 00:40:33.960
differently.
00:40:34.830 --> 00:40:37.710
So if you look at this plot of L2
00:40:37.710 --> 00:40:39.990
versus L1, when the weight is 0,
00:40:39.990 --> 00:40:40.822
there's no penalty.
00:40:40.822 --> 00:40:43.090
When the weight is 1, the penalties are
00:40:43.090 --> 00:40:43.700
equal.
00:40:43.700 --> 00:40:45.760
When the weight is less than one, then
00:40:45.760 --> 00:40:48.207
the L2 penalty is smaller than the L1
00:40:48.207 --> 00:40:48.490
penalty.
00:40:48.490 --> 00:40:50.080
It has this like little basin where
00:40:50.080 --> 00:40:51.820
basically the penalty is almost 0.
00:40:52.760 --> 00:40:54.880
And but when the weight gets far from
00:40:54.880 --> 00:40:56.960
one, the L2 penalty shoots up.
00:40:57.870 --> 00:41:00.820
So L2 2 regularization hates really
00:41:00.820 --> 00:41:03.060
large weights, and they're perfectly
00:41:03.060 --> 00:41:05.030
fine with like lots of tiny little
00:41:05.030 --> 00:41:05.360
weights.
00:41:06.560 --> 00:41:08.490
L1 regularization doesn't like any
00:41:08.490 --> 00:41:10.600
weights, but it kind of doesn't like
00:41:10.600 --> 00:41:11.760
the mall roughly equally.
00:41:11.760 --> 00:41:14.170
So it doesn't like weights of three,
00:41:14.170 --> 00:41:16.699
but it's not as bad as it doesn't
00:41:16.700 --> 00:41:18.250
dislike them as much as L2 2.
00:41:19.130 --> 00:41:21.410
It also doesn't even a weight of 1.
00:41:21.410 --> 00:41:23.150
It's going to try just as hard to push
00:41:23.150 --> 00:41:24.722
that down as it does to push a weight
00:41:24.722 --> 00:41:25.200
of three.
00:41:27.020 --> 00:41:28.990
So when you think about when you when
00:41:28.990 --> 00:41:30.870
you think about optimization, you
00:41:30.870 --> 00:41:32.099
always want to think about the
00:41:32.100 --> 00:41:35.010
derivative as well as the.
00:41:35.390 --> 00:41:37.510
Like pure function, because you're
00:41:37.510 --> 00:41:38.830
always Minimizing, you're always
00:41:38.830 --> 00:41:40.310
setting a derivative equal to 0, and
00:41:40.310 --> 00:41:42.100
the derivative is what is like guiding
00:41:42.100 --> 00:41:45.400
your function optimization towards some
00:41:45.400 --> 00:41:46.270
optimal value.
00:41:47.590 --> 00:41:49.040
So if you're doing.
00:41:49.150 --> 00:41:49.800
00:41:51.230 --> 00:41:52.550
If you're doing L2.
00:41:54.530 --> 00:41:56.360
L2 2 minimization.
00:41:57.120 --> 00:41:59.965
And I plot the derivative, then the
00:41:59.965 --> 00:42:01.890
derivative is just going to be Linear,
00:42:01.890 --> 00:42:02.780
right?
00:42:02.780 --> 00:42:03.950
It's going to be.
00:42:04.820 --> 00:42:06.510
2/2 times.
00:42:06.590 --> 00:42:07.140
00:42:07.990 --> 00:42:10.420
It's going to be Lambda 2 WI and
00:42:10.420 --> 00:42:12.110
sometimes people put a 1/2 in front of
00:42:12.110 --> 00:42:13.800
Lambda just so that the two and the 1/2
00:42:13.800 --> 00:42:14.850
cancel out Mainly.
00:42:16.560 --> 00:42:17.850
Don't feel like it's necessary.
00:42:17.850 --> 00:42:21.350
If you do L2 one, then the derivatives
00:42:21.350 --> 00:42:26.830
are -, 1 if it's greater than zero, and
00:42:26.830 --> 00:42:29.310
positive one if it's less than 0.
00:42:30.270 --> 00:42:33.200
So basically, if it's L1 minimization,
00:42:33.200 --> 00:42:35.570
the regularization is like he's forcing
00:42:35.570 --> 00:42:38.080
things in towards zero with equal
00:42:38.080 --> 00:42:39.600
pressure no matter where it is.
00:42:40.240 --> 00:42:42.815
Wherewith L2 2 minimization, if you
00:42:42.815 --> 00:42:44.503
have a high value then it's like
00:42:44.503 --> 00:42:46.830
forcing it down, like really hard, and
00:42:46.830 --> 00:42:48.839
if you have a low low value then it's
00:42:48.840 --> 00:42:50.190
not forcing it very hard at all.
00:42:50.900 --> 00:42:52.500
And that's regularization is always
00:42:52.500 --> 00:42:53.960
struggling against the other term.
00:42:53.960 --> 00:42:55.640
These are like counterbalancing terms.
00:42:56.510 --> 00:42:58.000
So the regularization is trying to say
00:42:58.000 --> 00:42:58.790
your weights are small.
00:42:59.580 --> 00:43:02.400
But the log log likelihood term is
00:43:02.400 --> 00:43:04.750
trying to do whatever it can to solve
00:43:04.750 --> 00:43:07.710
that likelihood Prediction and so
00:43:07.710 --> 00:43:10.410
sometimes there sometimes there are
00:43:10.410 --> 00:43:11.080
odds with each other.
00:43:12.530 --> 00:43:14.700
Alright, so based on that, can anyone
00:43:14.700 --> 00:43:18.540
explain why it is that L2 1 tends to
00:43:18.540 --> 00:43:20.140
lead to sparse weights, meaning that
00:43:20.140 --> 00:43:21.890
you get a lot of 0 values for your
00:43:21.890 --> 00:43:22.250
weights?
00:43:25.980 --> 00:43:26.140
Yeah.
00:43:47.140 --> 00:43:48.630
Yeah, that's right.
00:43:48.630 --> 00:43:49.556
So L2.
00:43:49.556 --> 00:43:52.030
So the answer was that L2 1 prefers
00:43:52.030 --> 00:43:53.984
like a small number of features that
00:43:53.984 --> 00:43:56.300
have a lot of weight that have a lot of
00:43:56.300 --> 00:43:57.970
representational value or predictive
00:43:57.970 --> 00:43:58.370
value.
00:43:59.140 --> 00:44:01.370
Where I'll two really wants everything
00:44:01.370 --> 00:44:02.700
to have a little bit of predictive
00:44:02.700 --> 00:44:03.140
value.
00:44:03.770 --> 00:44:05.970
And you can see that by looking at the
00:44:05.970 --> 00:44:07.740
derivatives or just by thinking about
00:44:07.740 --> 00:44:08.500
this function.
00:44:09.140 --> 00:44:12.380
That L2 one just continually forces
00:44:12.380 --> 00:44:14.335
everything down until it hits exactly
00:44:14.335 --> 00:44:16.970
0, and while there's not necessarily a
00:44:16.970 --> 00:44:19.380
big penalty for some weight, so if you
00:44:19.380 --> 00:44:20.730
have a few features that are really
00:44:20.730 --> 00:44:22.558
predictive, it's going to allow those
00:44:22.558 --> 00:44:24.040
features to have a lot of weights,
00:44:24.040 --> 00:44:26.314
while if the other features are not
00:44:26.314 --> 00:44:27.579
predictive, given those few features,
00:44:27.579 --> 00:44:29.450
it's going to force them down to 0.
00:44:30.760 --> 00:44:33.132
With L2 2, if you have a lot of, if you
00:44:33.132 --> 00:44:34.440
have some features that are really
00:44:34.440 --> 00:44:35.870
predictive and others that are less
00:44:35.870 --> 00:44:38.040
predictive, it's still going to want
00:44:38.040 --> 00:44:40.260
those very predictive features to have
00:44:40.260 --> 00:44:41.790
like a bit smaller weight.
00:44:42.440 --> 00:44:44.520
And it's going to like try to make that
00:44:44.520 --> 00:44:46.530
up by having the other features will
00:44:46.530 --> 00:44:47.810
have just like a little bit of weight
00:44:47.810 --> 00:44:48.430
as well.
00:44:54.130 --> 00:44:56.360
So in consequence, we can use L2 1
00:44:56.360 --> 00:44:58.340
regularization to select the best
00:44:58.340 --> 00:45:01.260
features if we have if we have a bunch
00:45:01.260 --> 00:45:01.880
of features.
00:45:02.750 --> 00:45:04.610
And we want to instead have a model
00:45:04.610 --> 00:45:05.890
that's based on a smaller number of
00:45:05.890 --> 00:45:07.080
features.
00:45:07.080 --> 00:45:09.950
You can do solve for L1 Logistic
00:45:09.950 --> 00:45:11.790
Regression or L1 Linear Regression.
00:45:12.400 --> 00:45:14.160
And then choose the features that are
00:45:14.160 --> 00:45:17.000
non zero or greater than some epsilon
00:45:17.000 --> 00:45:20.470
and then just use those for your model.
00:45:22.810 --> 00:45:24.840
OK, I will answer this question for you
00:45:24.840 --> 00:45:26.430
to save a little bit of time.
00:45:27.540 --> 00:45:29.500
When is regularization absolutely
00:45:29.500 --> 00:45:30.110
essential?
00:45:30.110 --> 00:45:31.450
It's if your data is linearly
00:45:31.450 --> 00:45:31.970
separable.
00:45:33.390 --> 00:45:35.190
Because if your data is linearly
00:45:35.190 --> 00:45:37.445
separable then you just boost.
00:45:37.445 --> 00:45:38.820
You could boost your weights to
00:45:38.820 --> 00:45:41.083
Infinity and keep on separating it more
00:45:41.083 --> 00:45:41.789
and more and more.
00:45:42.530 --> 00:45:45.360
So if you have like 2.
00:45:46.270 --> 00:45:49.600
If you have two feature points here and
00:45:49.600 --> 00:45:50.020
here.
00:45:50.970 --> 00:45:54.160
Then you create this line.
00:45:55.260 --> 00:45:56.030
WX.
00:45:56.690 --> 00:45:59.088
If it's just one-dimensional and like
00:45:59.088 --> 00:46:02.220
if W is equal to 1, then maybe I have a
00:46:02.220 --> 00:46:04.900
score of 1 or -, 1 for each of these.
00:46:04.900 --> 00:46:08.215
But if test equals like 10,000, now my
00:46:08.215 --> 00:46:09.985
score is 10,000 and -, 10,000.
00:46:09.985 --> 00:46:11.355
So that's like even better, they're
00:46:11.355 --> 00:46:13.494
even further from zero and so there's
00:46:13.494 --> 00:46:15.130
no like there's no end to it.
00:46:15.130 --> 00:46:17.090
You're W would just go totally out of
00:46:17.090 --> 00:46:19.420
control and you would get an error
00:46:19.420 --> 00:46:21.500
probably that you're like that your
00:46:21.500 --> 00:46:22.830
optimization didn't converge.
00:46:23.730 --> 00:46:26.020
So you pretty much always want some
00:46:26.020 --> 00:46:27.610
kind of regularization weight, even if
00:46:27.610 --> 00:46:31.940
it's really small, to avoid this case
00:46:31.940 --> 00:46:34.760
where you don't have a unique solution
00:46:34.760 --> 00:46:35.990
to the optimization problem.
00:46:39.580 --> 00:46:41.240
There's a lot of different ways to
00:46:41.240 --> 00:46:43.890
optimize this and it's not that simple.
00:46:43.890 --> 00:46:47.440
So you can do various like gradient
00:46:47.440 --> 00:46:50.650
descents or things based on 2nd order
00:46:50.650 --> 00:46:54.868
terms, or lasso Regression for L1 or
00:46:54.868 --> 00:46:57.110
lasso lasso optimization.
00:46:57.110 --> 00:46:59.319
So there's a lot of different
00:46:59.320 --> 00:46:59.850
optimizers.
00:46:59.850 --> 00:47:01.540
I linked to this paper by Tom Minka
00:47:01.540 --> 00:47:03.490
that like explains like several
00:47:03.490 --> 00:47:05.290
different choices and their tradeoffs.
00:47:06.390 --> 00:47:07.760
At the end of the day, you're going to
00:47:07.760 --> 00:47:10.399
use a library, and so it's not really
00:47:10.400 --> 00:47:12.177
worth quoting this because it's a
00:47:12.177 --> 00:47:13.703
really explored problem and you're not
00:47:13.703 --> 00:47:15.040
going to make something better than
00:47:15.040 --> 00:47:15.840
somebody else did.
00:47:17.110 --> 00:47:19.000
So you want to use the library.
00:47:19.000 --> 00:47:20.810
It's worth like it's worth
00:47:20.810 --> 00:47:21.830
understanding the different
00:47:21.830 --> 00:47:25.540
optimization options a little bit, but
00:47:25.540 --> 00:47:26.800
I'm not going to talk about it.
00:47:30.030 --> 00:47:30.390
All right.
00:47:31.040 --> 00:47:31.550
So.
00:47:33.150 --> 00:47:35.760
Here I did an example where I visualize
00:47:35.760 --> 00:47:38.006
the weights that are learned using L2
00:47:38.006 --> 00:47:39.850
regularization and L1 regularization
00:47:39.850 --> 00:47:41.050
for some digits.
00:47:41.050 --> 00:47:42.820
So these are the average Pixels of
00:47:42.820 --> 00:47:43.940
digits zero to 4.
00:47:44.810 --> 00:47:47.308
These are the L2 2 weights and you can
00:47:47.308 --> 00:47:49.340
see like you can sort of see the
00:47:49.340 --> 00:47:51.125
numbers in it a little bit like you can
00:47:51.125 --> 00:47:52.820
sort of see the three in these weights
00:47:52.820 --> 00:47:53.020
that.
00:47:53.730 --> 00:47:56.437
And the zero, it wants these weights to
00:47:56.437 --> 00:47:58.428
be white, and it wants these weights to
00:47:58.428 --> 00:47:59.030
be dark.
00:47:59.690 --> 00:48:01.320
I mean these features to be dark,
00:48:01.320 --> 00:48:03.262
meaning that if you have a lit pixel
00:48:03.262 --> 00:48:05.099
here, it's less likely to be a 0.
00:48:05.099 --> 00:48:07.100
If you have a lit pixel here, it's more
00:48:07.100 --> 00:48:08.390
likely to be a 0.
00:48:10.300 --> 00:48:13.390
But for the L2 one, it's a lot sparser,
00:48:13.390 --> 00:48:15.590
so if it's like that blank Gray color,
00:48:15.590 --> 00:48:17.060
it means that the weights are zero.
00:48:18.220 --> 00:48:19.402
And if it's brighter or darker?
00:48:19.402 --> 00:48:20.670
If it's brighter, it means that the
00:48:20.670 --> 00:48:21.550
weight is positive.
00:48:22.260 --> 00:48:26.480
If it's darker than this uniform Gray,
00:48:26.480 --> 00:48:27.960
it means the weight is negative.
00:48:27.960 --> 00:48:30.430
So you can see that for L2 one, it's
00:48:30.430 --> 00:48:32.952
going to have like some subset of the
00:48:32.952 --> 00:48:35.123
L2 features are going to get all the
00:48:35.123 --> 00:48:36.900
weight, and most of the weights are
00:48:36.900 --> 00:48:38.069
very close to 0.
00:48:40.120 --> 00:48:42.000
So for one, it's only going to look at
00:48:42.000 --> 00:48:44.026
this small number of pixel, small
00:48:44.026 --> 00:48:45.990
number of pixels, and if any of these
00:48:45.990 --> 00:48:46.640
guys are.
00:48:47.400 --> 00:48:49.010
Are.
00:48:49.070 --> 00:48:51.130
Let then it's going to get a big
00:48:51.130 --> 00:48:52.500
penalty to being a 0.
00:48:53.150 --> 00:48:55.560
If any of these guys are, it gets a big
00:48:55.560 --> 00:48:56.939
boost to being a 0.
00:48:59.420 --> 00:48:59.780
Question.
00:49:36.370 --> 00:49:38.230
OK, let me explain a little bit more
00:49:38.230 --> 00:49:38.730
how I get this.
00:49:39.410 --> 00:49:42.470
1st So first this is up here is just
00:49:42.470 --> 00:49:45.510
simply averaging all the images in a
00:49:45.510 --> 00:49:46.370
particular class.
00:49:47.210 --> 00:49:49.550
And then I train 2 Logistic Regression
00:49:49.550 --> 00:49:50.240
models.
00:49:50.240 --> 00:49:52.780
One is trained using the same data that
00:49:52.780 --> 00:49:55.096
was used to Average, but to maximize
00:49:55.096 --> 00:49:57.480
the train, to maximize the probability
00:49:57.480 --> 00:49:59.670
of the labels given the data but under
00:49:59.670 --> 00:50:02.290
the L2 regularization penalty.
00:50:03.040 --> 00:50:05.090
And the other was trained to maximize
00:50:05.090 --> 00:50:06.320
the probability of the label is given
00:50:06.320 --> 00:50:08.450
the data under the L1 regularization
00:50:08.450 --> 00:50:08.920
penalty.
00:50:10.410 --> 00:50:12.355
The way that once you have these
00:50:12.355 --> 00:50:12.630
weights.
00:50:12.630 --> 00:50:14.512
So these weights are the W's.
00:50:14.512 --> 00:50:16.750
These are the coefficients that were
00:50:16.750 --> 00:50:19.220
learned as part of as your Linear
00:50:19.220 --> 00:50:19.560
model.
00:50:20.460 --> 00:50:22.310
In order to apply these weights to do
00:50:22.310 --> 00:50:23.320
Classification.
00:50:24.010 --> 00:50:26.000
You would multiply each of these
00:50:26.000 --> 00:50:27.760
weights with the corresponding pixel.
00:50:28.490 --> 00:50:31.280
So given a new test sample, you would
00:50:31.280 --> 00:50:34.510
take the sum over all the pixels of the
00:50:34.510 --> 00:50:36.900
pixel value times this weight.
00:50:37.720 --> 00:50:40.257
So if the way here is bright, it means
00:50:40.257 --> 00:50:41.755
that if the pixel value is bright, then
00:50:41.755 --> 00:50:43.170
the score is going to go up.
00:50:43.170 --> 00:50:45.805
And if the weight here is dark, that
00:50:45.805 --> 00:50:46.910
means it's negative.
00:50:46.910 --> 00:50:50.190
Then when you if the pixel value is on,
00:50:50.190 --> 00:50:52.169
then this is going, then the score is
00:50:52.169 --> 00:50:53.130
going to go down.
00:50:53.130 --> 00:50:55.330
So that's how to interpret.
00:50:56.370 --> 00:50:57.930
How to interpret the weights and?
00:50:57.930 --> 00:50:59.570
Normally it's just a vector, but I've
00:50:59.570 --> 00:51:01.340
reshaped it into the size of the image
00:51:01.340 --> 00:51:03.290
so you could see how it corresponds to
00:51:03.290 --> 00:51:04.160
the Pixels.
00:51:07.190 --> 00:51:08.740
Where Minimizing 2 things.
00:51:08.740 --> 00:51:10.540
One is that we're minimizing the
00:51:10.540 --> 00:51:11.900
negative log likelihood of the labels
00:51:11.900 --> 00:51:12.700
given the data.
00:51:12.700 --> 00:51:16.170
So in other words, we're maximizing the
00:51:16.170 --> 00:51:17.020
label likelihood.
00:51:17.930 --> 00:51:19.740
And the other is that we're minimizing
00:51:19.740 --> 00:51:21.237
the sum of the weights or the sum of
00:51:21.237 --> 00:51:21.920
the squared weights.
00:51:43.810 --> 00:51:44.290
Right.
00:51:44.290 --> 00:51:44.580
Yeah.
00:51:44.580 --> 00:51:45.385
So I Prediction time.
00:51:45.385 --> 00:51:47.530
So at Training time you have that
00:51:47.530 --> 00:51:48.388
regularization term.
00:51:48.388 --> 00:51:49.700
At Prediction time you don't.
00:51:49.700 --> 00:51:52.630
So at Prediction time, it's just the
00:51:52.630 --> 00:51:55.510
score for zero is the sum of all these
00:51:55.510 --> 00:51:57.340
coefficients times the corresponding
00:51:57.340 --> 00:51:58.100
pixel values.
00:51:58.760 --> 00:52:00.940
And the score for one is the sum of all
00:52:00.940 --> 00:52:02.960
these coefficient values times the
00:52:02.960 --> 00:52:04.947
corresponding pixel values, and so on
00:52:04.947 --> 00:52:05.830
for all the digits.
00:52:06.570 --> 00:52:08.210
And then at the end you choose.
00:52:08.210 --> 00:52:09.752
If you're just assigning a label, you
00:52:09.752 --> 00:52:11.240
choose the label with the highest
00:52:11.240 --> 00:52:11.510
score.
00:52:12.230 --> 00:52:12.410
Yeah.
00:52:13.580 --> 00:52:14.400
That did that help?
00:52:15.100 --> 00:52:15.360
OK.
00:52:17.880 --> 00:52:18.570
Alright.
00:52:24.020 --> 00:52:25.080
So.
00:52:26.630 --> 00:52:28.980
Alright, so then there's a question of
00:52:28.980 --> 00:52:29.990
how do we choose the Lambda?
00:52:31.260 --> 00:52:34.685
So selecting Lambda is often called a
00:52:34.685 --> 00:52:35.098
hyperparameter.
00:52:35.098 --> 00:52:37.574
A hyperparameter is it's a parameter
00:52:37.574 --> 00:52:40.366
that the algorithm designer sets that
00:52:40.366 --> 00:52:42.520
is not optimized directly by the
00:52:42.520 --> 00:52:43.120
Training data.
00:52:43.120 --> 00:52:45.530
So the weights are like Parameters of
00:52:45.530 --> 00:52:46.780
the Linear model.
00:52:46.780 --> 00:52:48.660
But the Lambda is a hyperparameter
00:52:48.660 --> 00:52:50.030
because it's a parameter of your
00:52:50.030 --> 00:52:51.714
objective function, not a parameter of
00:52:51.714 --> 00:52:52.219
your model.
00:52:56.490 --> 00:52:59.610
So when you're selecting values for
00:52:59.610 --> 00:53:02.660
your hyperparameters, the you can do it
00:53:02.660 --> 00:53:05.260
based on intuition, but more commonly
00:53:05.260 --> 00:53:07.780
you would do some kind of validation.
00:53:08.970 --> 00:53:11.210
So for example, you might say that
00:53:11.210 --> 00:53:14.000
Lambda is in this range, one of these
00:53:14.000 --> 00:53:16.125
values, 1/8, one quarter, one half one.
00:53:16.125 --> 00:53:18.350
It's usually not super sensitive, so
00:53:18.350 --> 00:53:21.440
there's no point going into like really
00:53:21.440 --> 00:53:22.840
tiny differences.
00:53:22.840 --> 00:53:24.919
And it also tends to be like
00:53:24.920 --> 00:53:27.010
exponential in its range.
00:53:27.010 --> 00:53:28.910
So for example, you don't want to
00:53:28.910 --> 00:53:32.650
search from 1/8 to 8 in steps of 1/8
00:53:32.650 --> 00:53:34.016
because that will be like a ton of
00:53:34.016 --> 00:53:36.080
values to check and like a difference
00:53:36.080 --> 00:53:39.090
between 7:00 and 7/8 and eight is like
00:53:39.090 --> 00:53:39.610
nothing.
00:53:39.680 --> 00:53:40.790
It won't make any difference.
00:53:41.830 --> 00:53:43.450
So usually you want to keep doubling it
00:53:43.450 --> 00:53:45.770
or multiplying it by a factor of 10 for
00:53:45.770 --> 00:53:46.400
every step.
00:53:47.690 --> 00:53:49.540
You train the model using a given
00:53:49.540 --> 00:53:51.489
Lambda from the training set, and you
00:53:51.490 --> 00:53:52.857
measure and record the performance from
00:53:52.857 --> 00:53:55.320
the validation set, and then you choose
00:53:55.320 --> 00:53:57.053
the Lambda and the model that gave you
00:53:57.053 --> 00:53:58.090
the best performance.
00:53:58.090 --> 00:53:59.540
So it's pretty straightforward.
00:54:00.500 --> 00:54:03.290
And you can optionally then retrain on
00:54:03.290 --> 00:54:05.330
the training and the validation set so
00:54:05.330 --> 00:54:07.150
that you didn't like only use your
00:54:07.150 --> 00:54:09.510
validation parameters for selecting
00:54:09.510 --> 00:54:11.992
that Lambda, and then test on the test
00:54:11.992 --> 00:54:12.299
set.
00:54:12.300 --> 00:54:13.653
But I'll note that you don't have to do
00:54:13.653 --> 00:54:14.866
that for the homework, you should, and
00:54:14.866 --> 00:54:16.350
the homework you should generally just.
00:54:17.480 --> 00:54:20.280
Use your validation for like measuring
00:54:20.280 --> 00:54:22.660
performance and selection and then just
00:54:22.660 --> 00:54:24.070
leave your Training.
00:54:24.070 --> 00:54:25.700
Leave the models trained on your
00:54:25.700 --> 00:54:25.960
Training set.
00:54:28.300 --> 00:54:30.010
And then once you've got your final
00:54:30.010 --> 00:54:32.170
model, you just test it on the test set
00:54:32.170 --> 00:54:33.680
and then that's the measure of the
00:54:33.680 --> 00:54:34.539
performance of your model.
00:54:36.890 --> 00:54:38.525
So you can start.
00:54:38.525 --> 00:54:41.020
So as I said, you typically will keep
00:54:41.020 --> 00:54:42.080
on like multiplying your
00:54:42.080 --> 00:54:44.190
hyperparameters by some factor rather
00:54:44.190 --> 00:54:45.380
than doing a Linear search.
00:54:46.390 --> 00:54:48.510
You can also start broad and narrow.
00:54:48.510 --> 00:54:51.405
So for example, if I found that 1/4 and
00:54:51.405 --> 00:54:54.320
1/2 were the best two values, but it
00:54:54.320 --> 00:54:55.570
seemed like there was actually like a
00:54:55.570 --> 00:54:56.960
pretty big difference between
00:54:56.960 --> 00:54:58.560
neighboring values, then I could then
00:54:58.560 --> 00:55:01.640
try like 3/8 and keep on subdividing it
00:55:01.640 --> 00:55:04.270
until I feel like I've gotten squeezed
00:55:04.270 --> 00:55:05.790
what I can out of that hyperparameter.
00:55:07.080 --> 00:55:09.750
Also, if you're searching over many
00:55:09.750 --> 00:55:13.450
Parameters simultaneously, the natural
00:55:13.450 --> 00:55:14.679
thing that you would do is you would do
00:55:14.680 --> 00:55:16.420
a grid search where you do for each
00:55:16.420 --> 00:55:19.380
Lambda and for each alpha, and for each
00:55:19.380 --> 00:55:21.510
beta you search over some range and try
00:55:21.510 --> 00:55:23.520
all combinations of things.
00:55:23.520 --> 00:55:25.145
That's actually really inefficient.
00:55:25.145 --> 00:55:28.377
The best thing to do is to randomly
00:55:28.377 --> 00:55:30.720
select your alpha, beta, gamma, or
00:55:30.720 --> 00:55:32.790
whatever things you're searching over,
00:55:32.790 --> 00:55:34.440
randomly select them within the
00:55:34.440 --> 00:55:35.410
candidate range.
00:55:36.790 --> 00:55:42.020
By probabilistic sampling and then try
00:55:42.020 --> 00:55:44.286
like 100 different variations and then
00:55:44.286 --> 00:55:46.173
and then choose the best combination.
00:55:46.173 --> 00:55:48.880
And the reason for that is that often
00:55:48.880 --> 00:55:50.530
the Parameters don't depend that
00:55:50.530 --> 00:55:51.550
strongly on each other.
00:55:52.140 --> 00:55:54.450
And that way in some Parameters will be
00:55:54.450 --> 00:55:55.920
much more important than others.
00:55:56.730 --> 00:55:58.620
And so if you randomly sample in the
00:55:58.620 --> 00:56:00.440
range, if you have multiple Parameters,
00:56:00.440 --> 00:56:02.270
then you get to try a lot more
00:56:02.270 --> 00:56:04.315
different values of each parameter than
00:56:04.315 --> 00:56:05.540
if you're doing a grid search.
00:56:09.500 --> 00:56:11.270
So validation.
00:56:11.390 --> 00:56:11.980
00:56:13.230 --> 00:56:14.870
You can also do cross validation.
00:56:14.870 --> 00:56:16.520
That's just if you split your Training,
00:56:16.520 --> 00:56:19.173
split your data set into multiple parts
00:56:19.173 --> 00:56:22.330
and each time you train on North minus
00:56:22.330 --> 00:56:24.642
one parts and then test on the north
00:56:24.642 --> 00:56:27.420
part and then you cycle through which
00:56:27.420 --> 00:56:28.840
part you use for validation.
00:56:29.650 --> 00:56:30.860
And then you Average all your
00:56:30.860 --> 00:56:31.775
validation performance.
00:56:31.775 --> 00:56:33.960
So you might do this if you have a very
00:56:33.960 --> 00:56:36.280
limited Training set, so that it's
00:56:36.280 --> 00:56:38.270
really hard to get both Training
00:56:38.270 --> 00:56:39.740
Parameters and get a measure of the
00:56:39.740 --> 00:56:41.770
performance with that one Training set,
00:56:41.770 --> 00:56:43.620
and so you can.
00:56:44.820 --> 00:56:47.600
You can then make more efficient use of
00:56:47.600 --> 00:56:48.840
your Training data this way.
00:56:48.840 --> 00:56:49.870
Sample efficient use.
00:56:50.650 --> 00:56:52.110
And the extreme you can do leave one
00:56:52.110 --> 00:56:53.780
out cross validation where you train
00:56:53.780 --> 00:56:55.777
with all your data except for one and
00:56:55.777 --> 00:56:58.050
then test on that one and then you
00:56:58.050 --> 00:57:00.965
cycle which point is used for
00:57:00.965 --> 00:57:03.749
validation through all the data
00:57:03.750 --> 00:57:04.300
samples.
00:57:06.440 --> 00:57:09.770
This is only practical if you if you're
00:57:09.770 --> 00:57:11.229
doing like Nearest neighbor for example
00:57:11.230 --> 00:57:12.890
where Training takes no time, then
00:57:12.890 --> 00:57:14.259
that's easy to do.
00:57:14.260 --> 00:57:16.859
Or if you're able to adjust your model
00:57:16.860 --> 00:57:19.657
by adjust it for the influence of 1
00:57:19.657 --> 00:57:19.885
sample.
00:57:19.885 --> 00:57:21.550
If you can like take out one sample
00:57:21.550 --> 00:57:23.518
really easily and adjust your model
00:57:23.518 --> 00:57:24.740
then you might be able to do this,
00:57:24.740 --> 00:57:26.455
which you could do with Naive Bayes for
00:57:26.455 --> 00:57:27.060
example as well.
00:57:32.060 --> 00:57:33.460
Right, so Summary of Logistic
00:57:33.460 --> 00:57:35.180
Regression.
00:57:35.180 --> 00:57:37.790
Key assumptions are that this log odds
00:57:37.790 --> 00:57:40.460
ratio can be expressed as a linear
00:57:40.460 --> 00:57:41.560
combination of features.
00:57:42.470 --> 00:57:44.589
So this probability of y = K given X
00:57:44.590 --> 00:57:46.710
over probability of Y not equal to K
00:57:46.710 --> 00:57:47.730
given X the log of that.
00:57:48.470 --> 00:57:51.770
Is just a Linear model W transpose X.
00:57:53.350 --> 00:57:55.990
I've got one coefficient per feature
00:57:55.990 --> 00:57:57.700
that's my model Parameters, plus maybe
00:57:57.700 --> 00:57:59.950
a bias term which the bias is modeling
00:57:59.950 --> 00:58:00.850
like the class prior.
00:58:02.320 --> 00:58:04.690
I can Choose L1 or L2 or both.
00:58:06.110 --> 00:58:08.110
Regularization in some weight on those.
00:58:09.810 --> 00:58:11.070
So this is really.
00:58:11.070 --> 00:58:13.090
This works well if you've got a lot of
00:58:13.090 --> 00:58:14.470
features, because again, it's much more
00:58:14.470 --> 00:58:16.100
powerful in a high dimensional space.
00:58:16.840 --> 00:58:18.740
And it's OK if some of those features
00:58:18.740 --> 00:58:20.520
are irrelevant or redundant, where
00:58:20.520 --> 00:58:22.110
things like Naive Bayes will get
00:58:22.110 --> 00:58:24.010
tripped up by irrelevant or redundant
00:58:24.010 --> 00:58:24.360
features.
00:58:25.480 --> 00:58:28.210
And it provides a good estimate of the
00:58:28.210 --> 00:58:29.380
label likelihood.
00:58:29.380 --> 00:58:32.290
So it tends to give you a well
00:58:32.290 --> 00:58:34.233
calibrated classifier, which means that
00:58:34.233 --> 00:58:36.425
if you look at its confidence, if the
00:58:36.425 --> 00:58:39.520
confidence is 8, then like 80% of the
00:58:39.520 --> 00:58:41.279
times that the confidence is .8, it
00:58:41.280 --> 00:58:41.960
will be correct.
00:58:42.710 --> 00:58:43.300
Roughly.
00:58:44.800 --> 00:58:46.150
Not to use and Weaknesses.
00:58:46.150 --> 00:58:47.689
If the features are low dimensional,
00:58:47.690 --> 00:58:49.410
then the Linear function is not likely
00:58:49.410 --> 00:58:50.600
to be expressive enough.
00:58:50.600 --> 00:58:52.824
So usually if your features are low
00:58:52.824 --> 00:58:54.395
dimensional to start with, you actually
00:58:54.395 --> 00:58:56.055
like turn them into high dimensional
00:58:56.055 --> 00:58:59.480
features first, like by doing trees or
00:58:59.480 --> 00:59:01.820
other ways of like turning continuous
00:59:01.820 --> 00:59:03.690
values into a lot of discrete values.
00:59:04.310 --> 00:59:05.900
And then you apply your Linear
00:59:05.900 --> 00:59:06.450
classifier.
00:59:10.310 --> 00:59:11.890
Right, so I was going to do like a
00:59:11.890 --> 00:59:13.600
Pause thing here, but since we only
00:59:13.600 --> 00:59:16.490
have 15 minutes left, I will use this
00:59:16.490 --> 00:59:18.470
as a Review question for the start of
00:59:18.470 --> 00:59:20.850
the next lecture.
00:59:20.850 --> 00:59:22.830
And I want to I do want to get into
00:59:22.830 --> 00:59:25.820
Linear Regression so apologies for.
00:59:26.860 --> 00:59:28.010
Fairly heavy.
00:59:29.390 --> 00:59:30.620
75 minutes.
00:59:33.310 --> 00:59:34.229
Yeah, there's a lot of math.
00:59:34.230 --> 00:59:37.080
There will be a lot of math every
00:59:37.080 --> 00:59:38.755
Lecture, pretty much.
00:59:38.755 --> 00:59:40.120
There's never not.
00:59:40.970 --> 00:59:42.075
There's always Linear.
00:59:42.075 --> 00:59:43.920
There's always Linear linear algebra,
00:59:43.920 --> 00:59:45.060
calculus, probability.
00:59:45.060 --> 00:59:47.920
It's part of every part of machine
00:59:47.920 --> 00:59:48.210
learning.
00:59:49.250 --> 00:59:50.380
So.
00:59:50.700 --> 00:59:52.002
Alright, so Linear Regression.
00:59:52.002 --> 00:59:53.470
Linear Regression is actually a little
00:59:53.470 --> 00:59:55.790
bit more intuitive I think than Linear
00:59:55.790 --> 00:59:57.645
Logistic Regression because you're just
00:59:57.645 --> 00:59:59.600
your Linear function is just like a
00:59:59.600 --> 01:00:01.440
lion, you're just fitting the data and
01:00:01.440 --> 01:00:02.570
we see this all the time.
01:00:02.570 --> 01:00:04.236
Like if you use Excel you can do a
01:00:04.236 --> 01:00:05.380
Linear fit to your plot.
01:00:06.120 --> 01:00:08.420
And there's a lot of reasons that you
01:00:08.420 --> 01:00:09.850
want to use Linear Regression.
01:00:09.850 --> 01:00:11.940
You might want to just like explain a
01:00:11.940 --> 01:00:12.580
trend.
01:00:12.580 --> 01:00:15.010
You might want to extrapolate the data
01:00:15.010 --> 01:00:18.330
to say if my Frequency were like 25 for
01:00:18.330 --> 01:00:21.530
chirps, then what is my likely cricket
01:00:21.530 --> 01:00:21.970
Temperature?
01:00:23.780 --> 01:00:25.265
You may want to do.
01:00:25.265 --> 01:00:26.950
You may actually want to do Prediction
01:00:26.950 --> 01:00:28.159
if you have a lot of features and
01:00:28.160 --> 01:00:29.580
you're trying to predict a single
01:00:29.580 --> 01:00:30.740
variable.
01:00:30.740 --> 01:00:32.650
Again, here I'm only showing 2D plots,
01:00:32.650 --> 01:00:34.500
but you can, like in your Temperature
01:00:34.500 --> 01:00:36.110
Regression problem, you can't have lots
01:00:36.110 --> 01:00:37.600
of features and use the Linear model
01:00:37.600 --> 01:00:37.800
on.
01:00:39.630 --> 01:00:41.046
The Linear Regression, you're trying to
01:00:41.046 --> 01:00:42.750
fit Linear coefficients to features to
01:00:42.750 --> 01:00:44.920
predicted continuous variable, and if
01:00:44.920 --> 01:00:46.545
you're trying to fit multiple
01:00:46.545 --> 01:00:48.560
continuous variables, then you do, then
01:00:48.560 --> 01:00:49.920
you have multiple Linear models.
01:00:52.450 --> 01:00:55.900
So this is evaluated by like root mean
01:00:55.900 --> 01:00:57.940
squared error, the sum of squared
01:00:57.940 --> 01:00:59.570
differences between the points.
01:01:01.560 --> 01:01:02.930
Square root of that.
01:01:02.930 --> 01:01:04.942
Or it could be like the median absolute
01:01:04.942 --> 01:01:06.890
error, which is the absolute difference
01:01:06.890 --> 01:01:08.858
between the points and the median of
01:01:08.858 --> 01:01:10.907
that, various combinations of that.
01:01:10.907 --> 01:01:13.079
And then here I'm showing the R2
01:01:13.080 --> 01:01:15.680
residual which is essentially the
01:01:15.680 --> 01:01:19.460
variance or the sum of squared error of
01:01:19.460 --> 01:01:20.490
the points.
01:01:21.110 --> 01:01:24.550
From the predicted line divided by the
01:01:24.550 --> 01:01:27.897
sum of squared difference between the
01:01:27.897 --> 01:01:29.771
points and the average of the points,
01:01:29.771 --> 01:01:31.378
the predicted values and the target
01:01:31.378 --> 01:01:33.252
values, and the average of the target
01:01:33.252 --> 01:01:33.519
values.
01:01:35.360 --> 01:01:37.750
It's 1 minus that thing, and so this is
01:01:37.750 --> 01:01:39.825
essentially the amount of variance that
01:01:39.825 --> 01:01:42.810
is explained by your Linear model.
01:01:43.550 --> 01:01:44.690
That's the R2.
01:01:45.960 --> 01:01:48.460
And if R2 is close to zero, then it
01:01:48.460 --> 01:01:50.810
means that the Linear model that you
01:01:50.810 --> 01:01:52.680
can't really linearly explain your
01:01:52.680 --> 01:01:54.880
target variable very well from the
01:01:54.880 --> 01:01:55.440
features.
01:01:56.470 --> 01:01:58.390
If it's close to one, it means that you
01:01:58.390 --> 01:02:00.060
can explain it almost perfectly.
01:02:00.060 --> 01:02:01.310
In other words, you can get an almost
01:02:01.310 --> 01:02:03.440
perfect Prediction compared to the
01:02:03.440 --> 01:02:04.230
original variance.
01:02:05.570 --> 01:02:08.330
So you can see here that this isn't
01:02:08.330 --> 01:02:09.060
really.
01:02:09.060 --> 01:02:10.500
If you look at the points, there's
01:02:10.500 --> 01:02:12.060
actually a curve to it, so there's
01:02:12.060 --> 01:02:14.203
probably a better fit than this Linear
01:02:14.203 --> 01:02:14.649
model.
01:02:14.650 --> 01:02:16.220
But the Linear model still isn't too
01:02:16.220 --> 01:02:16.670
bad.
01:02:16.670 --> 01:02:18.789
We have an R sqrt 87.
01:02:20.350 --> 01:02:23.330
Here the Linear model seems pretty
01:02:23.330 --> 01:02:25.410
decent, but there's a lot of as a
01:02:25.410 --> 01:02:25.920
choice.
01:02:25.920 --> 01:02:28.200
But there's a lot of variance to the
01:02:28.200 --> 01:02:28.570
data.
01:02:28.570 --> 01:02:30.632
Even for this exact same data, exact
01:02:30.632 --> 01:02:32.210
same Frequency, there's many different
01:02:32.210 --> 01:02:32.660
temperatures.
01:02:33.430 --> 01:02:35.400
And so here the amount of variance that
01:02:35.400 --> 01:02:37.010
can be explained is 68%.
01:02:42.160 --> 01:02:43.010
The Linear.
01:02:44.090 --> 01:02:44.630
Whoops.
01:02:45.760 --> 01:02:48.400
This should actually Linear Regression
01:02:48.400 --> 01:02:49.670
algorithm, not Logistic.
01:02:52.200 --> 01:02:54.090
So the Linear Regression algorithm.
01:02:54.090 --> 01:02:55.520
It's an easy mistake to make because
01:02:55.520 --> 01:02:56.570
they look almost the same.
01:02:57.300 --> 01:02:59.800
Is just that I'm Minimizing.
01:02:59.800 --> 01:03:01.440
Now I'm just minimizing the squared
01:03:01.440 --> 01:03:03.580
difference between the Linear model and
01:03:03.580 --> 01:03:04.630
the.
01:03:05.480 --> 01:03:08.640
And the target value over all of the.
01:03:09.380 --> 01:03:11.050
XNS so also.
01:03:11.970 --> 01:03:13.280
Let me fix.
01:03:17.040 --> 01:03:19.170
So this should be X.
01:03:21.580 --> 01:03:21.900
OK.
01:03:23.800 --> 01:03:25.740
Right, so I'm minimizing the sum of
01:03:25.740 --> 01:03:27.820
squared error here between the
01:03:27.820 --> 01:03:29.718
predicted value and the true value, and
01:03:29.718 --> 01:03:32.280
you could have different variations on
01:03:32.280 --> 01:03:32.482
that.
01:03:32.482 --> 01:03:34.140
You could minimize the sum of absolute
01:03:34.140 --> 01:03:35.825
error, which is a harder thing to
01:03:35.825 --> 01:03:38.030
minimize but more robust to outliers.
01:03:38.030 --> 01:03:39.340
And then I also have this
01:03:39.340 --> 01:03:41.520
regularization term that Prediction is
01:03:41.520 --> 01:03:43.340
just the sum of weights times the
01:03:43.340 --> 01:03:45.950
features or W transpose X.
01:03:45.950 --> 01:03:47.500
So straightforward.
01:03:50.060 --> 01:03:52.780
In terms of the optimization, it's just
01:03:52.780 --> 01:03:55.070
if you have L2 2 regularization, then
01:03:55.070 --> 01:03:55.920
it's just a.
01:03:57.260 --> 01:03:59.130
At least squares optimization.
01:03:59.810 --> 01:04:00.320
So.
01:04:01.360 --> 01:04:03.050
I did like a sort of Brief.
01:04:03.620 --> 01:04:06.760
Brief derivation, just Minimizing that
01:04:06.760 --> 01:04:07.970
function, taking the derivative,
01:04:07.970 --> 01:04:08.790
setting it equal to 0.
01:04:09.640 --> 01:04:12.180
At the end you will skip most of the
01:04:12.180 --> 01:04:13.770
steps because it's just a.
01:04:14.830 --> 01:04:15.905
It's the least squares problem.
01:04:15.905 --> 01:04:17.520
It shows up in a lot of cases and I
01:04:17.520 --> 01:04:19.020
didn't want to focus on it.
01:04:19.700 --> 01:04:21.079
At the end you will get this thing.
01:04:21.080 --> 01:04:24.000
So you'll say that A is the thing that
01:04:24.000 --> 01:04:25.810
minimizes this squared term.
01:04:27.340 --> 01:04:28.810
Or this is just a different way of
01:04:28.810 --> 01:04:31.508
writing that problem and so this is an
01:04:31.508 --> 01:04:32.970
N by M matrix.
01:04:32.970 --> 01:04:36.506
So these are your N examples and M
01:04:36.506 --> 01:04:36.984
features.
01:04:36.984 --> 01:04:38.690
This is the thing that we're
01:04:38.690 --> 01:04:39.420
optimizing.
01:04:39.420 --> 01:04:41.590
It's an M by 1 vector if I have M
01:04:41.590 --> 01:04:41.890
features.
01:04:42.630 --> 01:04:44.900
These are my values that I want to
01:04:44.900 --> 01:04:45.540
Predict.
01:04:45.540 --> 01:04:47.200
This is an north by 1 vector.
01:04:47.200 --> 01:04:49.420
That's my Different labels for the
01:04:49.420 --> 01:04:50.370
North examples.
01:04:50.950 --> 01:04:53.550
And then I'm squaring that term in
01:04:53.550 --> 01:04:54.700
matrix wise.
01:04:55.570 --> 01:04:58.577
And the solution this is just that a is
01:04:58.577 --> 01:05:01.125
the pseudo inverse of X * Y which
01:05:01.125 --> 01:05:02.920
pseudo inverse is given here.
01:05:05.640 --> 01:05:08.470
And again if you have.
01:05:09.510 --> 01:05:10.400
So.
01:05:11.060 --> 01:05:13.180
The regularization is exactly the same.
01:05:13.180 --> 01:05:15.455
It's usually used L2 or L1
01:05:15.455 --> 01:05:16.900
regularization and they do the same
01:05:16.900 --> 01:05:18.050
things that they did in Logistic
01:05:18.050 --> 01:05:18.335
Regression.
01:05:18.335 --> 01:05:19.890
They want the weights to be small, but
01:05:19.890 --> 01:05:23.280
L2 one wants is OK with some sparse
01:05:23.280 --> 01:05:25.186
higher values where L2 2 wants all the
01:05:25.186 --> 01:05:25.850
weights to be small.
01:05:27.820 --> 01:05:30.020
So L2 2 Linear Regression is pretty
01:05:30.020 --> 01:05:31.540
easy to implement, it's just going to
01:05:31.540 --> 01:05:37.020
be like in pseudocode or roughly exact
01:05:37.020 --> 01:05:37.290
code.
01:05:37.970 --> 01:05:41.530
It would just be inverse X * Y.
01:05:41.530 --> 01:05:42.190
That's it.
01:05:42.190 --> 01:05:44.360
So W equals inverse X * Y.
01:05:45.070 --> 01:05:47.700
And if you add some regularization
01:05:47.700 --> 01:05:50.080
term, you just have to add to XA little
01:05:50.080 --> 01:05:51.830
bit and add on to that.
01:05:51.830 --> 01:05:53.330
The target for West is 0.
01:05:55.330 --> 01:05:55.940
And.
01:05:56.740 --> 01:05:58.610
L1 regularization is actually a pretty
01:05:58.610 --> 01:06:00.850
tricky optimization problem, but I
01:06:00.850 --> 01:06:02.920
would just say you can also use the
01:06:02.920 --> 01:06:04.620
library for either of these.
01:06:04.620 --> 01:06:07.260
So similar to 1 Logistic Regression,
01:06:07.260 --> 01:06:08.890
Linear Regression is ubiquitous.
01:06:08.890 --> 01:06:10.470
No matter what program language you're
01:06:10.470 --> 01:06:12.190
using, there's going to be a library
01:06:12.190 --> 01:06:14.310
that you can use to solve this problem.
01:06:15.410 --> 01:06:18.517
So when I decide whether you should
01:06:18.517 --> 01:06:20.400
implement something by hand, or know
01:06:20.400 --> 01:06:22.202
how to implement it by hand, or whether
01:06:22.202 --> 01:06:24.240
you should just use a model, it's kind
01:06:24.240 --> 01:06:25.353
of a function of like.
01:06:25.353 --> 01:06:27.360
How complicated is that optimization
01:06:27.360 --> 01:06:30.200
problem also, are there?
01:06:30.200 --> 01:06:32.350
Is it like a really standard problem
01:06:32.350 --> 01:06:34.320
where you're pretty much guaranteed
01:06:34.320 --> 01:06:35.350
that for your own?
01:06:36.270 --> 01:06:37.260
Custom problem.
01:06:37.260 --> 01:06:39.530
You'll be able to just use a library to
01:06:39.530 --> 01:06:40.410
solve it.
01:06:40.410 --> 01:06:41.920
Or is it something where there's a lot
01:06:41.920 --> 01:06:43.380
of customization that's typically
01:06:43.380 --> 01:06:45.170
involved, like for a Naive Bayes for
01:06:45.170 --> 01:06:45.620
example.
01:06:47.590 --> 01:06:48.560
And.
01:06:49.670 --> 01:06:51.250
And that's basically it.
01:06:51.250 --> 01:06:53.750
So in cases where the optimization is
01:06:53.750 --> 01:06:55.750
hard and there's not much customization
01:06:55.750 --> 01:06:57.680
to be done and it's a really well
01:06:57.680 --> 01:07:00.140
established problem, then you might as
01:07:00.140 --> 01:07:01.536
well just use a model that's out there
01:07:01.536 --> 01:07:02.900
and not worry about the.
01:07:03.800 --> 01:07:05.050
Details of optimization.
01:07:07.130 --> 01:07:08.520
The one thing that's important to know
01:07:08.520 --> 01:07:11.150
is that sometimes you have, sometimes
01:07:11.150 --> 01:07:12.480
it's helpful to transform the
01:07:12.480 --> 01:07:13.050
variables.
01:07:13.920 --> 01:07:15.520
So it might be that originally your
01:07:15.520 --> 01:07:18.460
model is not very linearly predictive,
01:07:18.460 --> 01:07:19.250
so.
01:07:20.660 --> 01:07:24.330
Here I have a frequency of word usage
01:07:24.330 --> 01:07:25.160
in Shakespeare.
01:07:26.220 --> 01:07:29.270
And on the X axis is the rank of how
01:07:29.270 --> 01:07:31.360
common that word is.
01:07:31.360 --> 01:07:34.537
So the most common word occurs 14,000
01:07:34.537 --> 01:07:37.062
times, the second most common word
01:07:37.062 --> 01:07:39.290
occurs 4000 times, the third most
01:07:39.290 --> 01:07:41.190
common word occurs 2000 times.
01:07:41.960 --> 01:07:42.732
And so on.
01:07:42.732 --> 01:07:45.300
So it keeps on dropping by a big
01:07:45.300 --> 01:07:46.490
fraction every time.
01:07:47.420 --> 01:07:49.020
Most common word might be thy or
01:07:49.020 --> 01:07:49.500
something.
01:07:50.570 --> 01:07:53.864
So if I try to do a Linear fit to that,
01:07:53.864 --> 01:07:55.620
it's not really a good fit.
01:07:55.620 --> 01:07:57.670
It's obviously like not really lying
01:07:57.670 --> 01:07:59.085
along those points at all.
01:07:59.085 --> 01:08:01.220
It's way underestimating for the small
01:08:01.220 --> 01:08:03.140
values and weight overestimating where
01:08:03.140 --> 01:08:06.230
the rank is high, or reverse that
01:08:06.230 --> 01:08:06.990
weight, underestimating.
01:08:07.990 --> 01:08:09.810
It's underestimating both of those.
01:08:09.810 --> 01:08:11.680
It's only overestimating this range.
01:08:12.470 --> 01:08:13.010
And.
01:08:13.880 --> 01:08:17.030
But if I like think about it, I can see
01:08:17.030 --> 01:08:18.450
that there's some kind of logarithmic
01:08:18.450 --> 01:08:20.350
behavior here, where it's always
01:08:20.350 --> 01:08:22.840
decreasing by some fraction rather than
01:08:22.840 --> 01:08:24.540
decreasing by a constant amount.
01:08:25.830 --> 01:08:28.809
And so if I replot this as a log log
01:08:28.810 --> 01:08:31.100
plot where I have the log rank on the X
01:08:31.100 --> 01:08:33.940
axis and the log number of appearances.
01:08:34.610 --> 01:08:36.000
On the Y axis.
01:08:36.000 --> 01:08:39.680
Then I have this nice Linear behavior
01:08:39.680 --> 01:08:42.030
and so now I can fit a linear model to
01:08:42.030 --> 01:08:43.000
my log log plot.
01:08:43.860 --> 01:08:47.040
And then I can in order to do that, I
01:08:47.040 --> 01:08:49.380
would just then have essentially.
01:08:52.910 --> 01:08:56.150
I would say like let's say X hat.
01:08:57.550 --> 01:09:01.610
Equals log of X where X is the rank.
01:09:03.380 --> 01:09:06.800
And then Y hat equals.
01:09:07.650 --> 01:09:10.690
W transpose or here there's only One X,
01:09:10.690 --> 01:09:13.000
but leave it in vector format anyway.
01:09:13.000 --> 01:09:14.770
W transpose X hat.
01:09:17.320 --> 01:09:19.950
And then Y, which is the original thing
01:09:19.950 --> 01:09:22.060
that I wanted to Predict, is just the
01:09:22.060 --> 01:09:23.910
exponent of Y hat.
01:09:25.030 --> 01:09:28.070
Since Y was the.
01:09:29.110 --> 01:09:31.750
Since Y hat is the log Frequency.
01:09:33.680 --> 01:09:35.970
So I can just learn this Linear model,
01:09:35.970 --> 01:09:37.870
but then I can easily transform the
01:09:37.870 --> 01:09:38.620
variables.
01:09:39.290 --> 01:09:42.406
Get my prediction of the log number of
01:09:42.406 --> 01:09:43.870
appearances and then transform that
01:09:43.870 --> 01:09:47.350
back into the like regular number of
01:09:47.350 --> 01:09:47.760
appearances.
01:09:53.160 --> 01:09:55.890
It's also worth noting that if you are
01:09:55.890 --> 01:09:58.460
Minimizing a ^2 loss.
01:09:59.120 --> 01:10:01.760
Then you're then you're going to be
01:10:01.760 --> 01:10:04.860
sensitive to outliers, so as this
01:10:04.860 --> 01:10:07.240
example from the textbook and some a
01:10:07.240 --> 01:10:08.820
lot of these plots are examples from
01:10:08.820 --> 01:10:09.960
the Forsyth textbook.
01:10:12.120 --> 01:10:13.286
I've got these points here.
01:10:13.286 --> 01:10:15.379
I've got the exact same points here,
01:10:15.380 --> 01:10:18.290
but added one outlying .1 point that's
01:10:18.290 --> 01:10:19.050
way off the line.
01:10:19.890 --> 01:10:22.360
And you can see that totally messed up
01:10:22.360 --> 01:10:23.206
my fit.
01:10:23.206 --> 01:10:24.990
Like, now that fit hardly goes through
01:10:24.990 --> 01:10:28.040
anything, just from that one point.
01:10:28.040 --> 01:10:29.020
That's way off base.
01:10:30.070 --> 01:10:32.763
And so that's really a problem with the
01:10:32.763 --> 01:10:33.149
optimization.
01:10:33.149 --> 01:10:35.930
With the optimization objective, if I
01:10:35.930 --> 01:10:38.362
have a squared error, then I really,
01:10:38.362 --> 01:10:40.150
really, really hate points that are far
01:10:40.150 --> 01:10:42.670
from the line, so that one point is
01:10:42.670 --> 01:10:44.620
able to pull this whole line towards
01:10:44.620 --> 01:10:46.630
it, because this squared penalty is
01:10:46.630 --> 01:10:48.750
just so big if it's that far away.
01:10:49.950 --> 01:10:51.980
But if I have an L1, if I'm Minimizing
01:10:51.980 --> 01:10:55.380
the L2 one difference, then this will
01:10:55.380 --> 01:10:55.920
not happen.
01:10:55.920 --> 01:10:57.900
I would end up with roughly the same
01:10:57.900 --> 01:10:58.680
plot.
01:10:59.330 --> 01:11:02.380
Or the other way of dealing with it is
01:11:02.380 --> 01:11:05.960
to do something like me estimation,
01:11:05.960 --> 01:11:08.670
where I'm also estimating a weight for
01:11:08.670 --> 01:11:10.310
each point of how well it fits into the
01:11:10.310 --> 01:11:12.270
model, and then at the end of that
01:11:12.270 --> 01:11:13.730
estimation this will get very little
01:11:13.730 --> 01:11:15.250
weight and then I'll also end up with
01:11:15.250 --> 01:11:16.120
the original line.
01:11:17.220 --> 01:11:19.270
So I will talk more about or I plan
01:11:19.270 --> 01:11:21.880
anyway to talk more about like robust
01:11:21.880 --> 01:11:24.480
fitting later in the semester, but I
01:11:24.480 --> 01:11:25.790
just wanted to make you aware of this
01:11:25.790 --> 01:11:26.180
issue.
01:11:32.600 --> 01:11:34.260
Linear.
01:11:34.260 --> 01:11:34.630
OK.
01:11:34.630 --> 01:11:37.170
So just comparing these algorithms
01:11:37.170 --> 01:11:37.700
we've seen.
01:11:38.480 --> 01:11:41.635
So K&N between Linear Regression K&N
01:11:41.635 --> 01:11:42.770
and IBS.
01:11:42.770 --> 01:11:45.660
K&N is the most nonlinear of them, so
01:11:45.660 --> 01:11:47.530
you can fit nonlinear functions with
01:11:47.530 --> 01:11:47.850
K&N.
01:11:49.240 --> 01:11:50.880
Linear Regression is the only one that
01:11:50.880 --> 01:11:51.665
can extrapolate.
01:11:51.665 --> 01:11:54.250
So for a function like this like K&N
01:11:54.250 --> 01:11:56.290
and Naive Bayes will still give me some
01:11:56.290 --> 01:11:58.230
value that's within the range of values
01:11:58.230 --> 01:11:59.350
that I have observed.
01:11:59.350 --> 01:12:02.330
So if I have a frequency of like 5 or
01:12:02.330 --> 01:12:03.090
25.
01:12:04.000 --> 01:12:06.620
K&N is still going to give me like a
01:12:06.620 --> 01:12:08.716
Temperature that's in this range or in
01:12:08.716 --> 01:12:09.209
this range.
01:12:10.260 --> 01:12:11.960
Where Linear Regression can
01:12:11.960 --> 01:12:13.863
extrapolate, it can actually make a
01:12:13.863 --> 01:12:15.730
better like, assuming that it continues
01:12:15.730 --> 01:12:17.320
to be a Linear relationship, a better
01:12:17.320 --> 01:12:19.230
prediction for the extreme values that
01:12:19.230 --> 01:12:20.380
were not observed in Training.
01:12:22.370 --> 01:12:26.670
Linear Regression is compared to.
01:12:27.970 --> 01:12:31.460
Compared to K&N, Linear Regression is
01:12:31.460 --> 01:12:33.225
higher, higher bias and lower variance.
01:12:33.225 --> 01:12:35.140
It's a more constrained model than K&N
01:12:35.140 --> 01:12:37.816
because it's constrained to this Linear
01:12:37.816 --> 01:12:39.680
model where K&N is nonlinear.
01:12:41.140 --> 01:12:43.040
Linear Regression is more useful to
01:12:43.040 --> 01:12:46.439
explain a relationship than K&N or
01:12:46.440 --> 01:12:47.220
Naive Bayes.
01:12:47.220 --> 01:12:49.530
You can see things like well as the
01:12:49.530 --> 01:12:51.550
frequency increases by one then my
01:12:51.550 --> 01:12:53.280
Temperature tends to increase by three
01:12:53.280 --> 01:12:54.325
or whatever it is.
01:12:54.325 --> 01:12:56.420
So you get like a very simple
01:12:56.420 --> 01:12:57.960
explanation that relates to your
01:12:57.960 --> 01:12:59.030
features to your data.
01:12:59.030 --> 01:13:00.770
So that's why you do like a trend fit
01:13:00.770 --> 01:13:01.650
in your Excel plot.
01:13:04.020 --> 01:13:05.930
Linear compared to Gaussian I Bayes,
01:13:05.930 --> 01:13:08.485
Linear Regression is more powerful in
01:13:08.485 --> 01:13:10.700
the sense that it should always fit the
01:13:10.700 --> 01:13:12.350
Training data better because it has
01:13:12.350 --> 01:13:13.990
more freedom to adjust its
01:13:13.990 --> 01:13:14.700
coefficients.
01:13:16.340 --> 01:13:17.820
But it doesn't necessarily mean that
01:13:17.820 --> 01:13:19.030
will fit the test data better.
01:13:19.030 --> 01:13:20.980
So if your data is really Gaussian,
01:13:20.980 --> 01:13:22.830
then Gaussian nibs would be the best
01:13:22.830 --> 01:13:23.510
thing you could do.
01:13:28.290 --> 01:13:34.480
So the key it's basically that Y can be
01:13:34.480 --> 01:13:35.980
predicted by your Linear combination of
01:13:35.980 --> 01:13:36.590
features.
01:13:37.570 --> 01:13:38.354
You can.
01:13:38.354 --> 01:13:40.450
You want to use it if you want to
01:13:40.450 --> 01:13:42.380
extrapolate or visualize or quantify
01:13:42.380 --> 01:13:44.903
correlations or relationships, or if
01:13:44.903 --> 01:13:46.710
you have Many features that can be very
01:13:46.710 --> 01:13:47.620
powerful predictor.
01:13:48.580 --> 01:13:50.410
And you don't want to use it obviously
01:13:50.410 --> 01:13:51.860
if the relationships are very nonlinear
01:13:51.860 --> 01:13:53.540
and that or you need to apply a
01:13:53.540 --> 01:13:54.700
transformation first.
01:13:56.520 --> 01:13:58.850
I'll be done in just one second.
01:13:59.270 --> 01:14:02.490
And so these are used so widely that I
01:14:02.490 --> 01:14:03.420
couldn't think of.
01:14:03.420 --> 01:14:05.480
I felt like coming up with an example
01:14:05.480 --> 01:14:07.230
of when they're used would not give
01:14:07.230 --> 01:14:10.010
you, would not be the right thing to do
01:14:10.010 --> 01:14:11.940
because they're used millions of times,
01:14:11.940 --> 01:14:14.360
like almost all the time you're doing
01:14:14.360 --> 01:14:16.970
Linear Regression or Linear or Logistic
01:14:16.970 --> 01:14:17.550
Regression.
01:14:18.510 --> 01:14:20.300
If you have a neural network, the last
01:14:20.300 --> 01:14:22.130
layer is a Logistic regressor.
01:14:22.130 --> 01:14:24.240
So they use like really, really widely.
01:14:24.240 --> 01:14:24.735
They're the.
01:14:24.735 --> 01:14:26.080
They're the bread and butter of machine
01:14:26.080 --> 01:14:26.410
learning.
01:14:28.310 --> 01:14:29.010
I'm going to.
01:14:29.010 --> 01:14:30.480
I'll Recap this at the start of the
01:14:30.480 --> 01:14:31.040
next class.
01:14:31.820 --> 01:14:34.715
And I'll talk about, I'll go through
01:14:34.715 --> 01:14:36.110
the review at the start of the next
01:14:36.110 --> 01:14:37.530
class of homework one as well.
01:14:37.530 --> 01:14:39.840
This is just basically information,
01:14:39.840 --> 01:14:41.560
summary of information that's already
01:14:41.560 --> 01:14:42.539
given to you in the homework
01:14:42.540 --> 01:14:42.880
assignment.
01:14:44.960 --> 01:14:45.315
Alright.
01:14:45.315 --> 01:14:47.160
So next week I'll just go through that
01:14:47.160 --> 01:14:49.610
review and then I'll talk about trees
01:14:49.610 --> 01:14:51.390
and I'll talk about Ensembles.
01:14:51.390 --> 01:14:54.580
And remember that your homework one is
01:14:54.580 --> 01:14:56.620
due on February 6, so a week from
01:14:56.620 --> 01:14:57.500
Monday.
01:14:57.500 --> 01:14:58.160
Thank you.
01:15:03.740 --> 01:15:04.530
Question about.
01:15:06.630 --> 01:15:10.140
I observed the Training data and I
01:15:10.140 --> 01:15:13.110
think this occurrence is not simple one
01:15:13.110 --> 01:15:13.770
or zero.
01:15:13.770 --> 01:15:16.570
So how should we count the occurrence
01:15:16.570 --> 01:15:17.940
on each of the?
01:15:20.610 --> 01:15:24.257
So first you have to you threshold it
01:15:24.257 --> 01:15:28.690
so first you say like X train equals.
01:15:29.340 --> 01:15:30.810
784X1 train.
01:15:31.780 --> 01:15:33.580
Greater than 0.5.
01:15:34.750 --> 01:15:35.896
So that's what I mean by thresholding
01:15:35.896 --> 01:15:38.450
and now this will be zeros or zeros and
01:15:38.450 --> 01:15:40.820
ones and so now you can count.
01:15:42.360 --> 01:15:44.530
So that's how we.
01:15:46.270 --> 01:15:48.550
Now you can count it, yeah?
01:15:50.090 --> 01:15:51.270
Hi, I'm not sure if.
01:16:01.130 --> 01:16:01.790
So.
01:16:03.040 --> 01:16:05.420
In terms of so if you think it's the
01:16:05.420 --> 01:16:07.347
case that there's like a lot of.
01:16:07.347 --> 01:16:09.089
So first, if you think there's a lot of
01:16:09.090 --> 01:16:11.500
noisy features that aren't very useful
01:16:11.500 --> 01:16:13.200
and you have limited data, then L2 one
01:16:13.200 --> 01:16:15.400
might be better because it will be
01:16:15.400 --> 01:16:17.480
focused more on a few Useful features.
01:16:18.780 --> 01:16:21.150
The other is that if you have.
01:16:23.080 --> 01:16:24.960
If you want to select what are the most
01:16:24.960 --> 01:16:26.820
important features, then L2 one is
01:16:26.820 --> 01:16:27.450
better.
01:16:27.450 --> 01:16:28.750
It can do it in L2 2 can't.
01:16:30.170 --> 01:16:32.650
Otherwise, you often want to use L2
01:16:32.650 --> 01:16:34.370
just because the optimization is a lot
01:16:34.370 --> 01:16:34.940
faster.
01:16:34.940 --> 01:16:37.580
So one is a harder optimization problem
01:16:37.580 --> 01:16:39.440
and it will take a lot longer.
01:16:40.190 --> 01:16:41.840
From what I'm understanding, L2 one is
01:16:41.840 --> 01:16:43.210
only better when there are limited
01:16:43.210 --> 01:16:44.150
features and limited.
01:16:45.210 --> 01:16:48.160
If you think that some features are
01:16:48.160 --> 01:16:49.850
very valuable and there's a lot of
01:16:49.850 --> 01:16:51.396
other weak features, then it can give
01:16:51.396 --> 01:16:52.630
you a better result.
01:16:53.350 --> 01:16:53.870
01:16:54.490 --> 01:16:56.260
Or if you want to do feature selection.
01:16:56.260 --> 01:16:59.300
But in most practical cases you will
01:16:59.300 --> 01:17:01.450
get fairly similar accuracy from the
01:17:01.450 --> 01:17:01.800
two.
01:17:05.690 --> 01:17:07.740
Y is equal to 1 in this case would be.
01:17:14.630 --> 01:17:15.660
If it's binary.
01:17:17.460 --> 01:17:20.820
So if it's binary, then the score of Y,
01:17:20.820 --> 01:17:24.030
this Y the score for 0.
01:17:24.700 --> 01:17:28.010
Is the negative of the score, for one.
01:17:29.240 --> 01:17:31.730
So if it's binary then these relate
01:17:31.730 --> 01:17:34.080
because this would be east to the West
01:17:34.080 --> 01:17:34.690
transpose.
01:17:36.590 --> 01:17:40.100
784X1 over east to the West transpose X
01:17:40.100 --> 01:17:41.360
Plus wait.
01:17:41.360 --> 01:17:42.130
Am I doing that right?
01:17:49.990 --> 01:17:51.077
Sorry, I forgot.
01:17:51.077 --> 01:17:52.046
I can't explain.
01:17:52.046 --> 01:17:54.050
I forgot how to explain like why this
01:17:54.050 --> 01:17:56.059
is the same under the binary case.
01:17:56.060 --> 01:17:58.633
OK, so but there would be the same
01:17:58.633 --> 01:17:59.678
under the binary case.
01:17:59.678 --> 01:18:01.010
Yeah, they're still there.
01:18:01.010 --> 01:18:02.440
It ends up working out to be the same
01:18:02.440 --> 01:18:02.990
equation.
01:18:03.420 --> 01:18:04.580
You're welcome.
01:18:17.130 --> 01:18:17.650
Convert this.
01:18:38.230 --> 01:18:39.650
So you.
01:18:40.770 --> 01:18:41.750
I'm not sure if I understood.
01:18:41.750 --> 01:18:43.950
You said from audio you want to do
01:18:43.950 --> 01:18:44.360
what?
01:18:45.560 --> 01:18:48.660
I'm sitting on a beach this sentence.
01:18:49.440 --> 01:18:51.700
Or you are sitting OK.
01:18:52.980 --> 01:18:53.450
OK.
01:18:54.820 --> 01:18:57.130
My model or app should convert it as a.
01:19:00.490 --> 01:19:01.280
So that person.
01:19:05.870 --> 01:19:08.090
You want to generate a video from a
01:19:08.090 --> 01:19:08.840
speech.
01:19:12.670 --> 01:19:12.920
Right.
01:19:12.920 --> 01:19:14.760
That's like really, really complicated.
01:19:16.390 --> 01:19:17.070
So.
|