Introduction to Machine Learning with Python - Deepti Chopra - E-Book

Introduction to Machine Learning with Python E-Book

Deepti Chopra

0,0
44,81 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

Machine learning is a subfield of artificial intelligence, broadly defined as a machine's capability to imitate intelligent human behavior. Like humans, machines become capable of making intelligent decisions by learning from their past experiences. Machine learning is being employed in many applications, including fraud detection and prevention, self-driving cars, recommendation systems, facial recognition technology, and intelligent computing. This book helps beginners learn the art and science of machine learning. It presens real-world examples that leverage the popular Python machine learning ecosystem,
 
The topics covered in this book include machine learning basics: supervised and unsupervised learning, linear regression and logistic regression, Support Vector Machines (SVMs). It also delves into special topics such as neural networks, theory of generalisation, and bias and fairness in machine learning. After reading this book, computer science and engineering students - at college and university levels - will receive a complete understanding of machine learning fundamentals and will be able to implement neural network solutions in information systems, and also extend them to their advantage.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 148

Veröffentlichungsjahr: 2008

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents
BENTHAM SCIENCE PUBLISHERS LTD.
End User License Agreement (for non-institutional, personal use)
Usage Rules:
Disclaimer:
Limitation of Liability:
General:
FOREWORD
PREFACE
CONSENT FOR PUBLICATION
CONFLICT OF INTEREST
ACKNOWLEDGEMENT
Introduction to Python
Abstract
INTRODUCTION
Web Development
Game Development
Artificial Intelligence and Machine Learning
Desktop GUI
SETTING UP PYTHON ENVIRONMENT
Steps Involved In Installing Python On Windows Include The Following:
Steps involved in installing Python on Macintosh include the following
Setting Up Path
Setting Up Path In The Unix/linux
WHY PYTHON FOR DATA SCIENCE?
ECOSYSTEM FOR PYTHON MACHINE LEARNING
ESSENTIAL TOOLS AND LIBRARIES
Jupyter Notebook
Pip Install Jupiter
NumPy
Pandas
Scikit-learn
SciPy
Matplotlib
Mglearn
PYTHON CODES
CONCLUSION
Exercises
REFERENCES
Introduction To Machine Learning
Abstract
INTRODUCTION
DESIGN A LEARNING SYSTEM
Selection Of Training Set
Selection Of Target Function
Selection Of A Function Approximation Algorithm
PERSPECTIVE AND ISSUES IN MACHINE LEARNING
Issues In Machine Learning
Quality of Data
Improve the Quality of Training
Overfitting the Training Data
Machine Learning Involves A Complex Process
Insufficient training data
Feasibility of Learning An Unknown Target Function
Collection of Data
Pre-processing of Data
Dealing with Null Values
Standardization
Dealing with Categorical Variables
Feature Scaling
Splitting the Data
Finding The Model That Will Be Best For The Data
Training and Testing Of The Developed Model Evaluation
In Sample Error and Out of Sample Error
Applications of Machine Learning
Virtual Personal Assistants
Traffic Prediction
Online Transportation Networks
Video Surveillance System
Social Media Services
People you May Know
Face Recognition
Similar Pins
Sentiment Analysis
Email Spam and Malware Filtering
Online Customer Support
Result Refinement of a Search Engine
Product Recommendations
Online Fraud Detection
Online Gaming
Financial Services
Healthcare
Oil and Gas
Self-driving Cars
Automatic Text Translation
Dynamic Pricing
Classification of News
Information Retrieval
Robot Control
CONCLUSION
Exercises
REFERENCES
Linear Regression and Logistic Regression
Abstract
INTRODUCTION
LINEAR REGRESSION
Linear Regression In One Variable
Linear Regression In Multiple Variables
Overfitting and Regularization In Linear Regression
GRADIENT DESCENT
POLYNOMIAL REGRESSION
Features of Polynomial Regression
LOGISTIC REGRESSION
Overfitting and Regularisation in Logistic Regression
BINARY CLASSIFICATION AND MULTI-CLASS CLASSIFICATION
Binary Classification Tests
Classification Accuracy
Error Rate
Sensitivity
Specificity
PYTHON CODES
CONCLUSION
Exercises
REFERENCES
Support Vector Machine
Abstract:
INTRODUCTION
SUPPORT VECTOR CLASSIFICATION
The Maximal Margin Classifier
Soft Margin Optimization
Linear Programming Support Vector Machines
SUPPORT VECTOR REGRESSION
Kernel Ridge Regression
Gaussian Processes
APPLICATIONS OF SUPPORT VECTOR MACHINE
Text Categorisation
Image Recognition
Bioinformatics
PYTHON CODE
CONCLUSION
Exercises
REFERENCES
Decision Trees
Abstract:
INTRODUCTION
REGRESSION TREES
STOPPING CRITERION AND PRUNING LOSS FUNCTIONS IN DECISION TREE
CATEGORICAL ATTRIBUTES, MULTIWAY SPLITS AND MISSING VALUES IN DECISION TREES
ISSUES IN DECISION TREE LEARNING
Preventing Overfitting of Data
Incorporating Continuous Valued Attributes
Other Measures for Attributes Selection
Handling Missing Values
Handling of Attributes with Differing Costs
INSTABILITY IN DECISION TREES
PYTHON CODE
CONCLUSION
Exercises
REFERENCES
Neural Network
Abstract :
INTRODUCTION
EARLY MODELS
PERCEPTRON LEARNING
BACKPROPAGATION
AN ILLUSTRATIVE EXAMPLE: FACE RECOGNITION
STOCHASTIC GRADIENT DESCENT
ADVANCED TOPICS IN ARTIFICIAL NEURAL NETWORK
Alternative Error Functions
Alternative Error Minimization Mechanism
Recurrent Networks
Dynamically Modifying Network Structures
PYTHON CODES
CONCLUSION
Exercises
REFERENCES
Supervised Learning
Abstract:
INTRODUCTION
USING STATISTICAL DECISION THEORY
Gaussian or Normal Distribution
Conditionally Independent Binary Components
LEARNING BELIEF NETWORKS
NEAREST-NEIGHBOUR METHODS
CONCLUSION
Exercises
REFERENCES
Unsupervised Learning
Abstract:
INTRODUCTION
CLUSTERING
K-means Clustering
Hierarchical Clustering
Principal Component Analysis (PCA)
PYTHON CODE
CONCLUSION
Exercises
REFERENCES
Theory of Generalisation
Abstract
INTRODUCTION
BOUNDING THE TESTING ERROR
VAPNIK CHERVONENKIS INEQUALITY
PROOF OF VC INEQUALITY
CONCLUSION
Exercises
REFERENCES
Bias and Fairness in Ml
Abstract
INTRODUCTION
HOW TO DETECT BIAS?
HOW TO FIX BIASES OR ACHIEVE FAIRNESS IN ML?
CONFIDENCE INTERVALS
HYPOTHESIS TESTING
COMPARING LEARNING ALGORITHMS
CONCLUSION
Exercises
REFERENCES
APPENDIX
CONCLUSION
Introduction to Machine Learning with Python
Authored By
Deepti Chopra
Jagan Institute of Management Studies,
Sector 5, Rohini, Delhi-110085,
India
&
Roopal Khurana
Railtel Corporation of India Ltd,
IT Park, Shastri Park,
Delhi-110053,
India

