📄 Page
1
(This page has no text content)
📄 Page
2
Building Machine Learning Systems Using Python Practice to Train Predictive Models and Analyze Machine Learning Results with Real Use-Cases Deepti Chopra www.bpbonline.com
📄 Page
3
FIRST EDITION 2021 Copyright © BPB Publications, India ISBN: 978-93-89423-617 All Rights Reserved. No part of this publication may be reproduced, distributed or transmitted in any form or by any means or stored in a database or retrieval system, without the prior written permission of the publisher with the exception to the program listings which may be entered, stored and executed in a computer system, but they can not be reproduced by the means of publication, photocopy, recording, or by any electronic and mechanical means. LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY The information contained in this book is true to correct and the best of author’s and publisher’s knowledge. The author has made every effort to ensure the accuracy of these publications, but publisher cannot be held responsible for any loss or damage arising from any information in this book. All trademarks referred to in the book are acknowledged as properties of their respective owners but BPB Publications cannot guarantee the accuracy of this information. Distributors:
📄 Page
4
BPB PUBLICATIONS 20, Ansari Road, Darya Ganj New Delhi-110002 Ph: 23254990/23254991 MICRO MEDIA Shop No. 5, Mahendra Chambers, 150 DN Rd. Next to Capital Cinema, V.T. (C.S.T.) Station, MUMBAI-400 001 Ph: 22078296/22078297 DECCAN AGENCIES 4-3-329, Bank Street, Hyderabad-500195 Ph: 24756967/24756400
📄 Page
5
BPB BOOK CENTRE 376 Old Lajpat Rai Market, Delhi-110006 Ph: 23861747 Published by Manish Jain for BPB Publications, 20 Ansari Road, Darya Ganj, New Delhi-110002 and Printed by him at Repro India Ltd, Mumbai www.bpbonline.com
📄 Page
6
Dedicated to My Family and Friends Who are always with me to love, support and care.
📄 Page
7
About the Author Dr. Deepti Chopra is working as Assistant Professor (IT) at Lal Bahadur Shastri Institute of Management, Delhi. She has around 7 years of teaching experience. Her area of interest includes Natural Language Processing, Computational Linguistics and Artificial Intelligence. She is author of 3 books and has written several research papers in various International Conferences and Journals.
📄 Page
8
About the Reviewer Anmol has 3 years of experience in the software industry. He has honed his skills in Machine Learning, Deep Learning, build and maintain ETL/ELT data pipelines and data-driven systems. Some of the industries Anmol has worked in are Airline, E-Commerce, Human Resource and HealthCare. His everyday work involves analysing and solving complex business problems, breaking down the work into feasible actionable tasks, and collaborating with his team and project manager to plan and communicate delivery commitments to our business clients. When he is not working, Anmol spends most of his time reading, traveling the world, playing Fifa and catching his favourite Broadway shows. An admitted sports fanatic, he feeds his addiction to football by watching Real Madrid games on Sunday afternoons.
📄 Page
9
Acknowledgement I want to thank God most of all, because without God I wouldn’t be able to do any of this. I acknowledge with gratitude and sincerely thank all my family and friends for the blessings and good wishes conveyed to me to achieve the goal to publish this machine learning based book. My sincere thanks are due to few friends/TR of this book who encourages and motivate me every time and proves that they are always here for me. Such relations are the perfect example of ‘Quality over Quantity’. This book wouldn’t have happened if I hadn’t had the support from content editor of BPB Publications. My gratitude goes to the editorial and publishing professionals of BPB Publications for their keen interest and support in bringing out this book. Finally, I would like to thank Mr. Manish Jain at BPB Publications for giving me this opportunity to write my first book for them.
📄 Page
10
Preface With the increase in availability of data from different sources, there is a growing need of data driven fields such as analytics and machine learning. This book intends to cover basic concepts of machine learning, various learning paradigms and different architectures and algorithms used in these paradigms. This book is meant for the beginners who want to get knowledge about machine learning in detail. This book can also be used by machine learning users for a quick reference for fundamentals in machine learning. Following are the chapters covered in this book: Chapter 1: Introduction to Machine Learning Description: This chapter covers basic concepts of machine learning, areas in which ML is performed, input-output functions Topics to be covered: What is machine learning? Utility of ML Applications of ML
📄 Page
11
Chapter 2: Linear Regression Description: This chapter discusses about Linear Regression Topics to be covered: List of topics covered in this chapter are: Linear Regression in one variable Linear Regression in multiple variables Gradient descent Polynomial Regression Chapter 3: Classification using Logistic Regression Description: This chapter discusses about classification using Logistic Regression Topics to be covered: List of topics covered in this book are: Binary Classification Logistic Regression Multi class Classification
📄 Page
12
Chapter 4: Overfitting and Regularization Description: This chapter discusses about overfitting and regularization Topics to be covered: List of topics covered in this chapter are: Overfitting and regularization in linear regression Overfitting and regularization in logistic regression Chapter 5: Feasibility of Learning Description: This chapter discusses about feasibility of learning Topics to be covered: Topics covered in this chapter are: Feasibility of learning an unknown target function In-sample error Out-of-sample error Chapter 6: Support Vector Machine Description: This chapter discusses about Support Vector Machine
📄 Page
13
Topics to be covered: Please provide the list of topics to be covered through the book: Introduction 1.1 Margin 1.2 Large Margin methods Kernel methods Chapter 7: Neural Network Description: This chapter discusses about Neural Network Topics to be covered: List of topics covered in this chapter are: Introduction Early models Perceptron learning Backpropagation Stochastic Gradient Descent
📄 Page
14
Chapter 8: Decision Trees Description: This chapter discusses about decision trees Topics to be covered: List of topics covered in this chapter are: Decision Trees Regression Tree Stopping Criterion and Pruning Loss functions in Decision Tree Categorical Attributes, Multiway Splits and Missing Values in Decision Trees Instability in Decision Trees Chapter 9: Unsupervised Learning Description: This chapter discusses about Unsupervised Learning Topics to be covered: List of topics covered in this chapter are: Introduction Clustering 2.1 K-means Clustering
📄 Page
15
2.2 Hierarchical Clustering Principal Component Analysis' Chapter 10: Theory of Generalization Description: This chapter discusses about theory of generalization Topics to be covered: List of topics covered in this chapter are: Training versus Testing Bounding the testing error Vapnik Chervonenkis inequality VC Dimension Proof of VC inequality Chapter 11: Bias and Fairness in ML Description: This chapter discusses about bias and fairness in ML Topics to be covered: List of topics covered in this chapter are:
📄 Page
16
Introduction How to detect bias? How to fix biases or achieve fairness in ML?
📄 Page
17
Downloading the code bundle and coloured images: Please follow the link to download the Code Bundle and the Coloured Images of the book: https://rebrand.ly/34fca5 Errata We take immense pride in our work at BPB Publications and follow best practices to ensure the accuracy of our content to provide with an indulging reading experience to our subscribers. Our readers are our mirrors, and we use their inputs to reflect and improve upon human errors, if any, that may have occurred during the publishing processes involved. To let us maintain the quality and help us reach out to any readers who might be having difficulties due to any unforeseen errors, please write to us at : errata@bpbonline.com Your support, suggestions and feedbacks are highly appreciated by the BPB Publications’ Family.
📄 Page
18
Did you know that BPB offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.bpbonline.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at business@bpbonline.com for more details. At you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on BPB books and eBooks.
📄 Page
19
BPB is searching for authors like you If you're interested in becoming an author for BPB, please visit www.bpbonline.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea. The code bundle for the book is also hosted on GitHub at In case there's an update to the code, it will be updated on the existing GitHub repository. We also have other code bundles from our rich catalog of books and videos available at Check them out! PIRACY If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at business@bpbonline.com with a link to the material. If you are interested in becoming an author
📄 Page
20
If there is a topic that you have expertise in, and you are interested in either writing or contributing to a book, please visit REVIEWS Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at BPB can understand what you think about our products, and our authors can see your feedback on their book. Thank you! For more information about BPB, please visit