"Python and Machine Learning in Practice: Decision Tree, Integrated Learning, Support Vector Machine and Neural Network Algorithm Detailed Explanation and Programming Implementation" PDF

Download link: https://pan.baidu.com/s/1lTl6z8Vv1LfIvdBjv16YpQ Password: avij

  • Publisher:  Electronics Industry Press; 1st edition (July 1, 2017)
  • Paperback:  315 pages
  • Language:  Simplified Chinese
  • Format:  16
  • ISBN: 9787121317200
  • Barcode:  9787121317200
  • Product size:  23 x 18.4 x 1.2 cm
  • Item weight:  540 g
  • ASIN: B073LYTXNV

Editor's Choice

Algorithms and codes are taken into account, and the combination of theory and practice
is very rich: 7 algorithms, 50 implementations, 55 examples, and a total code size of 5295 lines, comprehensive but not redundant
. Very solid: The core content of classic and effective machine learning algorithms is analyzed The fairly detailed derivation
is very applied: write the theory down in Python code, which can solve certain tasks
. Very cutting-edge: narrates cutting-edge technologies such as TensorFlow framework, Inception-v3 from Google, and migration learning

About the Author

Graduated from the Department of Mathematics of Peking University, worked for Beijing Xiaofeiya Technology Co., Ltd., with more than 10 years of experience in C language development, and later switched to Python, with in-depth research on machine learning, neural networks, and Bayesian algorithms. He has participated in real-time target tracking algorithm research; pedestrian detection and its implementation in python; target detection algorithm research based on neural network.

content

Chapter 1 Introduction to Python and Machine Learning 1
1.1 Introduction to Machine Learning 1
1.1.1 What is Machine Learning 2
1.1.2 Common Terms in
Machine Learning 3 1.1.3 The Importance of Machine Learning 6
1.2 Life is too short, I use Python 7
1.2. 1 Why choose Python 7
1.2.2 The advantages of Python in the field of machine learning 8
1.2.3 Installation and use of Anaconda 8
1.3 The first machine learning example 12
1.3.1 Obtaining and processing data 13
1.3.2 Selecting and training models 14
1.3. 3 Evaluating and Visualizing Results 15
1.4 Chapter Summary 17
Chapter 2 Bayesian Classifiers 18
2.1 Bayesian School 18
2.1.1 Bayesian and Frequentist School 19
2.1.2 Bayesian Decision Theory 19
2.2 Parameter Estimation 20
2.2 .1 Maximum Likelihood Estimation (ML Estimation) 21
2.2.2 Maximum Posterior Probability Estimation (MAP Estimation) 22
2.3 Naive Bayes 23
2.3.1 Algorithm Statement and Construction of Basic Architecture 23
2.3.2 Implementation and Evaluation of MultinomialNB 31 2.3.3 Implementation and Evaluation of GaussianNB
40
2.3.4 Implementation and Evaluation of MergedNB 43
2.3.5 Vectorization of Algorithms 50
2.4 Semi-Naive Bayes and Bayesian Nets 53
2.4.1 Semi-Naive Bayes 53
2.4.2 Bayesian Nets 54
2.5 Relevant Mathematical Theory 55
2.5.1 Bayesian Formula and Posterior Probabilities 55
2.5.2 Discrete Naive Bayesian Algorithms 56
2.5.3 Naive Bayes and Bayesian Decision Making 58
2.6 Chapter Summary 59
Chapter 3 Decision Trees 60
3.1 Information in Data 60
3.1.1 Introduction to Information Theory 61
3.1.2 Uncertainty 61
3.1.3 Gains of Information 65
3.1.4 Decision Tree Generation 68
3.1.5 Related Implementations 77
3.2 Overfitting and Pruning 92
3.2.1 ID3, C4.5 Pruning Algorithms 93
3.2.2 CART Pruning 100
3.3 Evaluation and Visualization 103
3.4 Relevant Mathematical Theory 111
3.5 Chapter Summary 113
Chapter 4 Integrated Learning 114
4.1 "Integrated" Idea 114
4.1.1 Public Engine Yiju 115
4.1.2 Bagging and Random Forest 115
4.1.3 PAC Framework and Boosting 119
4.2 Random Forest Algorithm 120
4.3 AdaBoost Algorithm 124
4.3.1 AdaBoost Algorithm Statement 124
4.3.2 Selection of Weak Models 126
4.3.3 AdaBoost Implementation of 127
4.4 Performance Analysis of Ensemble Models 129
4.4.1 Performance on random datasets 130
4.4.2 Performance on XOR datasets 131
4.4.3 Performance on spiral datasets 134
4.4.4 Performance on mushroom datasets 136
4.5 Explanation of the AdaBoost algorithm 138
4.6 Related mathematics Theory 139
4.6.1 Empirical Distribution Functions 139
4.6.2 AdaBoost and the Forward Stepwise Addition Model 140
4.7 Chapter Summary 142
Chapter 5 Support Vector Machines 144
5.1 Perceptron Models 145
5.1.1 Linear Separability and Perceptron Strategies 145
5.1. 2 Perceptron Algorithms 148
5.1.3 Dual Form of Perceptron Algorithm 151
5.2 From Perceptron to Support Vector Machine 153
5.2.1 Interval Maximization and Linear SVM 154
5.2.2 Dual Form of SVM Algorithm 158
5.2.3 Training of SVM 161
5.3 From Linear to Nonlinear 163
5.3.1 Brief Description of Kernel Techniques 163
5.3.2 Applications of Kernel Techniques 166
5.4 Multiple Classification and Support Vector Regression 180
5.4.1 One-vs-Rest Methods 180
5.4.2 One-to-One Method (One-vs-One) 181
5.4.3 Directed AcyclicGraph Method (DirectedAcyclicGraphMethod) 181
5.4.4 Support VectorRegression (SupportVectorRegression) 182
5.5 Relevant Mathematical Theory 183
5.5.1 Gradient Descent 183
5.5.2 Lagrangian Duality 185
5.6 Chapter Summary 187
Chapter 6 Neural Networks 188
6.1 From Perceptron to Multilayer Perceptron 189
6.2 Forward Conduction Algorithm 192
6.2. 1 Algorithm Overview 193
6.2.2 Activation Function (ActivationFunction) 195
6.2.3 CostFunction (CostFunction) 199
6.3 Backpropagation Algorithm 200
6.3.1 Algorithm Overview 200
6.3.2 Selection of Loss Function 202
6.3.3 Related Implementations 205
6.4 Special Layer structure 211
6.5 Parameter update 214
6.5.1VanillaUpdate 217
6.5.2MomentumUpdate 217
6.5.3NesterovMomentumUpdate 219
6.5.4RMSProp 220
6.5.5Adam 221
6.5.6Factory 222
6.6 Naive network structure 223
6.7 Network structure under "big data" 227
6.7 .1 The idea of ​​batches 228
6.7.2 Cross-validation 230
6.7.3 Progress bars 231
6.7.4 Timers 233
6.8 Related mathematical theory 235
6.8.1 Derivation of BP Algorithm 235
6.8.2 Softmax+log-likelihood combination 238
6.9 Chapter Summary 240
Chapter 7 Convolutional Neural Networks 241
7.1 From NN to CNN 242
7.1.1 Sharing of “view” 242
7.1.2 Forward conduction algorithm 243
7.1.3 Fully Connected Layer 250
7.1.4 Pooling 251
7.2 Rewriting NN with TensorFlow 252
7.2.1 Backpropagation Algorithm 252
7.2.2 Rewriting Layer Structure 253
7.2.3 Implementing SubLayer Structure 255
7.2.4 Rewriting the CostLayer structure 261
7.2.5 Rewriting the network structure 262
7.3 Extending NN to CNN 263
7.3.1 Implementing convolutional layers 263
7.3.2 Implementing pooling layers 266
7.3.3 Implementing special layer structures in CNNs 267
7.3.4 Implementing LayerFactory 268
7.3.5 Extending
the network structure 270 7.4 CNN performance 272
7.4.1 Problem description 272
7.4.2 Building a CNN model 273
7.4.3 Model analysis 280
7.4.4 Methods of applying CNN 283
7.4.5 Inception 286
7.5 Chapter Summary 289
Appendix A Getting Started with Python 290
Appendix B Getting Started with Numpy 303
Appendix C Getting Started with TensorFlow 310