BENTHAM SCIENCE PUBLISHERS LTD.

End User License Agreement (for non-institutional, personal use)

This is an agreement between you and Bentham Science Publishers Ltd. Please read this License Agreement carefully before using the ebook/echapter/ejournal (“Work”). Your use of the Work constitutes your agreement to the terms and conditions set forth in this License Agreement. If you do not agree to these terms and conditions then you should not use the Work.

Bentham Science Publishers agrees to grant you a non-exclusive, non-transferable limited license to use the Work subject to and in accordance with the following terms and conditions. This License Agreement is for non-library, personal use only. For a library / institutional / multi user license in respect of the Work, please contact: [email protected].

Usage Rules:

All rights reserved: The Work is the subject of copyright and Bentham Science Publishers either owns the Work (and the copyright in it) or is licensed to distribute the Work. You shall not copy, reproduce, modify, remove, delete, augment, add to, publish, transmit, sell, resell, create derivative works from, or in any way exploit the Work or make the Work available for others to do any of the same, in any form or by any means, in whole or in part, in each case without the prior written permission of Bentham Science Publishers, unless stated otherwise in this License Agreement.You may download a copy of the Work on one occasion to one personal computer (including tablet, laptop, desktop, or other such devices). You may make one back-up copy of the Work to avoid losing it.The unauthorised use or distribution of copyrighted or other proprietary content is illegal and could subject you to liability for substantial money damages. You will be liable for any damage resulting from your misuse of the Work or any violation of this License Agreement, including any infringement by you of copyrights or proprietary rights.

