Chapter 001. Machine Learning Fundamentals
Field of study that givescomputers the ability to learnwithout being explicitlyprogrammed.
使计算机无需明确编程即可学习的研究领域
--Arthur Samuel(1959)
What’s Machine learning![![[Pasted image 20260417210910.png|256]]](https://i-blog.csdnimg.cn/direct/d850312b1cb349d19365ea10fd305f7d.png)
通过编程使计算机能够进行成千上万次自我对弈,来得到最优解![![[Pasted image 20260417211146.png]]](https://i-blog.csdnimg.cn/direct/9e8ba931150e466bb036490b22d5b431.png)
如果跳棋程序只进行10场自我对弈,而不是数万场,那么它学习到的策略和模式将非常有限,无法充分探索棋局的各种可能性,也无法有效优化自己的决策。这会使其性能显著下降,无法达到通过大量自我对弈所获得的强大水平
Machine Learning Algorithms
- 监督学习(Supervised learning) <- used more in real-world applications(rapid advancements)
- 非监督学习(Unsupervised learning)
- 强化学习(Reinforcement learning)
- 应用学习算法的实用建议 <- Practical advice for applying learning algorithms(How to use)
Supervised learning
![![[Pasted image 20260417220824.png|507]]](https://i-blog.csdnimg.cn/direct/4f4fc50bff744950802b2bac11241734.png)
关键特征:给学习算法提供学习的例子(Learns from being given “right answers”)Right answers 是指给定输入x的正确标签y,通过观察输入x和期望标签y的正确配对 学习算法最终学会,仅通过输入而不需要输出标签来给出相当准确的预测和猜测
监督学习 = 给算法“题目 + 标准答案“![![[Pasted image 20260417222847.png|532]]](https://i-blog.csdnimg.cn/direct/cbdcfb81dda947df91692de2f8830bfa.png)
![![[Pasted image 20260417223254.png|533]]](https://i-blog.csdnimg.cn/direct/7882c224a67c4a00981b4d7a4aee7254.png)
![![[Pasted image 20260417223736.png|535]]](https://i-blog.csdnimg.cn/direct/b5a9dd521e814e48b8d8f88816e23fed.png)
我们给算法提供了一个数据集 其中所谓的正确答案,也就是标签或正确的价格y,是为图上的每一栋房子给出的
针对这个房价的预测是监督学习中特定类型 称为回归(Regression)
infinitely many possible outputs -> Predict a number
通过回归,从无限多的可能数字中预测一个数字
分类(Classification)![![[Pasted image 20260418125440.png|545]]](https://i-blog.csdnimg.cn/direct/e85d69389ff948bea9238d2b4a150da0.png)
和回归的区别:预测的可能输出或类别数量很少,这种情况下会有两种输出(zero or one & benign or malignant),因为在这个例子中只有两个可能的输出![![[Pasted image 20260418140950.png|553]]](https://i-blog.csdnimg.cn/direct/d49f058a2ccd4f43b43a06835c39e6bd.png)
分类算法预测类别(Predict Categories):类别可以是非数字
可能的输出数量较少(small number of possible outputs)
可以使用多个输入值来预测输出![![[Pasted image 20260418142320.png|440]]](https://i-blog.csdnimg.cn/direct/8864bd9627924ffdae46227b53e36b12.png)
可以通过测量患者的肿瘤大小并记录患者的年龄
如何鉴定:学习算法会摘找到一些边界,将恶性肿瘤与良性肿瘤分开,学习算法必须决定如何为这些数据拟合一条边界线![![[Pasted image 20260418143259.png|439]]](https://i-blog.csdnimg.cn/direct/1d25332668d14cf19b4fd8fa9b05be81.png)
Unsupervised learning![![[Pasted image 20260418150905.png]]](https://i-blog.csdnimg.cn/direct/c97b0e5f7cb6423c91cb3340a20799b2.png)
非监督学习不会指定正确的输出,而是让算法自己找出有什么有趣的东西或可能存在的模式或结构
之所以称之为无监督学习是因为我们并不是试图监督算法为每个问题给出某个所谓的正确答案输入,相反,我们让算法自己找出有什么有趣的东西或可能存在的模式或结构
一个监督学习算法可能会决定将数据分为两个不同的组或两个不同的簇
聚类算法(Clustering Algorithm):将未标记的数据放入不同的簇中
Google News![![[Pasted image 20260418155316.png]]](https://i-blog.csdnimg.cn/direct/d5575216db1641198a560190dc2a7e8b.png)
对信息进行自动分组
DNA Microarray![![[Pasted image 20260418164750.png]]](https://i-blog.csdnimg.cn/direct/17b47db27a6d48a5b6a68b996cd34365.png)
不会先告诉算法有什么什么类型,而是提供一堆数据,让算法自动在数据中找到机构,并自动找出主要的个体类型,这就是无监督学习![![[Pasted image 20260418165123.png]]](https://i-blog.csdnimg.cn/direct/0380f22692f54a3f968cd5e47cbd847c.png)
Grouping customers(客户信息数据库)![![[Pasted image 20260418165842.png|377]]](https://i-blog.csdnimg.cn/direct/6448c5add8594b308977dd5e3dea5636.png)
根据数据将客户分成不同的市场细分,从而高效的为客户服务![![[Pasted image 20260418172746.png]]](https://i-blog.csdnimg.cn/direct/9cbcf55bd2a145bda1f9f53c80634439.png)
Concept:
- Data only comes with inputs x, but not output labels y.
- Algorithm has to find structure in the data.
Learning Type: - Clustering(聚类算法):将相似的数据点分组在一起(Group similar datapoints together.)
- Anomaly Detection(异常检测):找出异常数据点(Find unusual data points)
- Dimensionality Reduction(降维):将一个大型数据集压缩成一个更小的数据集 同时尽可能少地丢失信息(Compress data using fewer numbers)
![![[Pasted image 20260418174657.png]]](https://i-blog.csdnimg.cn/direct/c782a158e27b424994d10cf530c5c8b6.png)
Jupyter Notebooks
Conda环境配置
常用的conda指令:
创建新的python环境 conda create -n env_name python=3.x
查看已有的python环境 conda env list
进入已有的python环境 conda activate env_name
退出当前的python环境 conda deactivate
常用的pip指令: pip install -r requirements.txt 根据requirements.txt的内容安装所需的包 pip install package_name 安装包
pip install ............... --timeout 6000 pip
换清华源后缀: -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple --trusted-host=https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
可以直接Vscode安装插件
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐



所有评论(0)