Introduction to Machine Learning with Python
By Deepti Chopra and Roopal Khurana
()
About this ebook
Read more from Deepti Chopra
Natural Language Processing: Python and NLTK Rating: 0 out of 5 stars0 ratingsAromatherapy: The Science of Essential Oils Rating: 0 out of 5 stars0 ratings
Related to Introduction to Machine Learning with Python
Related ebooks
Introduction to Machine Learning with Python Rating: 0 out of 5 stars0 ratingsArtificial Intelligence and Multimedia Data Engineering: Volume 1 Rating: 0 out of 5 stars0 ratingsTrends in Future Informatics and Emerging Technologies Rating: 0 out of 5 stars0 ratingsCross-Industry Blockchain Technology: Opportunities and Challenges in Industry 4.0 Rating: 0 out of 5 stars0 ratingsQuick Guideline for Computational Drug Design (Revised Edition) Rating: 0 out of 5 stars0 ratingsHuman-Computer Interaction and Beyond: Advances Towards Smart and Interconnected Environments (Part I) Rating: 0 out of 5 stars0 ratingsDisease Prediction using Machine Learning, Deep Learning and Data Analytics Rating: 0 out of 5 stars0 ratingsBusiness Models and Innovative Technologies for SMEs Rating: 0 out of 5 stars0 ratingsArtificial Intelligence: Models, Algorithms and Applications Rating: 0 out of 5 stars0 ratingsIntroduction to Sensors in IoT and Cloud Computing Applications Rating: 0 out of 5 stars0 ratingsNumerical Machine Learning Rating: 1 out of 5 stars1/5Future Farming: Advancing Agriculture with Artificial Intelligence Rating: 0 out of 5 stars0 ratingsDeep Learning for Healthcare Services Rating: 0 out of 5 stars0 ratingsFrontiers in Medicinal Chemistry: Volume 9 Rating: 0 out of 5 stars0 ratingsReliability Calculations with the Stochastic Finite Element Rating: 0 out of 5 stars0 ratingsIon Implantation and Activation: Volume 3 Rating: 0 out of 5 stars0 ratingsMulti-Objective Optimization in Theory and Practice II: Metaheuristic Algorithms Rating: 0 out of 5 stars0 ratingsAmazon Web Services: The Definitive Guide for Beginners and Advanced Users Rating: 0 out of 5 stars0 ratingsIoT-enabled Sensor Networks: Architecture, Methodologies, Security, and Futuristic Applications Rating: 0 out of 5 stars0 ratingsSoft Robotics Rating: 0 out of 5 stars0 ratingsApplications of Modern Mass Spectrometry: Volume 1 Rating: 0 out of 5 stars0 ratingsModern Intelligent Instruments - Theory and Application Rating: 0 out of 5 stars0 ratingsTechnology Enterprise Business Models: A Handbook For The Post Pandemic Era Rating: 0 out of 5 stars0 ratingsComputational Intelligence for Sustainable Transportation and Mobility: Volume 1 Rating: 0 out of 5 stars0 ratingsBudget Optimization and Allocation: An Evolutionary Computing Based Model Rating: 0 out of 5 stars0 ratingsRecent Advances in Analytical Techniques: Volume 1 Rating: 0 out of 5 stars0 ratingsHandbook of Mobile Application Development: A Guide to Selecting the Right Engineering and Quality Features Rating: 0 out of 5 stars0 ratingsArtificial Neural Systems: Principle and Practice Rating: 0 out of 5 stars0 ratingsProgress in Green Economics Rating: 0 out of 5 stars0 ratings
Intelligence (AI) & Semantics For You
101 Midjourney Prompt Secrets Rating: 3 out of 5 stars3/5Midjourney Mastery - The Ultimate Handbook of Prompts Rating: 5 out of 5 stars5/5Killer ChatGPT Prompts: Harness the Power of AI for Success and Profit Rating: 2 out of 5 stars2/5ChatGPT Rating: 3 out of 5 stars3/5AI for Educators: AI for Educators Rating: 5 out of 5 stars5/5How To Become A Data Scientist With ChatGPT: A Beginner's Guide to ChatGPT-Assisted Programming Rating: 5 out of 5 stars5/5ChatGPT For Dummies Rating: 0 out of 5 stars0 ratingsCreating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 5 out of 5 stars5/5Artificial Intelligence: A Guide for Thinking Humans Rating: 4 out of 5 stars4/5Chat-GPT Income Ideas: Pioneering Monetization Concepts Utilizing Conversational AI for Profitable Ventures Rating: 4 out of 5 stars4/5TensorFlow in 1 Day: Make your own Neural Network Rating: 4 out of 5 stars4/5ChatGPT For Fiction Writing: AI for Authors Rating: 5 out of 5 stars5/5ChatGPT Ultimate User Guide - How to Make Money Online Faster and More Precise Using AI Technology Rating: 0 out of 5 stars0 ratingsMake Money with ChatGPT: Your Guide to Making Passive Income Online with Ease using AI: AI Wealth Mastery Rating: 0 out of 5 stars0 ratingsThe Secrets of ChatGPT Prompt Engineering for Non-Developers Rating: 5 out of 5 stars5/5A Quickstart Guide To Becoming A ChatGPT Millionaire: The ChatGPT Book For Beginners (Lazy Money Series®) Rating: 4 out of 5 stars4/5Enterprise AI For Dummies Rating: 3 out of 5 stars3/5Dark Aeon: Transhumanism and the War Against Humanity Rating: 5 out of 5 stars5/5Summary of Super-Intelligence From Nick Bostrom Rating: 5 out of 5 stars5/5ChatGPT: The Future of Intelligent Conversation Rating: 4 out of 5 stars4/5
Reviews for Introduction to Machine Learning with Python
0 ratings0 reviews
Book preview
Introduction to Machine Learning with Python - Deepti Chopra
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
Delhi-110053
India
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: deepti.chopra@jimsindia.org
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 script
Make, 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]. Python has the ability to build projects related to statistics, and mathematics and also deal with the scientific function. Python comprises rich set of library that may be imported to build data science related application. The reason why Python is considered a widely used language for building research-based projects and scientific applications is its simple syntax and ease in use