Disclaimer:

Bentham Science Publishers does not guarantee that the information in the Work is error-free, or warrant that it will meet your requirements or that access to the Work will be uninterrupted or error-free. The Work is provided "as is" without warranty of any kind, either express or implied or statutory, including, without limitation, implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the results and performance of the Work is assumed by you. No responsibility is assumed by Bentham Science Publishers, its staff, editors and/or authors for any injury and/or damage to persons or property as a matter of products liability, negligence or otherwise, or from any use or operation of any methods, products instruction, advertisements or ideas contained in the Work.

Limitation of Liability:

In no event will Bentham Science Publishers, its staff, editors and/or authors, be liable for any damages, including, without limitation, special, incidental and/or consequential damages and/or damages for lost data and/or profits arising out of (whether directly or indirectly) the use or inability to use the Work. The entire liability of Bentham Science Publishers shall be limited to the amount actually paid by you for the Work.

General:

Any dispute or claim arising out of or in connection with this License Agreement or the Work (including non-contractual disputes or claims) will be governed by and construed in accordance with the laws of Singapore. Each party agrees that the courts of the state of Singapore shall have exclusive jurisdiction to settle any dispute or claim arising out of or in connection with this License Agreement or the Work (including non-contractual disputes or claims).Your rights under this License Agreement will automatically terminate without notice and without the need for a court order if at any point you breach any terms of this License Agreement. In no event will any delay or failure by Bentham Science Publishers in enforcing your compliance with this License Agreement constitute a waiver of any of its rights.You acknowledge that you have read this License Agreement, and agree to be bound by its terms and conditions. To the extent that any other terms and conditions presented on any website of Bentham Science Publishers conflict with, or are inconsistent with, the terms and conditions set out in this License Agreement, you acknowledge that the terms and conditions set out in this License Agreement shall prevail.

Bentham Science Publishers Pte. Ltd. 80 Robinson Road #02-00 Singapore 068898 Singapore Email: [email protected]

FOREWORD

I take the opportunity to congratulate the authors, Dr. Deepti Chopra and Mr. Roopal Khurana who have written this book titled, “Introduction to Machine Learning With Python”.

The advancement in technology in the past decade has been due to the introduction of Machine Learning. Today, machine learning has escalated Artificial Intelligence Revolution, be it in Fraud Detection and Prevention, Self-driving cars, Recommendation Systems, Facial Recognition technology, etc.

Machine Learning is one of the approaches of Artificial Intelligence in which Machines become capable of drawing intelligent decisions like humans by learning from their past experiences. In classical methods of Artificial Intelligence, step-by-step instructions are provided to the machines to solve a problem. Machine learning combines classical methods of Artificial Intelligence with the knowledge of the past to gain human-like intelligence.

