[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-70778":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},70778,"Statistical-Learning-Method_Code","Dod-o\u002FStatistical-Learning-Method_Code","Dod-o","手写实现李航《统计学习方法》书中全部算法","",null,"Python",11619,2887,304,20,0,4,57.4,false,"master",true,[23,24,25],"code","machine-learning-algorithms","statistical-learning-method","2026-06-06 04:04:34","## 【广告位-AI 工具推荐】学术研究必备 - GreatRouter 大模型 API 服务\n  正在用 大模型 做研究？论文写作、代码调试、数据分析都需要 AI 辅助？\n\n  [**GreatRouter**](https:\u002F\u002Fwww.greatrouter.com\u002F) 提供更实惠的 大模型 API 服务：\n  - 🎓 **学术用户专享 8 折**：比官方便宜 20%（需学术认证）\n  - 💰 **注册送 $3**：足够测试 Claude 3.5 约 1000 次对话\n  - 🛡️ **质量保障**：蜜罐测试，与官方结果不一致赔付 10 倍\n  - 💳 **微信支付**：无需信用卡，余额永不过期\n  - 🌐 **支持 41+ 模型**：OpenAI、Anthropic、DeepSeek、xAI 等\n \n→ [立即试用](https:\u002F\u002Fwww.greatrouter.com\u002F)\n\n---\n前言\n====\n\n力求每行代码都有注释，重要部分注明公式来源。具体会追求下方这样的代码，学习者可以照着公式看程序，让代码有据可查。\n\n![image](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FCodePic.png)\n\n    \n如果时间充沛的话，可能会试着给每一章写一篇博客。先放个博客链接吧：[传送门](http:\u002F\u002Fwww.pkudodo.com\u002F)。    \n\n##### 注：其中Mnist数据集已转换为csv格式，由于体积为107M超过限制，改为压缩包形式。下载后务必先将Mnist文件内压缩包直接解压。  \n\n### 【Updates】\n**书籍出版**：目前已与**人民邮电出版社**签订合同，未来将结合该repo整理出版机器学习实践相关书籍。同时会在book分支中对代码进行重构，欢迎在issue中提建议！同时issue中现有的问题也会考虑进去。（Feb 12 2022）\n\n**线下培训**：女朋友计划近期开办**ML\u002FMLP\u002FCV线下培训班**，地点**北上广深杭**，目标各方向**快速入门**，正在筹备。这里帮她打个广告，可以添加微信15324951814（备注线下培训）。本人也会被拉过去义务评估课程质量。。。（Feb 12 2022）\n\n**无监督部分更新**：部分**无监督**算法已更新！！！ 该部分由[Harold-Ran](https:\u002F\u002Fgithub.com\u002FHarold-Ran)提供，在此感谢！ 有其他算法补充的同学也欢迎添加我微信并pr！（Jan 27 2021）\n       \n实现\n======\n\n## 监督部分\n\n### 第二章 感知机：\n博客：[统计学习方法|感知机原理剖析及实现](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002Fblogs\u002F%E6%84%9F%E7%9F%A5%E6%9C%BA%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90%E5%8F%8A%E5%AE%9E%E7%8E%B0.pdf)      \n实现：[perceptron\u002Fperceptron_dichotomy.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002Fperceptron\u002Fperceptron_dichotomy.py)\n      \n### 第三章 K近邻：\n博客：[统计学习方法|K近邻原理剖析及实现](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002Fblogs\u002FK%E8%BF%91%E9%82%BB%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90%E5%8F%8A%E5%AE%9E%E7%8E%B0.pdf)      \n实现：[KNN\u002FKNN.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FKNN\u002FKNN.py)\n      \n### 第四章 朴素贝叶斯：\n博客：[统计学习方法|朴素贝叶斯原理剖析及实现](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002Fblogs\u002F%E6%9C%B4%E7%B4%A0%E8%B4%9D%E5%8F%B6%E6%96%AF%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90%E5%8F%8A%E5%AE%9E%E7%8E%B0.pdf)      \n实现：[NaiveBayes\u002FNaiveBayes.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FNaiveBayes\u002FNaiveBayes.py)    \n      \n### 第五章 决策树：\n博客：[统计学习方法|决策树原理剖析及实现](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002Fblogs\u002F%E5%86%B3%E7%AD%96%E6%A0%91%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90%E5%8F%8A%E5%AE%9E%E7%8E%B0.pdf)      \n实现：[DecisionTree\u002FDecisionTree.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FDecisionTree\u002FDecisionTree.py)    \n      \n### 第六章 逻辑斯蒂回归与最大熵模型：       \n博客：逻辑斯蒂回归：[统计学习方法|逻辑斯蒂原理剖析及实现](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002Fblogs\u002F%E9%80%BB%E8%BE%91%E6%96%AF%E8%92%82%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90%E5%8F%8A%E5%AE%9E%E7%8E%B0.pdf)        \n博客：最大熵：[统计学习方法|最大熵原理剖析及实现](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002Fblogs\u002F%E6%9C%80%E5%A4%A7%E7%86%B5%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90%E5%8F%8A%E5%AE%9E%E7%8E%B0.pdf)        \n\n实现：逻辑斯蒂回归：[Logistic_and_maximum_entropy_models\u002FlogisticRegression.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FLogistic_and_maximum_entropy_models\u002FlogisticRegression.py)    \n实现：最大熵：[Logistic_and_maximum_entropy_models\u002FmaxEntropy.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FLogistic_and_maximum_entropy_models\u002FmaxEntropy.py)       \n      \n### 第七章 支持向量机：    \n博客：[统计学习方法|支持向量机(SVM)原理剖析及实现](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002Fblogs\u002F%E6%94%AF%E6%8C%81%E5%90%91%E9%87%8F%E6%9C%BA(SVM)%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90%E5%8F%8A%E5%AE%9E%E7%8E%B0.pdf)      \n实现：[SVM\u002FSVM.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FSVM\u002FSVM.py)    \n      \n### 第八章 提升方法：\n实现：[AdaBoost\u002FAdaBoost.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FAdaBoost\u002FAdaBoost.py)    \n      \n### 第九章 EM算法及其推广：\n实现：[EM\u002FEM.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FEM\u002FEM.py)    \n      \n### 第十章 隐马尔可夫模型：\n实现：[HMM\u002FHMM.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FHMM\u002FHMM.py)    \n\n## 无监督部分\n\n### 第十四章 聚类方法\n实现：[K-means_Clustering.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FClustering\u002FK-means_Clustering\u002FK-means_Clustering.py)\n\n实现：[Hierachical_Clustering.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FClustering\u002FHierachical_Clustering\u002FHierachical_Clustering.py)\n\n### 第十六章 主成分分析\n实现：[PCA.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FPCA\u002FPCA.py)\n\n### 第十七章 潜在语意分析\n实现：[LSA.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FLSA\u002FLSA.py)\n\n### 第十八章 概率潜在语意分析\n实现：[PLSA.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FPLSA\u002FPLSA.py)\n\n### 第二十章 潜在狄利克雷分配\n实现：[LDA.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FLDA\u002FLDA.py)\n\n### 第二十一章 PageRank算法\n实现：[Page_Rank.py](https:\u002F\u002Fgithub.com\u002FDod-o\u002FStatistical-Learning-Method_Code\u002Fblob\u002Fmaster\u002FPage_Rank\u002FPage_Rank.py)\n\n\n## 许可 \u002F License\n本项目内容许可遵循[Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby-nc-sa\u002F4.0\u002F)。\n\nThe content of this project itself is licensed under the [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby-nc-sa\u002F4.0\u002F)\n\n联系\n======\n欢迎pr，有疑问也可通过issue、微信或邮件联系。      \n此外如果有需要**MSRA**实习内推的同学，欢迎骚扰。             \n**Wechat:** lvtengchao（备注“blog-学校\u002F单位-姓名”）      \n**Email:** lvtengchao@pku.edu.cn      \n\n\n项目历史\n======\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=Dod-o\u002FStatistical-Learning-Method_Code&type=Date&theme=dark\" \u002F>\n  \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=Dod-o\u002FStatistical-Learning-Method_Code&type=Date\" \u002F>\n  \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=Dod-o\u002FStatistical-Learning-Method_Code&type=Date\" \u002F>\n\u003C\u002Fpicture>\n\n\n\n\n","该项目手写实现了李航《统计学习方法》一书中全部的算法。核心功能包括监督学习和无监督学习中的多种经典算法，如感知机、K近邻、朴素贝叶斯、决策树、逻辑斯蒂回归与最大熵模型等，并且每行代码都有详细注释，方便学习者对照公式理解程序。项目采用Python语言编写，适合机器学习初学者以及对统计学习方法感兴趣的开发者通过实践加深理论知识的理解。此外，项目维护者还计划结合该仓库内容整理出版相关书籍，并提供了一些扩展资源，如博客文章和线下培训信息。",2,"2026-06-06 03:35:05","high_star"]