Python and Machine Learning Foundation
0.0 (0 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1 student enrolled

Python and Machine Learning Foundation

With an interesting mix of theory and demos, learn the programming and machine learning concepts of Python
0.0 (0 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
1 student enrolled
Created by Packt Publishing
Last updated 3/2019
English
English [Auto]
Current price: $139.99 Original price: $199.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 13 hours on-demand video
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Learn to use control statements
  • Understand how to use loops to iterate over objects or data for accurate results
  • Write encapsulated and succinct Python functions
  • Build Python classes using object-oriented programming
  • Manipulate files on the file system (open, read, write, and delete)
  • Gain insight into the difference between supervised and unsupervised models
  • Study popular algorithms, such as K-means, Gaussian Mixture, Birch, Naïve-Bayes, Decision Tree, and SVM
  • Visualize errors in various models using Matplotlib
Course content
Expand all 115 lectures 12:57:04
+ Python Fundamentals
75 lectures 09:38:43

Python Fundamentals takes you from zero experience to a complete understanding of key concepts, edge cases, and using Python for real-world application development. You'll move progressively from the basics to working with larger complex applications. After completing this course, you'll have the skills you need to dive into an existing application or start your own project.

Preview 05:29

In this lesson, we will write our first Python program and play with the interpreter through the use of Python interactive shell. We will also take a look at the different ways of running a Python program. Let us cover the following topics:

  • An introduction to Python

  • Setting up and experiencing Python

  • Naming Identifiers

  • Python Syntax

Preview 01:37

Now, let us look at different features of Python, its versions, and glance through a simple Python code.

Preview 07:30

Before we begin, let's ensure that we have Python installed on our machine. We will learn to set it up and closely experience the Python interactive shell.

Setting up and Experiencing Python
08:01

Let us now write and run a simple 'Hello World' program. We'll also cover writing dynamic scripts in Python.

Writing and Running Programs in Python
06:05

There are different rules for naming identifiers. Let us learn about them in detail with some reserved words and practical examples. We will also get well-versed with the naming convention to write Python code.

Naming Identifiers
07:09

Let us learn about the syntax of writing Python scripts in detail. In this section, we will cover the following subtopics:

  • Block and Inline comment

  • Docstrings

  • Indentation

Python Syntax
05:33

Let us now summarize our learning from this lesson.

Lesson Summary
00:29
Test Your Knowledge
3 questions

In this lesson, we'll cover variables, values, and user input function.

Lesson Overview
00:57

Let us now look at what are variables, values, and data types.

Variables, Values, and Data Types
14:54

In this section, we will look at how we can take user input from the keyboard, how to write comments, and the importance of indentation while writing Python code.

User Input
10:56

Let us now summarize our learning from this lesson.

Lesson Summary
00:29
Test Your Knowledge
3 questions

In this lesson, we will look at other data types that are supported by Python. Data types classify data, to tell the interpreter how the program intends to utilize that data. Data types define the different operations that can be performed on the data, how the data is stored, and the meaning of the data. Let us cover the following topics:

  • Numerical data

  • Strings

  • Lists

  • Booleans

Lesson Overview
01:06

Now, let us look at different types of numbers—integers, floating point numbers, binary, hexadecimal, and octal numbers—and their representation in Python console.

Numerical Data
11:57

Let us now understand what strings are and what different operations can be performed on a string. We'll also cover indexing of a Python string. This section covers the following subtopics:

  • String definition

  • String Operations

  • Indexing

Strings – Part I
06:06

Now, as you know how strings are indexed, let us look at what more can be done with the indexed strings. This section covers the following subtopics:

  • Slicing

  • Length

String – Part II
08:17

In this section, let us understand strings in more detail by covering the following subtopics:

  • Strings are immutable

  • String interpolation

  • The str.format() method

  • % formatting

String – Part III
10:48

Let us learn the various string methods/functions available in Python along with practical examples.

String Methods/Functions
14:26

This is part one of two regarding lists, which we will be going through in this course. This part will act as an introduction, and will not cover the various methods that list objects have, such as extend(), remove(), pop(), and several others. We will go through the second section on lists in a later lesson.

Lists
12:13

Finally, let us look at Booleans and the different comparison and logical operators available and their use.

Booleans
07:15

Let us now summarize our learning from this lesson.

Lesson Summary
00:40
Test Your Knowledge
11 questions

In this lesson, we are going to build on the knowledge that we have acquired so far to dive deeper into the beautiful language that is Python. We will explore how Python handles control statements—in simple terms, how Python handles decision making, for instance, resulting to True if 2 + 3 = 5. We will also dive deeper into program flow control. In particular, we will look at how we can run code repeatedly or in a loop.

Lesson Overview
01:27

Let us learn the different types of control statement. This section covers the following subtopics:

  • Program flow

  • Control statements

  • The if statements

  • The elif statements

  • The if…elif statements

Control Statements
08:54

In this section, we'll have a look at the while statement. Along with that, we'll also understand how the while statement differs from the if statement.

The while Statement
09:26

In Python, loops (just as in any other language) are a way to execute a specific block of code several times. Let us understand iterables and the for loop in this section.

Loops
05:45

Now, let us understand the functionality of the range function. We’ll also cover how and when to use nested loops.

The range Function and Nesting Loops
13:50

Finally, let us look at how to break out of loops with practical examples of each. The following subtopics will be covered:

  • The break Statement

  • The continue Statement

  • The pass Statement


Breaking Out of Loops
07:49

Let us now summarize our learning from this lesson.

Lesson Summary
00:41
Test Your Knowledge
4 questions

In this lesson, we will build on knowledge by implementing what we have learned in the previous lesson, to build functions in Python.

Lesson Overview
01:27

Functions are an integral part of the Python programming language, and a lot of languages. Let us understand functions in more detail through these subtopics:

  • Functions

  • Built-in functions

  • User-defined functions

  • Calling a function

Functions and Its Types
16:49

In this section, we'll have a look at the local and global variables. We'll also cover defining them through a practical example.

Local and Global Variables
08:29

Most other programming languages (for example, Java and C++) require a special function, called main(), which tells the operating system what code to execute when a program is invoked. This is not necessary for Python, but in this section, you will find that it is a good and logical way to structure a program.

Using main ()
07:27

Python supports several types of arguments, namely:

  • Required arguments

  • Keyword arguments

  • Default arguments

  • A variable number of arguments

Let us understand each one of them in detail.

Function Arguments
12:32

This section explains anonymous functions and demonstrates how to create and use anonymous functions.

Anonymous Functions
15:37

Let us now summarize our learning from this lesson.

Lesson Summary
00:54
Test Your Knowledge
4 questions

In this lesson, we'll delve deep into lists and tuples, right from creating and accessing to describing and implementing various methods with them.

Lesson Overview
00:50

A list is a data structure that holds ordered collections of related data. Python lists, however, are more flexible and powerful than the traditional lists of other languages. Let us understand lists in more detail through this section.

Lists
06:24

The list data type has some built-in methods that can be used with it. Let us understand their functionality.

List Methods
06:07

We'll begin this section with a demonstration on the different list methods that we saw in the previous section. We'll also cover another feature of Python, which is a concise way to create lists—list comprehensions.

List Methods and List Comprehensions
12:21

In this section we'll cover the following subtopics:

  • Tuples and their properties

  • Tuple operations

  • Indexing

  • Slicing

Let us understand each one of them in detail.

Tuples
20:52

This section explains the different tuple methods available in Python.

Tuple Methods
05:17

Let us now summarize our learning from this lesson.

Lesson Summary
00:46
Test Your Knowledge
6 questions

In this lesson, we'll understand the working of dictionaries and sets.

Lesson Overview
01:20

You have already seen lists that hold values that you can access by using indexes. However, what if you wanted to name each value, instead of using an index? For example, suppose that you want to access a list of cake ingredients, but you do not know where in the array it is. In that case, a dictionary would come in handy. Let us understand dictionaries in more detail.

Dictionaries
05:50

Let us now understand the different ways of working with dictionaries such as the various methods in dictionaries and iterating through dictionaries.

Working with Dictionaries – Part I
13:56

This section covers the following subtopics:

  • Dictionary operations

  • Sentence analysers

  • Ordered dictionaries

Working with Dictionaries – Part II
08:44

In this section, we are going to cover sets, which are unique data structures with interesting properties. Let's begin our journey into sets by looking at how to create sets, how to read data from them, and how to remove data from them.

Sets
14:59

Let us now summarize our learning from this lesson.

Lesson Summary
00:27
Test Your Knowledge
6 questions

At the beginning of this course, we mentioned that Python is multi-paradigm, as it supports solving problems in a functional, imperative, procedural, and object-oriented way. In this lesson, we will be diving into object-oriented programming in Python.

Lesson Overview
02:11

Let us now have a look at the following subtopics:

  • A first look at OOP

  • Defining a class and instantiating an object

  • Adding attributes to an object

Classes, Objects and Their Attributes
08:51

In Python, the constructor method for an object is named __init__. As its name suggests, it is called when initializing an object of a class. Let us understand the working on the __init__ method in detail.

The __init__ Method
11:49

In this section, we'll look at class methods in detail.

Methods in Classes
11:29

We'll go through a practical example for the usage of methods in classes through this scenario. We'll first look at the steps needed to perform followed by a demonstration of the solution.

Automated Geometric Calculations Scenario
08:09

We can define attributes at the class level. Class attributes are bound to the class itself and are shared by all instances as opposed to being bound to each instance. Let us understand class attributes through this section.

Class Attributes
10:50

Now, let us test our knowledge of class attributes using this scenario. The scenario is followed by a demonstration of the solution.

Elevator Class Attribute Scenario
14:29

Class methods differ from instance methods in that they are bound to the class itself and not the instance. As such, they don't have access to instance attributes. Additionally, they can be called through the class itself and don't require the creation of an instance of the class. Let us understand class methods through this section.

Class Methods
08:58

This section explains one of the key concepts of OOP—encapsulation. Encapsulation is the bundling of data with the methods that operate on that data. It's used to hide the internal state of an object by bundling together and providing methods that can get and set the object state through an interface. This hiding of the internal state of an object is what we refer to as information hiding.

Encapsulation and Information Hiding
08:14

We discuss another key feature of OOP in this section—inheritance. Inheritance is a mechanism that allows for a class's implementation to be derived from another class's implementation.

Class Inheritance
06:46

In this section we discuss the following subtopics:

  • Overriding methods

  • Multiple inheritance

  • Mixins

Overriding Methods
14:31

Let us now summarize our learning from this lesson.

Lesson Summary
00:42
Test Your Knowledge
4 questions

In the previous lesson, we have covered object-oriented programming in depth. We have covered important OOP concepts such as classes, methods, and inheritance. In this lesson, we will take a look at modules and file operations.

Lesson Overview
01:14

The concept of arranging work into files and folders also applies when programming in Python. You can arrange your code into pieces called modules, which makes it easier to group related functionality together. Let us have a look at how to create and use modules in Python.

Creating and Using Modules
06:22

This section explains the various built-in modules available in Python along with a practical example. It also covers a random generator scenario with a demonstration of the solution.

Built-in Modules
18:28

In this section, we cover packages. A package is a collection of modules. Packages are a good way of separating your modules from other people's modules to avoid name clashes.

Packages
09:36

We'll be looking at various file operation in this section. It covers the following subtopics:

  • The file object

  • The file object methods

  • Reading and writing to files

  • Opening files

File Operations
12:47

A scenario which consists of two parts will be described in this section along with an outline of the algorithm that will be used to solve this scenario.

Top 100 Words Scenario
08:12

This section provides the solution for the first part of the scenario.

Top 100 Words Scenario – Solution Part I
06:41

This section provides the solution for the second part of the scenario.

Top 100 Words Scenario – Solution Part II
12:05

Now that you have a good handle on reading and writing to files, let's talk about how to deal with more structured data in this section. In real-world applications, you will most likely have to read data in a structured format.

Handling Structured Data
13:01

Let us now summarize our learning from this lesson.

Lesson Summary
00:45
Test Your Knowledge
6 questions

By now, you will have probably encountered many errors while coding in Python. This lesson aims to equip you with a better understanding of why errors occur and what to do about them when they do. This helps prevent scenarios where, for example, an error occurs on your application and because it is not handled well, brings the whole application down.

Lesson Overview
01:40

This section explains the difference between errors and exceptions. It also covers the categories of errors—logical and runtime.

Introduction
02:03

Let us take a look at some common error and exception classes in this section and understand what they mean.

Built-In Exceptions
12:34

In this section, we will look at how to handle errors and exceptions.

Handling Errors and Exceptions
14:16

Let us now summarize our learning from this lesson.

Lesson Summary
01:03
Test Your Knowledge
3 questions
+ Machine Learning Fundamentals
40 lectures 03:18:21

Let us begin the course and see the lessons and concepts that will be covered.

Course Overview
02:18

In this section, you will learn how to install and set up the environment. Let us install the following tools:

  • Anaconda Distribution to download Python 3.7 version

  • Datasets from Machine Learning Repository for different exercises

Installation and Setup
04:01

Let us start with Introduction to Scikit-Learn. Let us then look at the Lesson Map which introduces us to the different topics covered in the lesson along with the lesson objectives.

Lesson Overview
00:37

Let us get introduced to Scikit-Learn library where we will learn about its definition, popular and other uses, users, its advantages and disadvantages.

Scikit-Learn
05:25

Let us now look at the data tables, difference between Features and Target matrices followed by learning to load a sample dataset and creating these matrices.

Data Representation
04:24

Let us now understand what is data preprocessing and why is it required. Later, let us learn about messy data with missing values and outliers, and how to deal with it. Further let us learn about dealing with categorical features and the two ways of rescaling the data.

Data Preprocessing
16:44

Let us now learn about the working of Scikit-Learn API, its Estimator, Predictor, and Transformer.

Scikit-Learn API
05:26

Let us now begin with supervised learning with its Classification and Regression tasks, and unsupervised learning with its clustering tasks and algorithms.

Supervised and Unsupervised Learning
05:07

This video summarizes your learning of this lesson.

Lesson Summary
00:28
Test Your Knowledge
10 questions

Let us learn about Unsupervised Learning: Real-Life Applications to demonstrate the uniformity of the scikit-learn API, as well as to explain the stepss taken to solve such a problem. Let us then look at the Lesson Map which introduces us to the different topics covered in the lesson along with the lesson objectives.

Lesson Overview
01:08

Let us study about clustering, its types, basic tools and its functions.

Clustering
05:31

Let us now explore a wholesale customer's dataset, understanding the dataset, and its case study features.

Exploring a Dataset: Wholesale Customers Dataset
03:00

Let us get introduced to data visualization, loading the dataset using Pandas, learning about the important visualization tools, and plot a histogram of one feature from the Noisy Circles dataset.

Data Visualization
04:39

Let us now look at k-means algorithm, understanding the working of the algorithm, learning about the initialization methods, changing the number of clusters, and importing and training the k-means algorithm over a dataset.

k-means Algorithm
08:28

Let us learn about Mean-Shift Algorithm, understanding the working of the algorithm, and finally import and export the Mean-Shift algorithm over a dataset.

Mean-Shift Algorithm
04:15

Let us learn about DBSCAN Algorithms, understanding the working of the algorithm, its parameters, and finally import and export the DBSCAN algorithm over a dataset.

DBSCAN Algorithm
03:25

Let us now learn about evaluating the performance of clusters using available metrics in Scikit-Learn, and with the help of the Silhouette Coefficient Score and Calinski–Harabasz Index.

Evaluating the Performance of Clusters
04:32

This video summarizes your learning of this lesson.

Lesson Summary
00:35
Test Your Knowledge
8 questions

Let us explore the main steps for working on a supervised machine learning problem. Let us then look at the Lesson Map which introduces us to the different topics covered in the lesson along with the lesson objectives.

Lesson Overview
00:53

Let us begin the lesson with model validation and testing where we learn about data partition and its subsets of training, validation, and testing set, and its uses. Let us then learn about the split ratio and perform data partition on a simple dataset. Further, we learn about Cross Validation procedure to partition data and use it to partition the Train Set into a training and a validation set.

Model Validation and Testing
13:34

Let us now look at the evaluation metrics for classification tasks which includes the confusion matrix tables, its values and their explanation. Let us then find out the way in which accuracy level of confusion matrix, precision metric, and recall metric is calculated. We also look at the evaluation metrics for regression tasks and finally, calculate different evaluation metrics over a classification task.

Evaluation Metrics
13:41

We finally look at error analysis, Bayes error, and error analysis methodology. Then, let us understand the conditions affecting the model and finally calculating the error rate over different sets of data.

Error Analysis
11:21

This video summarizes your learning of this lesson.

Lesson Summary
00:33
Test Your Knowledge
9 questions

Let us cover the key steps involved in working with a supervised learning data problem. Let us then look at the Lesson Map which introduces us to the different topics covered in the lesson along with the lesson objectives.

Lesson Overview
01:11

Let us learn to explore the dataset, steps for downloading the dataset, understanding the dataset and the missing values. Further, we learn about the features and steps to preprocess the dataset.

Exploring the Dataset
05:34

Let us study about Naïve Bayes Algorithm, the mathematical process behind the dataset and the algorithm used, and applying it to the dataset.

Naïve Bayes Algorithm
05:18

Let us now learn about Decision Tree Algorithm, the process behind it, and applying it to the dataset.

Decision Tree Algorithm
02:44

Let us dive into Support Vector Machine Algorithm, the process behind the algorithm, and the rule to follow to choose the right hyperplane.

Support Vector Machine Algorithm
04:17

Let us now calculate the evaluation metrics for the three models using the accuracy, precision, and recall metrics in order to compare them.

Error Analysis
06:48

This video summarizes your learning of this lesson.

Lesson Summary
00:52
Test Your Knowledge
10 questions

Let us now focus on introducing ANNs, their different types, and the advantages and disadvantages that they present. Let us then look at the Lesson Map which introduces us to the different topics covered in the lesson along with the lesson objectives.

Lesson Overview
01:13

Let us get introduced to Artificial Neural Networks (ANN), the process behind its working, and an actual methodology to train an ANN. Let us then learn about hyperparameters and the commonly used hyperparameters followed by understanding the applications and limitations of ANNs.

Artificial Neural Networks
15:34

Let us now work on applying an ANN using Scikit-Learn's Multilayer Perceptron and apply it on the Classifier class.

Applying an Artificial Neural Network
03:26

Finally, let us learn about performance analysis using error analysis, fine-tuning the hyperparameters, and model comparison.

Performance Analysis
10:45

This video summarizes your learning of this lesson.

Lesson Summary
00:28
Test Your Knowledge
9 questions

Let us now build a complete machine learning program in this lesson. Let us then look at the Lesson Map which introduces us to the different topics covered in the lesson along with the lesson objectives.

Lesson Overview
00:55

Let us begin with defining a machine learning program and defining its stages of preparation, creation, and interaction. Next, we try to understand the dataset at work.

Program Definition
09:29

Next, let us understand and work on two important actions of saving and loading a dataset so that it can be reused at any moment through different means.

Saving and Loading a Trained Model
05:06

Finally, let us outline the steps involved in interacting with a trained model, and creating a class and channel to interact with trained model.

Interacting with a Trained Model
03:03

This video summarizes your learning of this lesson.

Lesson Summary
01:33
Test Your Knowledge
6 questions
Requirements
  • Prior knowledge of Python isn't required.
Description

This Learning Path takes you from zero experience to a complete understanding of key concepts, edge cases, and using Python for real-world application development. After a brief history of Python and key differences between Python 2 and Python 3, you'll understand how Python has been used in applications such as YouTube and Google App Engine. As you work with the language, you'll learn about control statements, delve into controlling program flow and gradually work on more structured programs via functions.

You'll learn about data structures and study ways to correctly store and represent information. By working through specific examples, you'll learn how Python implements object-oriented programming (OOP) concepts of abstraction, encapsulation of data, inheritance, and polymorphism. You'll be given an overview of how imports, modules, and packages work in Python, how you can handle errors to prevent apps from crashing, as well as file manipulation.

Next, you’ll study the difference between supervised and unsupervised models, as well as the importance of choosing the appropriate algorithm for each dataset. You'll apply unsupervised clustering algorithm over 1990 US Census dataset, to discover patterns and profiles, and explore the process to solve a supervised machine learning problem. You'll learn to implement different supervised algorithms and develop neural network structures using the scikit-learn package.

By the end of this Learning Path, you'll have built up an impressive portfolio of projects and armed yourself with the skills you need to tackle Python projects in the real world.

About the Authors

Sanjin Dedic is a robotics engineer. He has worked for 5 years as a product development engineer and for the past 7 years, he has been teaching digital technologies and systems engineering. He has extensive classroom experience in teaching computational thinking and the foundational skills in platforms such as Scratch, Arduino, Python, Raspberry Pi, and Lego Mindstorms.

Samik Sen is currently working with R on machine learning. He has done his PhD in Theoretical Physics. He has tutored classes for high performance computing postgraduates and lecturer at international conferences. He has experience of using Perl on data, producing plots with gnuplot for visualization and latex to produce reports. He, then, moved to finance/football and online education with videos.

Who this course is for:
  • This Learning Path is great for anyone who wants to start using Python to build anything from simple command-line programs to web applications. It is also designed for developers who are new to the field of machine learning and want to learn how to use the scikit-learn library to develop machine learning algorithms.