{"id":249,"date":"2015-11-14T03:18:30","date_gmt":"2015-11-14T03:18:30","guid":{"rendered":""},"modified":"2015-11-14T03:18:30","modified_gmt":"2015-11-14T03:18:30","slug":"","status":"publish","type":"post","link":"http:\/\/weizn.net\/?p=249","title":{"rendered":"[\u8f6c] scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u4f7f\u7528\u5c0f\u7ed3"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_17 counter-hierarchy\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><i class=\"ez-toc-glyphicon ez-toc-icon-toggle\"><\/i><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-1\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/weizn.net\/?p=249\/#1_scikit-learn_%E6%9C%B4%E7%B4%A0%E8%B4%9D%E5%8F%B6%E6%96%AF%E7%B1%BB%E5%BA%93%E6%A6%82%E8%BF%B0\" title=\"\n\t1. scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u6982\u8ff0 \n\">\n\t1. scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u6982\u8ff0 \n<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-1\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/weizn.net\/?p=249\/#2_GaussianNB%E7%B1%BB%E4%BD%BF%E7%94%A8%E6%80%BB%E7%BB%93\" title=\"\n\t2.&nbsp;GaussianNB\u7c7b\u4f7f\u7528\u603b\u7ed3 \n\">\n\t2.&nbsp;GaussianNB\u7c7b\u4f7f\u7528\u603b\u7ed3 \n<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-1\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/weizn.net\/?p=249\/#3_MultinomialNB%E7%B1%BB%E4%BD%BF%E7%94%A8%E6%80%BB%E7%BB%93\" title=\"\n\t3.&nbsp;MultinomialNB\u7c7b\u4f7f\u7528\u603b\u7ed3 \n\">\n\t3.&nbsp;MultinomialNB\u7c7b\u4f7f\u7528\u603b\u7ed3 \n<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-1\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/weizn.net\/?p=249\/#4_BernoulliNB%E7%B1%BB%E4%BD%BF%E7%94%A8%E6%80%BB%E7%BB%93\" title=\"\n\t4.&nbsp;BernoulliNB\u7c7b\u4f7f\u7528\u603b\u7ed3 \n\">\n\t4.&nbsp;BernoulliNB\u7c7b\u4f7f\u7528\u603b\u7ed3 \n<\/a><\/li><\/ul><\/nav><\/div>\n<p>\n\t\u539f\u6587\uff1a<a href=\"https:\/\/www.cnblogs.com\/pinard\/p\/6074222.html\" target=\"_blank\">https:\/\/www.cnblogs.com\/pinard\/p\/6074222.html<\/a>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u4e4b\u524d\u5728<a id=\"homepage1_HomePageDays_DaysList_ctl00_DayList_TitleUrl_0\" class=\"postTitle2\" href=\"http:\/\/www.cnblogs.com\/pinard\/p\/6069267.html\" style=\"margin:0px;padding:0px;color:#000000;\">\u6734\u7d20\u8d1d\u53f6\u65af\u7b97\u6cd5\u539f\u7406\u5c0f\u7ed3<\/a>\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u5bf9\u6734\u7d20\u8d1d\u53f6\u65af\u5206\u7c7b\u7b97\u6cd5\u7684\u539f\u7406\u505a\u4e86\u4e00\u4e2a\u603b\u7ed3\u3002\u8fd9\u91cc\u6211\u4eec\u5c31\u4ece\u5b9e\u6218\u7684\u89d2\u5ea6\u6765\u770b\u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u3002\u91cd\u70b9\u8bb2\u8ff0scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u7684\u4f7f\u7528\u8981\u70b9\u548c\u53c2\u6570\u9009\u62e9\u3002\n<\/p>\n<h1 style=\"margin:10px 0px;padding:0px;font-size:28px;line-height:1.5;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\"><span class=\"ez-toc-section\" id=\"1_scikit-learn_%E6%9C%B4%E7%B4%A0%E8%B4%9D%E5%8F%B6%E6%96%AF%E7%B1%BB%E5%BA%93%E6%A6%82%E8%BF%B0\"><\/span>\n\t1. scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u6982\u8ff0<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u6734\u7d20\u8d1d\u53f6\u65af\u662f\u4e00\u7c7b\u6bd4\u8f83\u7b80\u5355\u7684\u7b97\u6cd5\uff0cscikit-learn\u4e2d\u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u7684\u4f7f\u7528\u4e5f\u6bd4\u8f83\u7b80\u5355\u3002\u76f8\u5bf9\u4e8e\u51b3\u7b56\u6811\uff0cKNN\u4e4b\u7c7b\u7684\u7b97\u6cd5\uff0c\u6734\u7d20\u8d1d\u53f6\u65af\u9700\u8981\u5173\u6ce8\u7684\u53c2\u6570\u662f\u6bd4\u8f83\u5c11\u7684\uff0c\u8fd9\u6837\u4e5f\u6bd4\u8f83\u5bb9\u6613\u638c\u63e1\u3002\u5728scikit-learn\u4e2d\uff0c\u4e00\u5171\u67093\u4e2a\u6734\u7d20\u8d1d\u53f6\u65af\u7684\u5206\u7c7b\u7b97\u6cd5\u7c7b\u3002\u5206\u522b\u662fGaussianNB\uff0cMultinomialNB\u548cBernoulliNB\u3002\u5176\u4e2dGaussianNB\u5c31\u662f\u5148\u9a8c\u4e3a\u9ad8\u65af\u5206\u5e03\u7684\u6734\u7d20\u8d1d\u53f6\u65af\uff0cMultinomialNB\u5c31\u662f\u5148\u9a8c\u4e3a\u591a\u9879\u5f0f\u5206\u5e03\u7684\u6734\u7d20\u8d1d\u53f6\u65af\uff0c\u800cBernoulliNB\u5c31\u662f\u5148\u9a8c\u4e3a\u4f2f\u52aa\u5229\u5206\u5e03\u7684\u6734\u7d20\u8d1d\u53f6\u65af\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u8fd9\u4e09\u4e2a\u7c7b\u9002\u7528\u7684\u5206\u7c7b\u573a\u666f\u5404\u4e0d\u76f8\u540c\uff0c\u4e00\u822c\u6765\u8bf4\uff0c\u5982\u679c\u6837\u672c\u7279\u5f81\u7684\u5206\u5e03\u5927\u90e8\u5206\u662f\u8fde\u7eed\u503c\uff0c\u4f7f\u7528GaussianNB\u4f1a\u6bd4\u8f83\u597d\u3002\u5982\u679c\u5982\u679c\u6837\u672c\u7279\u5f81\u7684\u5206\u5927\u90e8\u5206\u662f\u591a\u5143\u79bb\u6563\u503c\uff0c\u4f7f\u7528MultinomialNB\u6bd4\u8f83\u5408\u9002\u3002\u800c\u5982\u679c\u6837\u672c\u7279\u5f81\u662f\u4e8c\u5143\u79bb\u6563\u503c\u6216\u8005\u5f88\u7a00\u758f\u7684\u591a\u5143\u79bb\u6563\u503c\uff0c\u5e94\u8be5\u4f7f\u7528BernoulliNB\u3002\n<\/p>\n<h1 style=\"margin:10px 0px;padding:0px;font-size:28px;line-height:1.5;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\"><span class=\"ez-toc-section\" id=\"2_GaussianNB%E7%B1%BB%E4%BD%BF%E7%94%A8%E6%80%BB%E7%BB%93\"><\/span>\n\t2.&nbsp;GaussianNB\u7c7b\u4f7f\u7528\u603b\u7ed3<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tGaussianNB\u5047\u8bbe\u7279\u5f81\u7684\u5148\u9a8c\u6982\u7387\u4e3a\u6b63\u6001\u5206\u5e03\uff0c\u5373\u5982\u4e0b\u5f0f\uff1a\n<\/p>\n<div class=\"MathJax_Display\" style=\"margin:1em 0em;padding:0px;text-align:center;position:relative;max-width:none;max-height:none;min-width:0px;min-height:0px;width:669px;\">\n\t<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Xj=xj|Y=Ck)=12\u03c0\u03c32k\u2212\u2212\u2212\u2212\u221aexp(\u2212(xj\u2212\u03bck)22\u03c32k)<\/nobr><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><msub><mi>X<\/mi><mi>j<\/mi><\/msub><mo>=<\/mo><msub><mi>x<\/mi><mi>j<\/mi><\/msub><mrow class=\"MJX-TeXAtom-ORD\">|<\/mrow><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mfrac><mn>1<\/mn><msqrt><mn>2<\/mn><mi>\u03c0<\/mi><msubsup><mi>\u03c3<\/mi><mi>k<\/mi><mn>2<\/mn><\/msubsup><\/msqrt><\/mfrac><mi>e<\/mi><mi>x<\/mi><mi>p<\/mi><mrow class=\"MJX-TeXAtom-ORD\">(<\/mrow><mo>\u2212<\/mo><mfrac><mrow><mo stretchy=\"false\">(<\/mo><msub><mi>x<\/mi><mi>j<\/mi><\/msub><mo>\u2212<\/mo><msub><mi>\u03bc<\/mi><mi>k<\/mi><\/msub><msup><mo stretchy=\"false\">)<\/mo><mn>2<\/mn><\/msup><\/mrow><mrow><mn>2<\/mn><msubsup><mi>\u03c3<\/mi><mi>k<\/mi><mn>2<\/mn><\/msubsup><\/mrow><\/mfrac><mrow class=\"MJX-TeXAtom-ORD\">)<\/mrow><\/math>\n<\/div>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u5176\u4e2d<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">Ck<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>C<\/mi><mi>k<\/mi><\/msub><\/math><\/span>\u4e3aY\u7684\u7b2ck\u7c7b\u7c7b\u522b\u3002<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">\u03bck\u548c\u03c32k<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>\u03bc<\/mi><mi>k<\/mi><\/msub><mrow class=\"MJX-TeXAtom-ORD\"><mo>\u548c<\/mo><\/mrow><msubsup><mi>\u03c3<\/mi><mi>k<\/mi><mn>2<\/mn><\/msubsup><\/math><\/span>\u4e3a\u9700\u8981\u4ece\u8bad\u7ec3\u96c6\u4f30\u8ba1\u7684\u503c\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tGaussianNB\u4f1a\u6839\u636e\u8bad\u7ec3\u96c6\u6c42\u51fa<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">\u03bck\u548c\u03c32k<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>\u03bc<\/mi><mi>k<\/mi><\/msub><mrow class=\"MJX-TeXAtom-ORD\"><mo>\u548c<\/mo><\/mrow><msubsup><mi>\u03c3<\/mi><mi>k<\/mi><mn>2<\/mn><\/msubsup><\/math><\/span>\u3002&nbsp;<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">\u03bck<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>\u03bc<\/mi><mi>k<\/mi><\/msub><\/math><\/span>\u4e3a\u5728\u6837\u672c\u7c7b\u522b<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">Ck<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>C<\/mi><mi>k<\/mi><\/msub><\/math><\/span>\u4e2d\uff0c\u6240\u6709<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">Xj<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>X<\/mi><mi>j<\/mi><\/msub><\/math><\/span>\u7684\u5e73\u5747\u503c\u3002<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">\u03c32k<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msubsup><mi>\u03c3<\/mi><mi>k<\/mi><mn>2<\/mn><\/msubsup><\/math><\/span>\u4e3a\u5728\u6837\u672c\u7c7b\u522b<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">Ck<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>C<\/mi><mi>k<\/mi><\/msub><\/math><\/span>\u4e2d\uff0c\u6240\u6709<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">Xj<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>X<\/mi><mi>j<\/mi><\/msub><\/math><\/span>\u7684\u65b9\u5dee\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tGaussianNB\u7c7b\u7684\u4e3b\u8981\u53c2\u6570\u4ec5\u6709\u4e00\u4e2a\uff0c\u5373\u5148\u9a8c\u6982\u7387priors&nbsp;\uff0c\u5bf9\u5e94Y\u7684\u5404\u4e2a\u7c7b\u522b\u7684\u5148\u9a8c\u6982\u7387<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Y=Ck)<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><\/math><\/span>\u3002\u8fd9\u4e2a\u503c\u9ed8\u8ba4\u4e0d\u7ed9\u51fa\uff0c\u5982\u679c\u4e0d\u7ed9\u51fa\u6b64\u65f6<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Y=Ck)=mk\/m<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><msub><mi>m<\/mi><mi>k<\/mi><\/msub><mrow class=\"MJX-TeXAtom-ORD\"><mo>\/<\/mo><\/mrow><mi>m<\/mi><\/math><\/span>\u3002\u5176\u4e2dm\u4e3a\u8bad\u7ec3\u96c6\u6837\u672c\u603b\u6570\u91cf\uff0c<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">mk<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>m<\/mi><mi>k<\/mi><\/msub><\/math><\/span>\u4e3a\u8f93\u51fa\u4e3a\u7b2ck\u7c7b\u522b\u7684\u8bad\u7ec3\u96c6\u6837\u672c\u6570\u3002\u5982\u679c\u7ed9\u51fa\u7684\u8bdd\u5c31\u4ee5priors \u4e3a\u51c6\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u5728\u4f7f\u7528GaussianNB\u7684fit\u65b9\u6cd5\u62df\u5408\u6570\u636e\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u9884\u6d4b\u3002\u6b64\u65f6\u9884\u6d4b\u6709\u4e09\u79cd\u65b9\u6cd5\uff0c\u5305\u62ecpredict\uff0cpredict_log_proba\u548cpredict_proba\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tpredict\u65b9\u6cd5\u5c31\u662f\u6211\u4eec\u6700\u5e38\u7528\u7684\u9884\u6d4b\u65b9\u6cd5\uff0c\u76f4\u63a5\u7ed9\u51fa\u6d4b\u8bd5\u96c6\u7684\u9884\u6d4b\u7c7b\u522b\u8f93\u51fa\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tpredict_proba\u5219\u4e0d\u540c\uff0c\u5b83\u4f1a\u7ed9\u51fa\u6d4b\u8bd5\u96c6\u6837\u672c\u5728\u5404\u4e2a\u7c7b\u522b\u4e0a\u9884\u6d4b\u7684\u6982\u7387\u3002\u5bb9\u6613\u7406\u89e3\uff0cpredict_proba\u9884\u6d4b\u51fa\u7684\u5404\u4e2a\u7c7b\u522b\u6982\u7387\u91cc\u7684\u6700\u5927\u503c\u5bf9\u5e94\u7684\u7c7b\u522b\uff0c\u4e5f\u5c31\u662fpredict\u65b9\u6cd5\u5f97\u5230\u7c7b\u522b\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tpredict_log_proba\u548cpredict_proba\u7c7b\u4f3c\uff0c\u5b83\u4f1a\u7ed9\u51fa\u6d4b\u8bd5\u96c6\u6837\u672c\u5728\u5404\u4e2a\u7c7b\u522b\u4e0a\u9884\u6d4b\u7684\u6982\u7387\u7684\u4e00\u4e2a\u5bf9\u6570\u8f6c\u5316\u3002\u8f6c\u5316\u540epredict_log_proba\u9884\u6d4b\u51fa\u7684\u5404\u4e2a\u7c7b\u522b\u5bf9\u6570\u6982\u7387\u91cc\u7684\u6700\u5927\u503c\u5bf9\u5e94\u7684\u7c7b\u522b\uff0c\u4e5f\u5c31\u662fpredict\u65b9\u6cd5\u5f97\u5230\u7c7b\u522b\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u4e0b\u9762\u7ed9\u4e00\u4e2a\u5177\u4f53\u7684\u4f8b\u5b50\uff0c\u4ee3\u7801\u5982\u4e0b,\u4ea6\u53ef\u89c1<a title=\"\u6211\u7684github\" href=\"https:\/\/github.com\/ljpzzz\/machinelearning\/blob\/master\/classic-machine-learning\/native_bayes.ipynb\" target=\"_blank\" style=\"margin:0px;padding:0px;color:#000000;\">\u6211\u7684github<\/a>\uff1a\n<\/p>\n<p>\n\t\n<\/p>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;color:#0000FF;line-height:1.5 !important;\">import<\/span><span style=\"margin:0px;padding:0px;line-height:1.5 !important;\"> numpy as np\r\nX <\/span>= np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2<span style=\"margin:0px;padding:0px;line-height:1.5 !important;\">]])\r\nY <\/span>= np.array([1, 1, 1, 2, 2, 2<span style=\"margin:0px;padding:0px;line-height:1.5 !important;\">]) <\/span><\/pre>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;color:#0000FF;line-height:1.5 !important;\">from<\/span> sklearn.naive_bayes <span style=\"margin:0px;padding:0px;color:#0000FF;line-height:1.5 !important;\">import<\/span><span style=\"margin:0px;padding:0px;line-height:1.5 !important;\"> GaussianNB\r\nclf <\/span>=<span style=\"margin:0px;padding:0px;line-height:1.5 !important;\"> GaussianNB() <\/span><\/pre>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;color:#008000;line-height:1.5 !important;\">#<\/span><span style=\"margin:0px;padding:0px;color:#008000;line-height:1.5 !important;\">\u62df\u5408\u6570\u636e<\/span> <\/pre>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;line-height:1.5 !important;\">clf.fit(X, Y) <\/span><\/pre>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;color:#0000FF;line-height:1.5 !important;\">print<\/span> <span style=\"margin:0px;padding:0px;color:#800000;line-height:1.5 !important;\">\"<\/span><span style=\"margin:0px;padding:0px;color:#800000;line-height:1.5 !important;\">==Predict result by predict==<\/span><span style=\"margin:0px;padding:0px;color:#800000;line-height:1.5 !important;\">\"<\/span> <\/pre>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;color:#0000FF;line-height:1.5 !important;\">print<\/span>(clf.predict([[-0.8, -1<span style=\"margin:0px;padding:0px;line-height:1.5 !important;\">]])) <\/span><\/pre>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;color:#0000FF;line-height:1.5 !important;\">print<\/span> <span style=\"margin:0px;padding:0px;color:#800000;line-height:1.5 !important;\">\"<\/span><span style=\"margin:0px;padding:0px;color:#800000;line-height:1.5 !important;\">==Predict result by predict_proba==<\/span><span style=\"margin:0px;padding:0px;color:#800000;line-height:1.5 !important;\">\"<\/span> <\/pre>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;color:#0000FF;line-height:1.5 !important;\">print<\/span>(clf.predict_proba([[-0.8, -1<span style=\"margin:0px;padding:0px;line-height:1.5 !important;\">]])) <\/span><\/pre>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;color:#0000FF;line-height:1.5 !important;\">print<\/span> <span style=\"margin:0px;padding:0px;color:#800000;line-height:1.5 !important;\">\"<\/span><span style=\"margin:0px;padding:0px;color:#800000;line-height:1.5 !important;\">==Predict result by predict_log_proba==<\/span><span style=\"margin:0px;padding:0px;color:#800000;line-height:1.5 !important;\">\"<\/span> <\/pre>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-family:&quot;\"><span style=\"margin:0px;padding:0px;color:#0000FF;line-height:1.5 !important;\">print<\/span>(clf.predict_log_proba([[-0.8, -1]]))<\/pre>\n<p>\n\t\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u7ed3\u679c\u5982\u4e0b\uff1a\n<\/p>\n<pre style=\"margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;background-color:#CFE8CB;\">==Predict result by predict==\r\n[1]\r\n==Predict result by predict_proba==\r\n[[  9.99999949e-01   5.05653254e-08]]\r\n==Predict result by predict_log_proba==\r\n[[ -5.05653266e-08  -1.67999998e+01]]<\/pre>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u4ece\u4e0a\u9762\u7684\u7ed3\u679c\u53ef\u4ee5\u770b\u51fa\uff0c\u6d4b\u8bd5\u6837\u672c[-0.8,-1]\u7684\u7c7b\u522b\u9884\u6d4b\u4e3a\u7c7b\u522b1\u3002\u5177\u4f53\u7684\u6d4b\u8bd5\u6837\u672c[-0.8,-1]\u88ab\u9884\u6d4b\u4e3a1\u7684\u6982\u7387\u4e3a9.99999949e-01 \uff0c\u8fdc\u8fdc\u5927\u4e8e\u9884\u6d4b\u4e3a2\u7684\u6982\u73875.05653254e-08\u3002\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u6700\u7ec8\u7684\u9884\u6d4b\u7ed3\u679c\u4e3a1\u7684\u539f\u56e0\u4e86\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u6b64\u5916\uff0cGaussianNB\u4e00\u4e2a\u91cd\u8981\u7684\u529f\u80fd\u662f\u6709 partial_fit\u65b9\u6cd5\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u7684\u4e00\u822c\u7528\u5728\u5982\u679c\u8bad\u7ec3\u96c6\u6570\u636e\u91cf\u975e\u5e38\u5927\uff0c\u4e00\u6b21\u4e0d\u80fd\u5168\u90e8\u8f7d\u5165\u5185\u5b58\u7684\u65f6\u5019\u3002\u8fd9\u65f6\u6211\u4eec\u53ef\u4ee5\u628a\u8bad\u7ec3\u96c6\u5206\u6210\u82e5\u5e72\u7b49\u5206\uff0c\u91cd\u590d\u8c03\u7528partial_fit\u6765\u4e00\u6b65\u6b65\u7684\u5b66\u4e60\u8bad\u7ec3\u96c6\uff0c\u975e\u5e38\u65b9\u4fbf\u3002\u540e\u9762\u8bb2\u5230\u7684MultinomialNB\u548cBernoulliNB\u4e5f\u6709\u7c7b\u4f3c\u7684\u529f\u80fd\u3002\n<\/p>\n<h1 style=\"margin:10px 0px;padding:0px;font-size:28px;line-height:1.5;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\"><span class=\"ez-toc-section\" id=\"3_MultinomialNB%E7%B1%BB%E4%BD%BF%E7%94%A8%E6%80%BB%E7%BB%93\"><\/span>\n\t3.&nbsp;MultinomialNB\u7c7b\u4f7f\u7528\u603b\u7ed3<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tMultinomialNB\u5047\u8bbe\u7279\u5f81\u7684\u5148\u9a8c\u6982\u7387\u4e3a\u591a\u9879\u5f0f\u5206\u5e03\uff0c\u5373\u5982\u4e0b\u5f0f\uff1a\n<\/p>\n<div class=\"MathJax_Display\" style=\"margin:1em 0em;padding:0px;text-align:center;position:relative;max-width:none;max-height:none;min-width:0px;min-height:0px;width:669px;\">\n\t<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Xj=xjl|Y=Ck)=xjl+\u03bbmk+n\u03bb<\/nobr><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><msub><mi>X<\/mi><mi>j<\/mi><\/msub><mo>=<\/mo><msub><mi>x<\/mi><mrow class=\"MJX-TeXAtom-ORD\"><mi>j<\/mi><mi>l<\/mi><\/mrow><\/msub><mrow class=\"MJX-TeXAtom-ORD\">|<\/mrow><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mfrac><mrow><msub><mi>x<\/mi><mrow class=\"MJX-TeXAtom-ORD\"><mi>j<\/mi><mi>l<\/mi><\/mrow><\/msub><mo>+<\/mo><mi>\u03bb<\/mi><\/mrow><mrow><msub><mi>m<\/mi><mi>k<\/mi><\/msub><mo>+<\/mo><mi>n<\/mi><mi>\u03bb<\/mi><\/mrow><\/mfrac><\/math>\n<\/div>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u5176\u4e2d\uff0c<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Xj=xjl|Y=Ck)<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><msub><mi>X<\/mi><mi>j<\/mi><\/msub><mo>=<\/mo><msub><mi>x<\/mi><mrow class=\"MJX-TeXAtom-ORD\"><mi>j<\/mi><mi>l<\/mi><\/mrow><\/msub><mrow class=\"MJX-TeXAtom-ORD\"><mo stretchy=\"false\">|<\/mo><\/mrow><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><\/math><\/span>\u662f\u7b2ck\u4e2a\u7c7b\u522b\u7684\u7b2cj\u7ef4\u7279\u5f81\u7684\u7b2cl\u4e2a\u4e2a\u53d6\u503c\u6761\u4ef6\u6982\u7387\u3002<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">mk<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>m<\/mi><mi>k<\/mi><\/msub><\/math><\/span>\u662f\u8bad\u7ec3\u96c6\u4e2d\u8f93\u51fa\u4e3a\u7b2ck\u7c7b\u7684\u6837\u672c\u4e2a\u6570\u3002<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">\u03bb<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>\u03bb<\/mi><\/math><\/span>&nbsp;\u4e3a\u4e00\u4e2a\u5927\u4e8e0\u7684\u5e38\u6570\uff0c\u5e38\u5e38\u53d6\u4e3a1\uff0c\u5373\u62c9\u666e\u62c9\u65af\u5e73\u6ed1\u3002\u4e5f\u53ef\u4ee5\u53d6\u5176\u4ed6\u503c\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tMultinomialNB\u53c2\u6570\u6bd4GaussianNB\u591a\uff0c\u4f46\u662f\u4e00\u5171\u4e5f\u53ea\u6709\u4ec5\u4ec53\u4e2a\u3002\u5176\u4e2d\uff0c\u53c2\u6570alpha\u5373\u4e3a\u4e0a\u9762\u7684\u5e38\u6570<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">\u03bb<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>\u03bb<\/mi><\/math><\/span>\uff0c\u5982\u679c\u4f60\u6ca1\u6709\u7279\u522b\u7684\u9700\u8981\uff0c\u7528\u9ed8\u8ba4\u76841\u5373\u53ef\u3002\u5982\u679c\u53d1\u73b0\u62df\u5408\u7684\u4e0d\u597d\uff0c\u9700\u8981\u8c03\u4f18\u65f6\uff0c\u53ef\u4ee5\u9009\u62e9\u7a0d\u5927\u4e8e1\u6216\u8005\u7a0d\u5c0f\u4e8e1\u7684\u6570\u3002\u5e03\u5c14\u53c2\u6570fit_prior\u8868\u793a\u662f\u5426\u8981\u8003\u8651\u5148\u9a8c\u6982\u7387\uff0c\u5982\u679c\u662ffalse,\u5219\u6240\u6709\u7684\u6837\u672c\u7c7b\u522b\u8f93\u51fa\u90fd\u6709\u76f8\u540c\u7684\u7c7b\u522b\u5148\u9a8c\u6982\u7387\u3002\u5426\u5219\u53ef\u4ee5\u81ea\u5df1\u7528\u7b2c\u4e09\u4e2a\u53c2\u6570class_prior\u8f93\u5165\u5148\u9a8c\u6982\u7387\uff0c\u6216\u8005\u4e0d\u8f93\u5165\u7b2c\u4e09\u4e2a\u53c2\u6570class_prior\u8ba9MultinomialNB\u81ea\u5df1\u4ece\u8bad\u7ec3\u96c6\u6837\u672c\u6765\u8ba1\u7b97\u5148\u9a8c\u6982\u7387\uff0c\u6b64\u65f6\u7684\u5148\u9a8c\u6982\u7387\u4e3a<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Y=Ck)=mk\/m<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><msub><mi>m<\/mi><mi>k<\/mi><\/msub><mrow class=\"MJX-TeXAtom-ORD\"><mo>\/<\/mo><\/mrow><mi>m<\/mi><\/math><\/span>\u3002\u5176\u4e2dm\u4e3a\u8bad\u7ec3\u96c6\u6837\u672c\u603b\u6570\u91cf\uff0c<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">mk<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>m<\/mi><mi>k<\/mi><\/msub><\/math><\/span>\u4e3a\u8f93\u51fa\u4e3a\u7b2ck\u7c7b\u522b\u7684\u8bad\u7ec3\u96c6\u6837\u672c\u6570\u3002\u603b\u7ed3\u5982\u4e0b\uff1a\n<\/p>\n<table border=\"0\" style=\"margin:0px;padding:0px;border-spacing:0px;border:1px solid silver;word-break:break-word;color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;background-color:#CFE8CB;height:97px;width:624px;\" class=\"ke-zeroborder\">\n<tbody style=\"margin:0px;padding:0px;\">\n<tr style=\"margin:0px;padding:0px;\">\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\tfit_prior\n\t\t\t<\/td>\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\tclass_prior\n\t\t\t<\/td>\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\t\u6700\u7ec8\u5148\u9a8c\u6982\u7387\n\t\t\t<\/td>\n<\/tr>\n<tr style=\"margin:0px;padding:0px;\">\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\tfalse\n\t\t\t<\/td>\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\t\u586b\u6216\u8005\u4e0d\u586b\u6ca1\u6709\u610f\u4e49\n\t\t\t<\/td>\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\t<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Y=Ck)=1\/k<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mn>1<\/mn><mrow class=\"MJX-TeXAtom-ORD\"><mo>\/<\/mo><\/mrow><mi>k<\/mi><\/math><\/span>\n\t\t\t<\/td>\n<\/tr>\n<tr style=\"margin:0px;padding:0px;\">\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\ttrue\n\t\t\t<\/td>\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\t\u4e0d\u586b\n\t\t\t<\/td>\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\t<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Y=Ck)=mk\/m<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><msub><mi>m<\/mi><mi>k<\/mi><\/msub><mrow class=\"MJX-TeXAtom-ORD\"><mo>\/<\/mo><\/mrow><mi>m<\/mi><\/math><\/span>\n\t\t\t<\/td>\n<\/tr>\n<tr style=\"margin:0px;padding:0px;\">\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\ttrue\n\t\t\t<\/td>\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\t\u586b\n\t\t\t<\/td>\n<td style=\"margin:0px;padding:8px 14px;border:1px solid silver;border-collapse:collapse;\">\n\t\t\t\t<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Y=Ck)=<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><\/math><\/span>class_prior\n\t\t\t<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t&nbsp;\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u5728\u4f7f\u7528MultinomialNB\u7684fit\u65b9\u6cd5\u6216\u8005partial_fit\u65b9\u6cd5\u62df\u5408\u6570\u636e\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u9884\u6d4b\u3002\u6b64\u65f6\u9884\u6d4b\u6709\u4e09\u79cd\u65b9\u6cd5\uff0c\u5305\u62ecpredict\uff0cpredict_log_proba\u548cpredict_proba\u3002\u7531\u4e8e\u65b9\u6cd5\u548cGaussianNB\u5b8c\u5168\u4e00\u6837\uff0c\u8fd9\u91cc\u5c31\u4e0d\u7d2f\u8ff0\u4e86\u3002\n<\/p>\n<h1 style=\"margin:10px 0px;padding:0px;font-size:28px;line-height:1.5;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\"><span class=\"ez-toc-section\" id=\"4_BernoulliNB%E7%B1%BB%E4%BD%BF%E7%94%A8%E6%80%BB%E7%BB%93\"><\/span>\n\t4.&nbsp;BernoulliNB\u7c7b\u4f7f\u7528\u603b\u7ed3<br \/>\n<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tBernoulliNB\u5047\u8bbe\u7279\u5f81\u7684\u5148\u9a8c\u6982\u7387\u4e3a\u4e8c\u5143\u4f2f\u52aa\u5229\u5206\u5e03\uff0c\u5373\u5982\u4e0b\u5f0f\uff1a\n<\/p>\n<div class=\"MathJax_Display\" style=\"margin:1em 0em;padding:0px;text-align:center;position:relative;max-width:none;max-height:none;min-width:0px;min-height:0px;width:669px;\">\n\t<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">P(Xj=xjl|Y=Ck)=P(j|Y=Ck)xjl+(1\u2212P(j|Y=Ck)(1\u2212xjl)<\/nobr><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"block\"><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><msub><mi>X<\/mi><mi>j<\/mi><\/msub><mo>=<\/mo><msub><mi>x<\/mi><mrow class=\"MJX-TeXAtom-ORD\"><mi>j<\/mi><mi>l<\/mi><\/mrow><\/msub><mrow class=\"MJX-TeXAtom-ORD\">|<\/mrow><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo>=<\/mo><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>j<\/mi><mrow class=\"MJX-TeXAtom-ORD\">|<\/mrow><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><msub><mi>x<\/mi><mrow class=\"MJX-TeXAtom-ORD\"><mi>j<\/mi><mi>l<\/mi><\/mrow><\/msub><mo>+<\/mo><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><mi>P<\/mi><mo stretchy=\"false\">(<\/mo><mi>j<\/mi><mrow class=\"MJX-TeXAtom-ORD\">|<\/mrow><mi>Y<\/mi><mo>=<\/mo><msub><mi>C<\/mi><mi>k<\/mi><\/msub><mo stretchy=\"false\">)<\/mo><mo stretchy=\"false\">(<\/mo><mn>1<\/mn><mo>\u2212<\/mo><msub><mi>x<\/mi><mrow class=\"MJX-TeXAtom-ORD\"><mi>j<\/mi><mi>l<\/mi><\/mrow><\/msub><mo stretchy=\"false\">)<\/mo><\/math>\n<\/div>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u6b64\u65f6<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">l<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><mi>l<\/mi><\/math><\/span>\u53ea\u6709\u4e24\u79cd\u53d6\u503c\u3002<nobr aria-hidden=\"true\" style=\"margin:0px;padding:0px;transition:none;border:0px;max-width:none;max-height:none;min-width:0px;min-height:0px;vertical-align:0px;line-height:normal;\">xjl<\/nobr><span class=\"MJX_Assistive_MathML\" role=\"presentation\" style=\"margin:0px;padding:0px;top:0px;left:0px;clip:rect(1px 1px 1px 1px);user-select:none;position:static;border:0px;display:inline;transition:none;vertical-align:0px;line-height:normal;height:1px !important;width:1px !important;overflow:hidden !important;\"><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><msub><mi>x<\/mi><mrow class=\"MJX-TeXAtom-ORD\"><mi>j<\/mi><mi>l<\/mi><\/mrow><\/msub><\/math><\/span>\u53ea\u80fd\u53d6\u503c0\u6216\u80051\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\tBernoulliNB\u4e00\u5171\u67094\u4e2a\u53c2\u6570\uff0c\u5176\u4e2d3\u4e2a\u53c2\u6570\u7684\u540d\u5b57\u548c\u610f\u4e49\u548cMultinomialNB\u5b8c\u5168\u76f8\u540c\u3002\u552f\u4e00\u589e\u52a0\u7684\u4e00\u4e2a\u53c2\u6570\u662fbinarize\u3002\u8fd9\u4e2a\u53c2\u6570\u4e3b\u8981\u662f\u7528\u6765\u5e2eBernoulliNB\u5904\u7406\u4e8c\u9879\u5206\u5e03\u7684\uff0c\u53ef\u4ee5\u662f\u6570\u503c\u6216\u8005\u4e0d\u8f93\u5165\u3002\u5982\u679c\u4e0d\u8f93\u5165\uff0c\u5219BernoulliNB\u8ba4\u4e3a\u6bcf\u4e2a\u6570\u636e\u7279\u5f81\u90fd\u5df2\u7ecf\u662f\u4e8c\u5143\u7684\u3002\u5426\u5219\u7684\u8bdd\uff0c\u5c0f\u4e8ebinarize\u7684\u4f1a\u5f52\u4e3a\u4e00\u7c7b\uff0c\u5927\u4e8ebinarize\u7684\u4f1a\u5f52\u4e3a\u53e6\u5916\u4e00\u7c7b\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u5728\u4f7f\u7528BernoulliNB\u7684fit\u6216\u8005partial_fit\u65b9\u6cd5\u62df\u5408\u6570\u636e\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u8fdb\u884c\u9884\u6d4b\u3002\u6b64\u65f6\u9884\u6d4b\u6709\u4e09\u79cd\u65b9\u6cd5\uff0c\u5305\u62ecpredict\uff0cpredict_log_proba\u548cpredict_proba\u3002\u7531\u4e8e\u65b9\u6cd5\u548cGaussianNB\u5b8c\u5168\u4e00\u6837\uff0c\u8fd9\u91cc\u5c31\u4e0d\u7d2f\u8ff0\u4e86\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u4ee5\u4e0a\u5c31\u662fscikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u7684\u4f7f\u7528\u7684\u7ecf\u9a8c\u603b\u7ed3\u3002\u5e0c\u671b\u53ef\u4ee5\u5e2e\u5230\u670b\u53cb\u4eec\u3002\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t&nbsp;\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\uff08\u6b22\u8fce\u8f6c\u8f7d\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002\u6b22\u8fce\u6c9f\u901a\u4ea4\u6d41\uff1a liujianping-ok@163.com\uff09&nbsp;\n<\/p>\n<p>\n\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\n\t\u539f\u6587\uff1a<a href=\"https:\/\/www.cnblogs.com\/pinard\/p\/6074222.html\" target=\"_blank\">https:\/\/www.cnblogs.com\/pinard\/p\/6074222.html<\/a>\n<\/p>\n<p>\n\t\n<\/p>\n<p>\n\t\n<\/p>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u4e4b\u524d\u5728<a id=\"homepage1_HomePageDays_DaysList_ctl00_DayList_TitleUrl_0\" class=\"postTitle2\" href=\"http:\/\/www.cnblogs.com\/pinard\/p\/6069267.html\" style=\"margin:0px;padding:0px;color:#000000;\">\u6734\u7d20\u8d1d\u53f6\u65af\u7b97\u6cd5\u539f\u7406\u5c0f\u7ed3<\/a>\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u5bf9\u6734\u7d20\u8d1d\u53f6\u65af\u5206\u7c7b\u7b97\u6cd5\u7684\u539f\u7406\u505a\u4e86\u4e00\u4e2a\u603b\u7ed3\u3002\u8fd9\u91cc\u6211\u4eec\u5c31\u4ece\u5b9e\u6218\u7684\u89d2\u5ea6\u6765\u770b\u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u3002\u91cd\u70b9\u8bb2\u8ff0scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u7684\u4f7f\u7528\u8981\u70b9\u548c\u53c2\u6570\u9009\u62e9\u3002\n<\/p>\n<h1 style=\"margin:10px 0px;padding:0px;font-size:28px;line-height:1.5;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t1. scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u6982\u8ff0<br \/>\n<\/h1>\n<p style=\"margin:10px auto;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#CFE8CB;\">\n\t\u6734\u7d20\u8d1d\u53f6\u65af\u662f\u4e00\u7c7b\u6bd4\u8f83&#8230;\n<\/p>\n<p>\n\t<\/p>\n","protected":false},"author":1,"featured_media":563,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[337],"tags":[],"class_list":["post-249","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[\u8f6c] scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u4f7f\u7528\u5c0f\u7ed3 - Wayne&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/weizn.net\/?p=249\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[\u8f6c] scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u4f7f\u7528\u5c0f\u7ed3 - Wayne&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u539f\u6587\uff1ahttps:\/\/www.cnblogs.com\/pinard\/p\/6074222.html           \u4e4b\u524d\u5728\u6734\u7d20\u8d1d\u53f6\u65af\u7b97\u6cd5\u539f\u7406\u5c0f\u7ed3\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u5bf9\u6734\u7d20\u8d1d\u53f6\u65af\u5206\u7c7b\u7b97\u6cd5\u7684\u539f\u7406\u505a\u4e86\u4e00\u4e2a\u603b\u7ed3\u3002\u8fd9\u91cc\u6211\u4eec\u5c31\u4ece\u5b9e\u6218\u7684\u89d2\u5ea6\u6765\u770b\u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u3002\u91cd\u70b9\u8bb2\u8ff0scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u7684\u4f7f\u7528\u8981\u70b9\u548c\u53c2\u6570\u9009\u62e9\u3002    1. scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u6982\u8ff0    \u6734\u7d20\u8d1d\u53f6\u65af\u662f\u4e00\u7c7b\u6bd4\u8f83...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/weizn.net\/?p=249\" \/>\n<meta property=\"og:site_name\" content=\"Wayne&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-14T03:18:30+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zinan\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/weizn.net\/#website\",\"url\":\"http:\/\/weizn.net\/\",\"name\":\"Wayne&#039;s Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/weizn.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"ImageObject\",\"@id\":\"http:\/\/weizn.net\/?p=249#primaryimage\",\"inLanguage\":\"zh-Hans\",\"url\":\"http:\/\/weizn.net\/wp-content\/uploads\/2018\/11\/scikit-learn.jpg\",\"contentUrl\":\"http:\/\/weizn.net\/wp-content\/uploads\/2018\/11\/scikit-learn.jpg\",\"width\":1050,\"height\":520},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/weizn.net\/?p=249#webpage\",\"url\":\"http:\/\/weizn.net\/?p=249\",\"name\":\"[\\u8f6c] scikit-learn \\u6734\\u7d20\\u8d1d\\u53f6\\u65af\\u7c7b\\u5e93\\u4f7f\\u7528\\u5c0f\\u7ed3 - Wayne&#039;s Blog\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=249#primaryimage\"},\"datePublished\":\"2015-11-14T03:18:30+00:00\",\"dateModified\":\"2015-11-14T03:18:30+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/weizn.net\/?p=249#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/weizn.net\/?p=249\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/weizn.net\/?p=249#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"http:\/\/weizn.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[\\u8f6c] scikit-learn \\u6734\\u7d20\\u8d1d\\u53f6\\u65af\\u7c7b\\u5e93\\u4f7f\\u7528\\u5c0f\\u7ed3\"}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/weizn.net\/?p=249#article\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/?p=249#webpage\"},\"author\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"headline\":\"[\\u8f6c] scikit-learn \\u6734\\u7d20\\u8d1d\\u53f6\\u65af\\u7c7b\\u5e93\\u4f7f\\u7528\\u5c0f\\u7ed3\",\"datePublished\":\"2015-11-14T03:18:30+00:00\",\"dateModified\":\"2015-11-14T03:18:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=249#webpage\"},\"wordCount\":285,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"image\":{\"@id\":\"http:\/\/weizn.net\/?p=249#primaryimage\"},\"thumbnailUrl\":\"http:\/\/weizn.net\/wp-content\/uploads\/2018\/11\/scikit-learn.jpg\",\"articleSection\":[\"\\u6570\\u636e\\u5206\\u6790\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/weizn.net\/?p=249#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\",\"name\":\"zinan\",\"logo\":{\"@id\":\"http:\/\/weizn.net\/#personlogo\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[\u8f6c] scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u4f7f\u7528\u5c0f\u7ed3 - Wayne&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/weizn.net\/?p=249","og_locale":"zh_CN","og_type":"article","og_title":"[\u8f6c] scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u4f7f\u7528\u5c0f\u7ed3 - Wayne&#039;s Blog","og_description":"\u539f\u6587\uff1ahttps:\/\/www.cnblogs.com\/pinard\/p\/6074222.html           \u4e4b\u524d\u5728\u6734\u7d20\u8d1d\u53f6\u65af\u7b97\u6cd5\u539f\u7406\u5c0f\u7ed3\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u5bf9\u6734\u7d20\u8d1d\u53f6\u65af\u5206\u7c7b\u7b97\u6cd5\u7684\u539f\u7406\u505a\u4e86\u4e00\u4e2a\u603b\u7ed3\u3002\u8fd9\u91cc\u6211\u4eec\u5c31\u4ece\u5b9e\u6218\u7684\u89d2\u5ea6\u6765\u770b\u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u3002\u91cd\u70b9\u8bb2\u8ff0scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u7684\u4f7f\u7528\u8981\u70b9\u548c\u53c2\u6570\u9009\u62e9\u3002    1. scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u6982\u8ff0    \u6734\u7d20\u8d1d\u53f6\u65af\u662f\u4e00\u7c7b\u6bd4\u8f83...","og_url":"http:\/\/weizn.net\/?p=249","og_site_name":"Wayne&#039;s Blog","article_published_time":"2015-11-14T03:18:30+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zinan","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/weizn.net\/#website","url":"http:\/\/weizn.net\/","name":"Wayne&#039;s Blog","description":"","publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/weizn.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"ImageObject","@id":"http:\/\/weizn.net\/?p=249#primaryimage","inLanguage":"zh-Hans","url":"http:\/\/weizn.net\/wp-content\/uploads\/2018\/11\/scikit-learn.jpg","contentUrl":"http:\/\/weizn.net\/wp-content\/uploads\/2018\/11\/scikit-learn.jpg","width":1050,"height":520},{"@type":"WebPage","@id":"http:\/\/weizn.net\/?p=249#webpage","url":"http:\/\/weizn.net\/?p=249","name":"[\u8f6c] scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u4f7f\u7528\u5c0f\u7ed3 - Wayne&#039;s Blog","isPartOf":{"@id":"http:\/\/weizn.net\/#website"},"primaryImageOfPage":{"@id":"http:\/\/weizn.net\/?p=249#primaryimage"},"datePublished":"2015-11-14T03:18:30+00:00","dateModified":"2015-11-14T03:18:30+00:00","breadcrumb":{"@id":"http:\/\/weizn.net\/?p=249#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/weizn.net\/?p=249"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/weizn.net\/?p=249#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/weizn.net\/"},{"@type":"ListItem","position":2,"name":"[\u8f6c] scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u4f7f\u7528\u5c0f\u7ed3"}]},{"@type":"Article","@id":"http:\/\/weizn.net\/?p=249#article","isPartOf":{"@id":"http:\/\/weizn.net\/?p=249#webpage"},"author":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"headline":"[\u8f6c] scikit-learn \u6734\u7d20\u8d1d\u53f6\u65af\u7c7b\u5e93\u4f7f\u7528\u5c0f\u7ed3","datePublished":"2015-11-14T03:18:30+00:00","dateModified":"2015-11-14T03:18:30+00:00","mainEntityOfPage":{"@id":"http:\/\/weizn.net\/?p=249#webpage"},"wordCount":285,"commentCount":0,"publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"image":{"@id":"http:\/\/weizn.net\/?p=249#primaryimage"},"thumbnailUrl":"http:\/\/weizn.net\/wp-content\/uploads\/2018\/11\/scikit-learn.jpg","articleSection":["\u6570\u636e\u5206\u6790"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/weizn.net\/?p=249#respond"]}]},{"@type":["Person","Organization"],"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264","name":"zinan","logo":{"@id":"http:\/\/weizn.net\/#personlogo"}}]}},"_links":{"self":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=249"}],"version-history":[{"count":0,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/249\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/media\/563"}],"wp:attachment":[{"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}