The authors of this book have given explanations on Machine Learning with Python from the basics to the advanced level so as to assist beginners in building a strong foundation and developing practical understanding.

Beginners with zero or little knowledge about Machine Learning can gain insight into this subject from this book. This book explains Machine Learning concepts using real-life examples implemented in Python.

After learning from this book, one will be able to apply concepts of Machine Learning to real-life problems.

I am sure readers will benefit from this book and gain a lot in the field of machine learning.

Happy Reading!!

Best regards,

Rajesh Pokhriyal | Scientist 'D' Indian Computer Emergency Response Team (CERT-In) Ministry of Electronics & IT Electronics Niketan 6 CGO Complex Lodhi Road New Delhi 110003

PREFACE

Machine learning has become part and parcel of day-to-day private/non-profit/business and government operations because of its ability to grasp automatically through past experiences without being explicitly programmed. Today, machine learning has conquered the entire industry due to its numerous applications ranging from digital marketing to space research. Today, it governs the industry in terms of building high-tech products, ranking web searches, building speech recognition systems, recommendation systems, etc. However, we have not yet developed fully operational machines that give judgments on their own like humans but it is not far away to reach that level. From this book, we intend to re-discover the core concepts of Machine learning paradigms along with numerous architectures and algorithms used in different paradigms. The book elaborates on various topics related to the implementation side using Python with real-life examples. The book can kickstart your career in the field of Machine Learning. It also provides the basic knowledge of Python which is a prerequisite of this course. We can say that this book is meant for neophyte users who wish to get acquainted with the implementation of machine learning using Python. The reader will be able to read well-explained examples and exercises and it will be an ideal choice for Machine Learning enthusiasts. The book presents detailed practice exercises for offering a comprehensive introduction to machine learning techniques along with the basics of Python. The book leverages algorithms of machine learning in a unique way of describing real-life applications. Though not mandatory, some experience with subject knowledge will fasten the learning process.

CONSENT FOR PUBLICATION

Not applicable.

CONFLICT OF INTEREST

The author declares no conflict of interest, financial or otherwise.

ACKNOWLEDGEMENT

Declared none.

Deepti Chopra Jagan Institute of Management Studies Sector 5, Rohini, Delhi-110085 India &Roopal Khurana Railtel Corporation of India Ltd IT Park, Shastri Park

Introduction to Python

Deepti Chopra,Roopal Khurana
Jagan Institute of Management Studies, Sector 5, Rohini, Delhi, India
Railtel Corporation of India Ltd., Delhi, India

Abstract

Python is considered one of the most simple and efficient programming languages. Its object-oriented programming approach and elegant syntax make it a powerful programming language. Python is an interpreted language. Its dynamic typing and high level data structures make it an ideal language for application development in various areas and on multiple platforms. Today, Python is widely used in the areas of machine learning and data science. The following chapter discusses Python, the utility of Python in machine learning and data science, ecosystem of Python in machine learning and various libraries in Python required for machine learning.

Keywords: Data science, Jupyter, Machine learning, Matplotlib, Numpy, Python, Scikit learn, SciPy.
*Corresponding author Deepti Chopra, Jagan Institute of Management Studies, Delhi, India; E-mail: [email protected]

INTRODUCTION

Python was developed by Guido van Rossum in 1990s. The name of the language ‘Python’ was taken from “Monty Python’s Flying Circus”, which was one of the favorite TV shows of Guido van Rossum. Python has a simple syntax that was designed as a language that could be used easily by beginners yet proven to be one of the most powerful languages for advanced developers. Python is an object-oriented programming language that can be used on various platforms. The syntax used in Python is very simple as compared to other programming languages [1]. Today, Python is considered a very popular programming language among students, researchers, developers, etc. Python is extensively used by tech giants such as Netflix, Facebook, Google, etc. Python offers numerous applications [2], [3]. These include the following:

Web Development

