Python and Machine Learning Foundation
- 13 hours on-demand video
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- 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
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.
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
Now, let us look at different features of Python, its versions, and glance through a simple Python code.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
- Prior knowledge of Python isn't required.
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.
- 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.