Machine Learning With Python - Tutorialspoint

3y ago
68 Views
13 Downloads
3.37 MB
167 Pages
Last View : 16d ago
Last Download : 3m ago
Upload by : Nadine Tse
Transcription

Machine Learning with Pythoni

Machine Learning with PythonAbout the TutorialMachine Learning (ML) is basically that field of computer science with the help of whichcomputer systems can provide sense to data in much the same way as human beings do.In simple words, ML is a type of artificial intelligence that extract patterns out of raw databy using an algorithm or method. The key focus of ML is to allow computer systems tolearn from experience without being explicitly programmed or human intervention.AudienceThis tutorial will be useful for graduates, postgraduates, and research students who eitherhave an interest in this subject or have this subject as a part of their curriculum. Thereader can be a beginner or an advanced learner.This tutorial has been prepared for the students as well as professionals to ramp upquickly. This tutorial is a stepping stone to your Machine Learning journey.PrerequisitesThe reader must have basic knowledge of artificial intelligence. He/she should also beaware of Python, NumPy, Scikit-learn, Scipy, Matplotlib.If you are new to any of these concepts, we recommend you to take up tutorials concerningthese topics, before you dig further into this tutorial.Copyright & Disclaimer Copyright 2019 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I)Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republishany contents or a part of contents of this e-book in any manner without written consentof the publisher.We strive to update the contents of our website and tutorials as timely and as precisely aspossible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of ourwebsite or its contents including this tutorial. If you discover any errors on our website orin this tutorial, please notify us at contact@tutorialspoint.comii

Machine Learning with PythonTable of ContentsAbout the Tutorial . iiAudience . iiPrerequisites . iiCopyright & Disclaimer . iiTable of Contents . iii1.Machine Learning with Python – Basics . 1What is Machine Learning? . 1Need for Machine Learning . 1Why & When to Make Machines Learn? . 1Machine Learning Model . 2Challenges in Machines Learning . 4Applications of Machines Learning. 42.Machine Learning with Python – Python Ecosystem . 6An Introduction to Python . 6Strengths and Weaknesses of Python . 6Installing Python . 7Why Python for Data Science? . 9Components of Python ML Ecosystem . 10Jupyter Notebook . 10Types of Cells in Jupyter Notebook . 123.Python Machine Learning – Methods for Machine Learning . 17Different Types of Methods . 17Tasks Suited for Machine Learning . 204.Machine Learning with Python – Data Loading for ML Projects . 22Consideration While Loading CSV data . 22Methods to Load CSV Data File . 23iii

Machine Learning with PythonLoad CSV with NumPy . 24Load CSV with Pandas . 255.Machine Learning with Python – Understanding Data with Statistics . 27Introduction . 27Looking at Raw Data . 27Checking Dimensions of Data . 29Getting Each Attribute’s Data Type . 29Statistical Summary of Data . 30Reviewing Class Distribution . 31Reviewing Correlation between Attributes . 32Reviewing Skew of Attribute Distribution . 336.Machine Learning with Python – Understanding Data with Visualization . 35Introduction . 35Univariate Plots: Understanding Attributes Independently . 35Density Plots . 37Box and Whisker Plots . 38Multivariate Plots: Interaction Among Multiple Variables . 39Correlation Matrix Plot . 39Scatter Matrix Plot . 417.Machine Learning with Python – Preparing Data . 43Introduction . 43Why Data Pre-processing? . 43Data Pre-processing Techniques . 43Normalization . 44Types of Normalization. 45Binarization. 46Standardization . 48Data Labeling . 49iv

Machine Learning with PythonWhat is Label Encoding? . 498.Machine Learning with Python – Data Feature Selection . 51Importance of Data Feature Selection . 51Feature Selection Techniques . 51Recursive Feature Elimination . 53Principal Component Analysis (PCA) . 54Feature Importance . 55MACHINE LEARNING ALGORITHMS – CLASSIFICATION . 569.Classification – Introduction . 57Introduction to Classification . 57Types of Learners in Classification . 57Building a Classifier in Python . 57Classification Evaluation Metrics . 61Confusion Matrix . 61Various ML Classification Algorithms . 63Applications . 6310. Classification Algorithms – Logistic Regression . 64Introduction to Logistic Regression . 64Types of Logistic Regression . 64Logistic Regression Assumptions . 64Binary Logistic Regression model . 65Implementation in Python. 66Multinomial Logistic Regression Model . 69Implementation in Python. 6911. Classification Algorithms – Support Vector Machine (SVM) . 71Introduction to SVM . 71Working of SVM. 71v

