You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

week6.html 19 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
  5. <title>week6.md</title><link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color: #ffffff; --text-color: #333333; --code-block-bg-color: inherit; }
  6. html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
  7. body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; }
  8. a:active, a:hover { outline: 0px; }
  9. .in-text-selection, ::selection { background: rgb(181, 214, 252); text-shadow: none; }
  10. #write { margin: 0px auto; height: auto; width: inherit; word-break: normal; word-wrap: break-word; position: relative; padding-bottom: 70px; white-space: pre-wrap; overflow-x: visible; }
  11. .for-image #write { padding-left: 8px; padding-right: 8px; }
  12. body.typora-export { padding-left: 30px; padding-right: 30px; }
  13. @media screen and (max-width: 500px) {
  14. body.typora-export { padding-left: 0px; padding-right: 0px; }
  15. .CodeMirror-sizer { margin-left: 0px !important; }
  16. .CodeMirror-gutters { display: none !important; }
  17. }
  18. .typora-export #write { margin: 0px auto; }
  19. #write > p:first-child, #write > ul:first-child, #write > ol:first-child, #write > pre:first-child, #write > blockquote:first-child, #write > div:first-child, #write > table:first-child { margin-top: 30px; }
  20. #write li > table:first-child { margin-top: -20px; }
  21. img { max-width: 100%; vertical-align: middle; }
  22. input, button, select, textarea { color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; }
  23. input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
  24. ::before, ::after, * { box-sizing: border-box; }
  25. #write p, #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write div, #write pre { width: inherit; }
  26. #write p, #write h1, #write h2, #write h3, #write h4, #write h5, #write h6 { position: relative; }
  27. h1 { font-size: 2rem; }
  28. h2 { font-size: 1.8rem; }
  29. h3 { font-size: 1.6rem; }
  30. h4 { font-size: 1.4rem; }
  31. h5 { font-size: 1.2rem; }
  32. h6 { font-size: 1rem; }
  33. p { -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; }
  34. .typora-export p { white-space: normal; }
  35. .mathjax-block { margin-top: 0px; margin-bottom: 0px; -webkit-margin-before: 0rem; -webkit-margin-after: 0rem; }
  36. .hidden { display: none; }
  37. .md-blockmeta { color: rgb(204, 204, 204); font-weight: bold; font-style: italic; }
  38. a { cursor: pointer; }
  39. sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; }
  40. #write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; margin: 4px 0px 0px; }
  41. figure { max-width: 100%; overflow-x: auto; margin: 0px; }
  42. tr { break-inside: avoid; break-after: auto; }
  43. thead { display: table-header-group; }
  44. table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
  45. table.md-table td { min-width: 80px; }
  46. .CodeMirror-gutters { border-right: 0px; background-color: inherit; }
  47. .CodeMirror { text-align: left; }
  48. .CodeMirror-placeholder { opacity: 0.3; }
  49. .CodeMirror pre { padding: 0px 4px; }
  50. .CodeMirror-lines { padding: 0px; }
  51. div.hr:focus { cursor: none; }
  52. pre { white-space: pre-wrap; }
  53. .CodeMirror-gutters { margin-right: 4px; }
  54. .md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: var(--code-block-bg-color); position: relative !important; }
  55. .md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
  56. .md-fences .CodeMirror.CodeMirror-wrap { top: -1.6em; margin-bottom: -1.6em; }
  57. .md-fences.mock-cm { white-space: pre-wrap; }
  58. .show-fences-line-number .md-fences { padding-left: 0px; }
  59. .show-fences-line-number .md-fences.mock-cm { padding-left: 40px; }
  60. .CodeMirror-line { break-inside: avoid; }
  61. .footnotes { opacity: 0.8; font-size: 0.9rem; padding-top: 1em; padding-bottom: 1em; }
  62. .footnotes + .footnotes { margin-top: -1em; }
  63. .md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: transparent; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: normal; text-align: left; box-sizing: content-box; direction: ltr; }
  64. li div { padding-top: 0px; }
  65. blockquote { margin: 1rem 0px; }
  66. li p, li .mathjax-block { margin: 0.5rem 0px; }
  67. li { margin: 0px; position: relative; }
  68. blockquote > :last-child { margin-bottom: 0px; }
  69. blockquote > :first-child { margin-top: 0px; }
  70. .footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; }
  71. @media print {
  72. html, body { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
  73. .typora-export * { -webkit-print-color-adjust: exact; }
  74. h1, h2, h3, h4, h5, h6 { break-after: avoid-page; orphans: 2; }
  75. p { orphans: 4; }
  76. html.blink-to-pdf { font-size: 13px; }
  77. .typora-export #write { padding-left: 1cm; padding-right: 1cm; padding-bottom: 0px; break-after: avoid; }
  78. .typora-export #write::after { height: 0px; }
  79. @page { margin: 20mm 0mm; }
  80. }
  81. .footnote-line { margin-top: 0.714em; font-size: 0.7em; }
  82. a img, img a { cursor: pointer; }
  83. pre.md-meta-block { font-size: 0.8rem; min-height: 2.86rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
  84. p > img:only-child { display: block; margin: auto; }
  85. p .md-image:only-child { display: inline-block; width: 100%; text-align: center; }
  86. #write .MathJax_Display { margin: 0.8em 0px 0px; }
  87. .mathjax-block { white-space: pre; overflow: hidden; width: 100%; }
  88. p + .mathjax-block { margin-top: -1.143rem; }
  89. .mathjax-block:not(:empty)::after { display: none; }
  90. [contenteditable="true"]:active, [contenteditable="true"]:focus { outline: none; box-shadow: none; }
  91. .task-list { list-style-type: none; }
  92. .task-list-item { position: relative; padding-left: 1em; }
  93. .task-list-item input { position: absolute; top: 0px; left: 0px; }
  94. .math { font-size: 1rem; }
  95. .md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
  96. .md-toc-content { position: relative; margin-left: 0px; }
  97. .md-toc::after, .md-toc-content::after { display: none; }
  98. .md-toc-item { display: block; color: rgb(65, 131, 196); }
  99. .md-toc-item a { text-decoration: none; }
  100. .md-toc-inner:hover { }
  101. .md-toc-inner { display: inline-block; cursor: pointer; }
  102. .md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: bold; }
  103. .md-toc-h2 .md-toc-inner { margin-left: 2em; }
  104. .md-toc-h3 .md-toc-inner { margin-left: 4em; }
  105. .md-toc-h4 .md-toc-inner { margin-left: 6em; }
  106. .md-toc-h5 .md-toc-inner { margin-left: 8em; }
  107. .md-toc-h6 .md-toc-inner { margin-left: 10em; }
  108. @media screen and (max-width: 48em) {
  109. .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  110. .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  111. .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  112. .md-toc-h6 .md-toc-inner { margin-left: 8em; }
  113. }
  114. a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
  115. .footnote-line a:not(.reversefootnote) { color: inherit; }
  116. .md-attr { display: none; }
  117. .md-fn-count::after { content: "."; }
  118. .md-tag { opacity: 0.5; }
  119. .md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: monospace; }
  120. code { text-align: left; }
  121. h1 .md-tag, h2 .md-tag, h3 .md-tag, h4 .md-tag, h5 .md-tag, h6 .md-tag { font-weight: initial; opacity: 0.35; }
  122. a.md-print-anchor { border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: none !important; background: transparent !important; text-decoration: initial !important; text-shadow: initial !important; }
  123. .md-inline-math .MathJax_SVG .noError { display: none !important; }
  124. .mathjax-block .MathJax_SVG_Display { text-align: center; margin: 1em 0em; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; display: block !important; }
  125. .MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
  126. .MathJax_SVG .MJX-monospace { font-family: monospace; }
  127. .MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
  128. .MathJax_SVG { display: inline; font-style: normal; font-weight: normal; line-height: normal; zoom: 90%; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; }
  129. .MathJax_SVG * { transition: none; }
  130. .md-diagram-panel > svg { max-width: 100%; }
  131. [lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; }
  132. :root { --side-bar-bg-color: #fafafa; --control-text-color: #777; }
  133. @font-face { font-family: "Open Sans"; font-style: normal; font-weight: normal; src: local("Open Sans Regular"), url("./github/400.woff") format("woff"); }
  134. @font-face { font-family: "Open Sans"; font-style: italic; font-weight: normal; src: local("Open Sans Italic"), url("./github/400i.woff") format("woff"); }
  135. @font-face { font-family: "Open Sans"; font-style: normal; font-weight: bold; src: local("Open Sans Bold"), url("./github/700.woff") format("woff"); }
  136. @font-face { font-family: "Open Sans"; font-style: italic; font-weight: bold; src: local("Open Sans Bold Italic"), url("./github/700i.woff") format("woff"); }
  137. html { font-size: 16px; }
  138. body { font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(51, 51, 51); line-height: 1.6; }
  139. #write { max-width: 860px; margin: 0px auto; padding: 20px 30px 100px; }
  140. #write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
  141. body > :first-child { margin-top: 0px !important; }
  142. body > :last-child { margin-bottom: 0px !important; }
  143. a { color: rgb(65, 131, 196); }
  144. h1, h2, h3, h4, h5, h6 { position: relative; margin-top: 1rem; margin-bottom: 1rem; font-weight: bold; line-height: 1.4; cursor: text; }
  145. h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
  146. h1 tt, h1 code { font-size: inherit; }
  147. h2 tt, h2 code { font-size: inherit; }
  148. h3 tt, h3 code { font-size: inherit; }
  149. h4 tt, h4 code { font-size: inherit; }
  150. h5 tt, h5 code { font-size: inherit; }
  151. h6 tt, h6 code { font-size: inherit; }
  152. h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid rgb(238, 238, 238); }
  153. h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid rgb(238, 238, 238); }
  154. h3 { font-size: 1.5em; line-height: 1.43; }
  155. h4 { font-size: 1.25em; }
  156. h5 { font-size: 1em; }
  157. h6 { font-size: 1em; color: rgb(119, 119, 119); }
  158. p, blockquote, ul, ol, dl, table { margin: 0.8em 0px; }
  159. li > ol, li > ul { margin: 0px; }
  160. hr { height: 4px; padding: 0px; margin: 16px 0px; background-color: rgb(231, 231, 231); border-width: 0px 0px 1px; border-style: none none solid; border-top-color: initial; border-right-color: initial; border-left-color: initial; border-image: initial; overflow: hidden; box-sizing: content-box; border-bottom-color: rgb(221, 221, 221); }
  161. body > h2:first-child { margin-top: 0px; padding-top: 0px; }
  162. body > h1:first-child { margin-top: 0px; padding-top: 0px; }
  163. body > h1:first-child + h2 { margin-top: 0px; padding-top: 0px; }
  164. body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child { margin-top: 0px; padding-top: 0px; }
  165. a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0px; padding-top: 0px; }
  166. h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { margin-top: 0px; }
  167. li p.first { display: inline-block; }
  168. ul, ol { padding-left: 30px; }
  169. ul:first-child, ol:first-child { margin-top: 0px; }
  170. ul:last-child, ol:last-child { margin-bottom: 0px; }
  171. blockquote { border-left: 4px solid rgb(221, 221, 221); padding: 0px 15px; color: rgb(119, 119, 119); }
  172. blockquote blockquote { padding-right: 0px; }
  173. table { padding: 0px; word-break: initial; }
  174. table tr { border-top: 1px solid rgb(204, 204, 204); margin: 0px; padding: 0px; }
  175. table tr:nth-child(2n) { background-color: rgb(248, 248, 248); }
  176. table tr th { font-weight: bold; border: 1px solid rgb(204, 204, 204); text-align: left; margin: 0px; padding: 6px 13px; }
  177. table tr td { border: 1px solid rgb(204, 204, 204); text-align: left; margin: 0px; padding: 6px 13px; }
  178. table tr th:first-child, table tr td:first-child { margin-top: 0px; }
  179. table tr th:last-child, table tr td:last-child { margin-bottom: 0px; }
  180. .CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); }
  181. .md-fences, code, tt { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 4px 0px; font-size: 0.9em; }
  182. .md-fences { margin-bottom: 15px; margin-top: 15px; padding: 8px 1em 6px; }
  183. .task-list { padding-left: 0px; }
  184. .task-list-item { padding-left: 32px; }
  185. .task-list-item input { top: 3px; left: 8px; }
  186. @media screen and (min-width: 914px) {
  187. }
  188. @media print {
  189. html { font-size: 13px; }
  190. table, pre { break-inside: avoid; }
  191. pre { word-wrap: break-word; }
  192. }
  193. .md-fences { background-color: rgb(248, 248, 248); }
  194. #write pre.md-meta-block { padding: 1rem; font-size: 85%; line-height: 1.45; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; color: rgb(119, 119, 119); margin-top: 0px !important; }
  195. .mathjax-block > .code-tooltip { bottom: 0.375rem; }
  196. #write > h3.md-focus::before { left: -1.5625rem; top: 0.375rem; }
  197. #write > h4.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
  198. #write > h5.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
  199. #write > h6.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
  200. .md-image > .md-meta { border: 1px solid rgb(221, 221, 221); border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 4px 0px; font-size: 0.9em; color: inherit; }
  201. .md-tag { color: inherit; }
  202. .md-toc { margin-top: 20px; padding-bottom: 20px; }
  203. .sidebar-tabs { border-bottom: none; }
  204. #typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); }
  205. #typora-quick-open-item { background-color: rgb(250, 250, 250); border-color: rgb(254, 254, 254) rgb(229, 229, 229) rgb(229, 229, 229) rgb(238, 238, 238); border-style: solid; border-width: 1px; }
  206. #md-notification::before { top: 10px; }
  207. .on-focus-mode blockquote { border-left-color: rgba(85, 85, 85, 0.12); }
  208. header, .context-menu, .megamenu-content, footer { font-family: "Segoe UI", Arial, sans-serif; }
  209. .file-node-content:hover .file-node-icon, .file-node-content:hover .file-node-open-state { visibility: visible; }
  210. .mac-seamless-mode #typora-sidebar { background-color: var(--side-bar-bg-color); }
  211. .md-lang { color: rgb(180, 101, 77); }
  212. </style>
  213. </head>
  214. <body class='typora-export' >
  215. <div id='write' class = 'is-node show-fences-line-number'><div class='md-toc' mdtype='toc'><p class="md-toc-content"><span class="md-toc-item md-toc-h1" data-ref="n2"><a class="md-toc-inner" href="#header-n2">10 Advice for Applying Machine Learning</a></span><span class="md-toc-item md-toc-h2" data-ref="n3"><a class="md-toc-inner" href="#header-n3">10.1 Deciding What to Try Next</a></span><span class="md-toc-item md-toc-h2" data-ref="n4"><a class="md-toc-inner" href="#header-n4">10.2 Evaluating a Hypothesis</a></span><span class="md-toc-item md-toc-h2" data-ref="n5"><a class="md-toc-inner" href="#header-n5">10.3 Model Selection and Train/Validation/Test Sets</a></span><span class="md-toc-item md-toc-h2" data-ref="n6"><a class="md-toc-inner" href="#header-n6">10.4 Diagnosing Bias vs. Variance</a></span><span class="md-toc-item md-toc-h2" data-ref="n7"><a class="md-toc-inner" href="#header-n7">10.5 Regularization and Bias/Variance</a></span><span class="md-toc-item md-toc-h2" data-ref="n8"><a class="md-toc-inner" href="#header-n8">10.6 Learning Curves</a></span><span class="md-toc-item md-toc-h2" data-ref="n9"><a class="md-toc-inner" href="#header-n9">10.7 Deciding What to Do Next Revisited</a></span><span class="md-toc-item md-toc-h1" data-ref="n12"><a class="md-toc-inner" href="#header-n12">11 Machine Learning System Design</a></span><span class="md-toc-item md-toc-h2" data-ref="n13"><a class="md-toc-inner" href="#header-n13">11.1 Prioritizing What to Work On</a></span><span class="md-toc-item md-toc-h2" data-ref="n14"><a class="md-toc-inner" href="#header-n14">11.2 Error Analysis</a></span><span class="md-toc-item md-toc-h2" data-ref="n15"><a class="md-toc-inner" href="#header-n15">11.3 Error Metrics for Skewed Classes</a></span><span class="md-toc-item md-toc-h2" data-ref="n16"><a class="md-toc-inner" href="#header-n16">11.4 Trading Off Precision and Recall</a></span><span class="md-toc-item md-toc-h2" data-ref="n17"><a class="md-toc-inner" href="#header-n17">11.5 Data For Machine Learning</a></span></p></div><h1><a name='header-n2' class='md-header-anchor '></a>10 Advice for Applying Machine Learning</h1><h2><a name='header-n3' class='md-header-anchor '></a>10.1 Deciding What to Try Next</h2><h2><a name='header-n4' class='md-header-anchor '></a>10.2 Evaluating a Hypothesis</h2><h2><a name='header-n5' class='md-header-anchor '></a>10.3 Model Selection and Train/Validation/Test Sets</h2><h2><a name='header-n6' class='md-header-anchor '></a>10.4 Diagnosing Bias vs. Variance</h2><h2><a name='header-n7' class='md-header-anchor '></a>10.5 Regularization and Bias/Variance</h2><h2><a name='header-n8' class='md-header-anchor '></a>10.6 Learning Curves</h2><h2><a name='header-n9' class='md-header-anchor '></a>10.7 Deciding What to Do Next Revisited</h2><p> </p><h1><a name='header-n12' class='md-header-anchor '></a>11 Machine Learning System Design</h1><h2><a name='header-n13' class='md-header-anchor '></a>11.1 Prioritizing What to Work On</h2><h2><a name='header-n14' class='md-header-anchor '></a>11.2 Error Analysis</h2><h2><a name='header-n15' class='md-header-anchor '></a>11.3 Error Metrics for Skewed Classes</h2><h2><a name='header-n16' class='md-header-anchor '></a>11.4 Trading Off Precision and Recall</h2><h2><a name='header-n17' class='md-header-anchor '></a>11.5 Data For Machine Learning</h2></div>
  216. </body>
  217. </html>

机器学习