Preamble

Foreword
Since AlphaGo defeated Li Shishi, the top human player in Go in March 2016, words such as "artificial intelligence" and "deep learning" have entered the public's field of vision; as a broader concept - "machine learning", how much Homeopathy has become a hot topic from academia to industry. Many people may want to try and experience "machine learning", which can be said to be quite magical, but they may not know how to start. The purpose of writing this book is to introduce a method for getting started with machine learning. Although there are many machine learning books on the market, most of them are either too theoretical, too applied, or too "heavy"; this book is dedicated to combining theory with practice. A concise and powerful programming language for a range of practices and applications.
Of course, limited by the author's level, some of the models implemented in this book will be much slower than models implemented in mature third-party libraries. On the one hand, the underlying language is often used to implement core algorithms behind better third-party libraries. On the other hand, this book usually covers the process of data preprocessing in the model. Taking the decision tree model as an example, the decision tree model in scikit-learn will be much faster than the implementation in this book, but the model implemented in this book can be trained with a training set that the decision tree model in scikit-learn cannot.
At the same time, due to space limitations, this book cannot release all the codes (in fact, the significance of doing so is not very big), so we will omit some implementations that are relatively boring and have little to do with the core idea of ​​the corresponding algorithm. For these implementations, we will explain the corresponding algorithms. Interested readers can try to implement them step by step, or they can directly view the version implemented by the author on GitHub (the GitHub address will be posted in the corresponding place). The author also recommends downloading the contents of this link as a reference before reading this book. After all, even after the end of this book, the author will still optimize and update the corresponding algorithm in the above link from time to time, and these updates cannot be reflected in this book.
虽说确实可以完全罔顾理论来用机器学习解决许多问题,但是如果想要理解背后的道理并借此提高解决问题的效率,扎实的理论根基是必不可少的。本书会尽量避免罗列枯燥的数学公式,但是基本的公式常常不可或缺。虽然笔者想要尽量做到通俗易懂,但仍然还是需要读者拥有一定的数学知识。不过为了阅读体验良好,本书通常会将比较烦琐的数学理论及相关推导放在每一章的倒数第二节(最后一节是总结)作为某种意义上的“附加内容”。这样做有若干好处:
? 对于已经熟知相关理论的读者,可以不再重复地看同样的东西;
? 对于只想了解机器学习各种思想、算法和实现的读者,可以避免接受不必要的知识;
? 对于想了解机器学习背后道理和逻辑的读者,可以有一个集中的地方进行学习。
本书的特点
? 理论与实践结合,在较为详细、全面地讲解理论之后,会配上相应的代码实现以加深读者对相应算法的理解。
? 每一章都会有丰富的实例,让读者能够将本书所阐述的思想和模型应用到实际任务中。
? 在涵盖了诸多经典的机器学习算法的同时,也涵盖了许多最新的研究成果(比如最后一章所讲述的卷积神经网络(CNN)可以说就是许多“深度学习”的基础)。
? 所涉及的模型实现大多仅仅基于线性代数运算库(Numpy)而没有依赖更高级的第三方库,读者无须了解Python那浩如烟海的第三方库中的任何一个第三方库便能读懂本书的代码。
本书的内容安排
第1章 Python与机器学习入门
本章介绍了机器学习的概念和一些基础术语,比如泛化能力、过拟合、经验风险(ERM)和结构风险(SRM)等,还介绍了如何安装并使用Anaconda这一Python的科学运算环境。同时在最后,我们解决了一个小型的机器学习问题。本章内容虽不算多,却可说是本书所有内容的根基。
第2章 贝叶斯分类器
作为和我们比较熟悉的频率学派相异的学派,贝叶斯学派的思想相当耐人寻味,值得进行研究与体会。本章将主要介绍的朴素贝叶斯正是贝叶斯决策的一个经典应用,虽然它加了很强的假设,但其在实际应用中的表现仍然相当优异(比如自然语言处理中的文本分类)。而为了克服朴素贝叶斯假设过强的缺点,本章将简要介绍的,诸如半朴素贝叶斯和贝叶斯网这些贝叶斯分类器会在某些领域拥有更好的性能。
第3章 决策树
决策树可以说是最直观的机器学习模型之一,它多多少少拥有着信息论的一些理论背景作为支撑。决策树的训练思想简洁,模型本身可解读性强,本章将会在介绍其生成、剪枝等一系列实现的同时,通过一些可视化来对其有更好的理解。
第4章 集成学习
正所谓“三个臭皮匠,赛过诸葛亮”。集成学习的两大板块“Bootstrap”和“Boosting”所对应的主流模型——“随机森林(RandomForest)”和“AdaBoost”正是这句俗语的理想解释。本章在介绍相关理论与实现的同时,将会通过相当多的例子来剖析集成学习的一些性质。
第5章 支持向量机
支持向量机(SVM)有着非常辉煌的历史,它背后那套相当深刻而成熟的数学理论让它在现代的深度学习中“异军突起”之前,占据着相当重要的地位。本章将会尽量厘清支持向量机的思想与相关的比较简明的理论,同时会通过一些对比来体现支持向量机的优异之处。
第6章 神经网络
神经网络在近现代可以说已经成为“耳熟能详”的词汇了,它让不少初次听说其名号的人(包括笔者在内)对其充满着各种幻想。虽说神经网络算法的推导看上去烦复而“令人生畏”,但其实所用到的知识都并不深奥。本章会相当详细地介绍神经网络中的两大算法——“前向传导算法”和“反向传播算法”,同时还会介绍诸多主流的“参数更新方法”。除此之外,本章还会提及如何在“大数据”下改进和优化我们的神经网络模型(这一套思想是可以推广到其他机器学习模型上的)。
第7章 卷积神经网络
卷积神经网络是许多深度学习的基础结构,它可以算是神经网络的一种拓展。卷积神经网络的思想具有很好的生物学直观,适合处理结构性的数据。同时,利用成熟的卷积神经网络模型,我们能够比较好地完成许多具有一定难度而相当有趣的任务;本章则会针对这些任务中的“图像分类”任务,提出一套比较详细的解决方案。
本书由浅入深,理论与实践并存,同时更是将理论也进行了合理的分级;无论在此前对机器学习有何种程度的认知,想必都能通过不同的阅读方式有所收获吧。
适合阅读本书的读者
? 想要了解某些传统机器学习算法细节的学生、老师、从业者等。
? 想要知道如何“从零开始”高效实现机器学习算法的程序员。
? 想要了解机器学习算法能如何进行应用的职员、经理等。
? 对机器学习抱有兴趣并想要入门的爱好者。

编者 何宇健

文摘

版权页:



插图:




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325636897&siteId=291194637