Machine Learning with PythonImplementing SVM in Python . 72SVM Kernels. 76Pros and Cons of SVM Classifiers . 7912. Classification Algorithms – Decision Tree . 80Introduction to Decision Tree . 80Implementing Decision Tree Algorithm . 81Building a Tree . 81Implementation in Python. 8213. Classification Algorithms - Naïve Bayes . 86Introduction to Naïve Bayes Algorithm . 86Building model using Naïve Bayes in Python . 86Pros & Cons . 88Applications of Naïve Bayes classification . 8914. Classification Algorithms – Random Forest . 90Introduction . 90Working of Random Forest Algorithm. 90Implementation in Python. 91Pros and Cons of Random Forest . 93MACHINE LEARNING ALGORITHMS - REGRESSION. 9515. Regression Algorithms – Overview. 96Introduction to Regression . 96Types of Regression Models . 97Building a Regressor in Python . 97Types of ML Regression Algorithms . 100Applications . 10016. Regression Algorithms – Linear Regression . 101Introduction to Linear Regression . 101vi

Machine Learning with PythonTypes of Linear Regression . 102Multiple Linear Regression (MLR) . 106Python Implementation . 107Assumptions . 108MACHINE LEARNING ALGORITHMS – CLUSTERING . 11017. Clustering Algorithms - Overview. 111Introduction to Clustering . 111Cluster Formation Methods . 111Measuring Clustering Performance . 112Silhouette Analysis . 112Analysis of Silhouette Score . 1

machine learning. The examples can be the domains of speech recognition, cognitive tasks etc. Machine Learning Model Before discussing the machine learning model, we must need to understand the following formal definition of ML given by professor Mitchell: “A computer program is said to learn from experience E with respect to some class of

Related Documents:

Python 2 versus Python 3 - the great debate Installing Python Setting up the Python interpreter About virtualenv Your first virtual environment Your friend, the console How you can run a Python program Running Python scripts Running the Python interactive shell Running Python as a service Running Python as a GUI application How is Python code .

Python Programming for the Absolute Beginner Second Edition. CONTENTS CHAPTER 1 GETTING STARTED: THE GAME OVER PROGRAM 1 Examining the Game Over Program 2 Introducing Python 3 Python Is Easy to Use 3 Python Is Powerful 3 Python Is Object Oriented 4 Python Is a "Glue" Language 4 Python Runs Everywhere 4 Python Has a Strong Community 4 Python Is Free and Open Source 5 Setting Up Python on .

Python is readable 5 Python is complete—"batteries included" 6 Python is cross-platform 6 Python is free 6 1.3 What Python doesn't do as well 7 Python is not the fastest language 7 Python doesn't have the most libraries 8 Python doesn't check variable types at compile time 8 1.4 Why learn Python 3? 8 1.5 Summary 9

site "Python 2.x is legacy, Python 3.x is the present and future of the language". In addition, "Python 3 eliminates many quirks that can unnecessarily trip up beginning programmers". However, note that Python 2 is currently still rather widely used. Python 2 and 3 are about 90% similar. Hence if you learn Python 3, you will likely

There are currently two versions of Python in use; Python 2 and Python 3. Python 3 is not backward compatible with Python 2. A lot of the imported modules were only available in Python 2 for quite some time, leading to a slow adoption of Python 3. However, this not really an issue anymore. Support for Python 2 will end in 2020.

A Python Book A Python Book: Beginning Python, Advanced Python, and Python Exercises Author: Dave Kuhlman Contact: dkuhlman@davekuhlman.org

Mike Driscoll has been programming with Python for more than a decade. He has been writing about Python on his blog, The Mouse vs. The Python, for many years. Mike is the author of several Python books including Python 101, Python Interviews, and ReportLab: PDF Processing with Python. You can find Mike on Twitter or GitHub via his handle .

Launch Eclipse Install Python plug-in for Eclipse Add a Python Interpreter Create a Python Project Create a Python Program Run a Python Program Debug a Python Program 0 Introduction This tutorial is for students who want to develop Python projects using Eclipse. E