Nowadays, Python is used widely in web development. Some of the frameworks for web development in Python are: Django, Pyramid, Flask, etc. These frameworks are known to incorporate characteristics such as scalability, flexibility, security, etc.

Game Development

PySoy and PyGame are two python libraries that are used for game development.

Artificial Intelligence and Machine Learning

There are a large number of open-source libraries which can be used while developing AI/ML applications.

Desktop GUI

Desktop GUI offers many toolkits and frameworks using which we can build desktop applications. PyQt, PyGtk, PyGUI are some of the GUI frameworks.

Today, Python is used extensively for doing research especially in the areas of bioinformatics, mathematics, biology, etc. It is a part of Computer Science curriculum for many universities.

It is not just companies that seek through python. Python is used in various fields such as Artificial Intelligence, Astronomy, Internet of Things and Social Science.

In this chapter, we will discuss Python, set up Python environment and the importance of using Python in Data Science. We will also discuss tools and libraries used in Python Programming.

SETTING UP PYTHON ENVIRONMENT

Python is available on different platforms such as Windows, Linux and Mac OS X. We can open Window terminal and type “python” ; this will return the version of python if it is already installed.

Current documentation, source code, news and updated version of Python are available at: https://www.python.org/

We may download documentation of python in different formats such as PDF, HTML and PostScript format from https://www.python.org/doc/.

For installing Python, we need to download the binary code according to our platform. If binary code for our platform is not available, then we need to compile the code on c compiler manually.

Steps involved in installing Python on Unix/Linux include the following:

Check if python is already installed on machine by going to terminal using Ctrl+Alt+T. For Python2, type python —version and For Python3.x, type python3.x —version. In case, Python is already installed, then the version of Python installed is returned.

If Python is not installed then follow the following steps:

Open the URL, https://www.python.org/downloads/.Download and extract files from zipped code available for Linux/Unix.Execute ./configure scriptMake, make install

The above steps install python libraries at /usr/local/lib/pythonYY. Here ‘YY’ represents the version of Python installed.

Steps Involved In Installing Python On Windows Include The Following:

Open the URL, https://www.python.org/downloads/.Click on the link python-PQR.msi file and download it. Here, ‘PQR’ refers to the version of python we wish to install.Run the file and this installs python.

Steps involved in installing Python on Macintosh include the following

Open the URL, https://www.python.org/downloads/.MacPython is used for older version of Mac; for Mac which are released before 2003.

Setting Up Path

The executable files and programs may be present in different directory locations. Path consists of a list of directories that comprise executable files that may be searched by the Operating System. Unix is case-sensitive and Windows is not case-sensitive. So, path is ‘PATH’ in Unix and ‘path’ in Windows.

Setting Up Path In The Unix/linux

Add python directory to the path using following ways:

In csh shell, type set env PATH “$PATH:/usr/local/bin/python”In bash shell, type export PATH=“$PATH:/usr/local/bin/python”In ksh shell, type PATH=“$PATH:/usr/local/bin/python”

We can invoke python using different ways. One way to invoke python is by typing “python” at the shell command prompt. We may also type “help”, “credits”,”copyrights” and “license” to get more information about python. We can also open IDLE of Python from START. Python prompt is represented by three greater than sign (>>>). Python commands are written after ‘>>>’ and return key is hit after each command in order to execute it. The ‘print’ command in python is used to print a statement. The print command prints the statement and adds a new line after statement.

We can terminate the python session on shell command prompt by typing ctrl-Z in Windows and ctrl-D on Unix.

The file extension of python file is .py. The first line in a python program is #!/usr/local/bin/python. Python consists of a similar structure like other programming languages. Python program may comprise of if/else/elif, while/for, try/except etc.

WHY PYTHON FOR DATA SCIENCE?

Python is a high-level, interpreted and open source language that is based on object-oriented programming concepts. Python is a very popular language these days. Python offers different libraries that help in implementing different data science applications [4]. Data scientists use python for implementing different applications and projects related to Data Science [5