Welcome to the Zero to Mastery Machine Learning GitHub Repository!
This repository contains all the code, notebooks, and materials related to the Zero to Mastery Machine Learning Course on Udemy and zerotomastery.io. This course covers various topics, including the 6-step machine learning modelling framework, tools for machine learning and data science, end-to-end structured data projects, neural networks, deep learning, transfer learning with TensorFlow 2.0, and communicating and sharing your work.
🎥 Watch the first 10 hours of the course on YouTube 📚 Read the materials of the course in a beautiful online book 🤔 Found something wrong with the code? Leave an issue ❓ Got a question? Post a discussion
- Section 1: Getting your mind and computer ready for machine learning (concepts, computer setup)
- Section 2: Tools for machine learning and data science (pandas, NumPy, Matplotlib, Scikit-Learn)
- Section 3: End-to-end structured data projects (classification and regression)
- Section 4: Neural networks, deep learning and transfer learning with TensorFlow 2.0
- Section 5: Communicating and sharing your work
This repository will contain my progress through the Zero to Mastery Machine Learning Course. It will include completed notebooks, code snippets, and any additional notes or resources I find helpful. By organizing my progress in this repository, I aim to reinforce my learning and create a valuable resource for myself and others.
Contributions are welcome! If you find any issues, have suggestions, or would like to add additional resources, feel free to submit a pull request.
Happy learning! 🚀
In this section, we were introduced to the basics of the Zero to Mastery Machine Learning course and what we will learn throughout the course. We also learned about the different types of machine learning, including supervised, unsupervised, and reinforcement learning, and the differences between regression and classification problems.
Additionally, we discussed the easy and difficult topics in machine learning. Easy topics include linear regression, logistic regression, and decision trees, while difficult topics include deep learning, natural language processing, and reinforcement learning.
Understand the basics of the Zero to Mastery Machine Learning course Learn about the different types of machine learning Understand the differences between regression and classification problems Identify easy and difficult topics in machine learning
In this section, we learned about the basics of the Zero to Mastery Machine Learning course and what we will learn throughout the course. We explored the different types of machine learning and the differences between regression and classification problems. We also identified easy and difficult topics in machine learning.
In the next section, we will dive deeper into the tools and techniques used in machine learning and data science. Stay tuned!
Note: This README file is a brief summary of what we learned in Day 1 Section 1 of the Zero to Mastery Machine Learning course. It is not a comprehensive guide, but rather a starting point for further exploration and learning.
Zero to Mastery Machine Learning Course
Easy and Difficult Topics in Machine Learning
Before we get started, let's do a quick exercise that will take less than 3 minutes:
-
Join our Private Online Classroom: CLICK HERE TO JOIN NOW
-
Once inside, go to the
#introductions
channel and share who you are, where you are from, and why you chose to do this course. -
Go to the
#accountability-buddies
and find a buddy who is starting a ZTM course today just like you (doesn't have to be the same course)! You will be keeping each other accountable throughout the course and motivating each other to finish. Who knows, maybe you will find life long friends/coworkers this way. -
Check out the
#general
or your course specific channel to meet others in your class. We will be announcing class hangouts and instructor meetups/livestreams in there. Some of the channels available for you to join are:#machinelearning-ai
- For all questions related to Machine Learning, Data Science, and AI#python
- For all questions python#alumni
- Ask graduates of this course questions#womenintech
- For the female coders out there#job-hunting
- Anything related to finding a job as a developer
...and many many more!!
OPTIONAL: A fellow ZTM student, Matt, has made a video walkthrough for you of the community here if you want to watch and take a deep dive as to all the things that happen in the community every month. Watch the video here
We are constantly adding new videos and updating this course, announcing new community events, and creating course cheatsheets/resources. To stay up to date with all the latest changes to the course and new videos, keep an eye out on the #announcements
channel in our Discord community. Anything important will be announced in there (you can scroll to see past announcements).
You can also follow us on twitter where we keep you updated about industry news, upcoming courses, and random thoughts on life: @andreineagoie or @mrdbourke
As you start the course, Udemy will have a popup that will ask you to leave a review ⭐️⭐️⭐️⭐️⭐️
of the course. Yes, it can get a little annoying (it's a Udemy system and not something we have control over) but please leave an honest review (even if you just started the course) as it really helps us out and allows more people to discover this course in this massively competitive marketplace. It would truly mean a lot 😊
.
Thank you and welcome to ZTM!
Hey there machine learner!
The journey of learning machine learning can be a tough one sometimes. But not to worry, the ZTM community is here to help.
If you have a question about any of the code or videos in the course, please feel free to post them in the course Discord (https://community.zerotomastery.io/).
Otherwise, you can search/post on the ZTM Machine Learning and Data Science course GitHub Discussions page: https://github.com/mrdbourke/zero-to-mastery-ml/discussions
You can see an example of how to ask a question here: mrdbourke/zero-to-mastery-ml#48
Questions on GitHub Discussions are far more likely to get answered than questions on Udemy.
Why?
- We believe it’s better to have all the code + materials + QA in one place. That way updates can be posted if needed.
- Plus, there’s plenty of people on GitHub who are willing to help out! (if you see a question you think you can answer, feel free to help someone)
If you find any issues with the course code, please post an issue on the course GitHub issues: https://github.com/mrdbourke/zero-to-mastery-ml/issues
Happy Machine Learning!
- Daniel (@mrdbourke on Discord)
This repository contains the code and exercises for sections 7-12 of the Zero to Mastery Machine Learning course on Udemy. In this section, we cover the following topics:
- What is Machine Learning? (7 minutes)
- AI/Machine Learning/Data Science (5 minutes)
- ZTM Resources (4 minutes)
- Exercise: Machine Learning Playground (6 minutes)
- How Did We Get Here? (6 minutes)
- Exercise: YouTube Recommendation Engine (4 minutes)
- Types of Machine Learning (resources)
Here are some resources related to the topics covered in this section:
- LinkedIn Group: Machine Learning, Data Science, and AI
- ZeroToMastery YouTube Channel
- Zero to Mastery Website
- Teachable machine
In this exercise, we build a simple YouTube recommendation engine using Python and the YouTube Data API. You can find the code for this exercise in the youtube_recommendation_engine
directory.
To get started, make sure you have Python and the required libraries installed. Then, follow these steps:
- Create a new project on the Google Cloud Console and enable the YouTube Data API.
- Create a new file called
credentials.json
in theyoutube_recommendation_engine
directory with your API credentials. - Run the
main.py
script to see the recommendation engine in action.
If you encounter any issues or have questions, please post them in the course Discord or on the ZTM Machine Learning and Data Science course GitHub Discussions page.
If you have any questions about the code or exercises in this section, please feel free to post them in the course Discord or on the ZTM Machine Learning and Data Science course GitHub Discussions page.
You can also check out the GitHub Discussions page for answers to common questions and to ask your own.
Happy learning!
Every month in the community, we will have coding challenges for you to participate in, monthly industry blogs and other top free resources emailed to you. We also have annual events like Advent of Code🎄, Hacktoberfest 👾, and Frosty February Hackathon☃️, plus some giveaways 🎁 as well.
Make sure you have your email settings on Udemy to allow this, as every month we will be emailing you a community update email where we list all of the new challenges, free resources, videos and giveaways.
Some students have mentioned they do not receive these emails and it's mainly because of their Udemy notification settings. To ensure you receive the community update emails, follow these steps:
- Go to your Udemy profile icon and click on "Account".
- Click on "Notification Settings".
- Make sure you have these two boxes checked:
- "Monthly updates about courses you're enrolled in"
- "Announcements about new courses, promotions and exclusive opportunities"
Here's an image to help guide you:
Happy learning!
This repository contains the code and exercises for the Zero to Mastery Machine Learning course on Udemy. The course is divided into several sections, each covering a different topic in machine learning. Here is a brief overview of the sections:
- Section Overview (3 minutes) An overview of the topics covered in this section.
- Introducing Our Framework (3 minutes) An introduction to the 6-step machine learning framework used in this course.
- 6 Step Machine Learning Framework (5 minutes) A detailed explanation of the 6-step machine learning framework.
- Types of Machine Learning Problems (11 minutes) An overview of the different types of machine learning problems, including regression, classification, and clustering.
- Types of Data (5 minutes) An overview of the different types of data, including numerical, categorical, and text data.
- Types of Evaluation (4 minutes) An overview of the different types of evaluation metrics, including accuracy, precision, recall, and F1 score.
- Features In Data (5 minutes) An explanation of features in data and how to extract them.
- Modelling - Splitting Data (6 minutes) An explanation of how to split data for training and testing machine learning models.
- Modelling - Picking the Model (5 minutes) An explanation of how to pick the right machine learning model for your problem.
- Modelling - Tuning (3 minutes) An explanation of how to tune machine learning models for better performance.
- Modelling - Comparison (10 minutes) A comparison of different machine learning models and their performance.
Each section includes exercises to help you practice the concepts covered. Make sure to complete the exercises to solidify your understanding of the material.
In addition to the course videos and exercises, there are also resources available to help you learn:
- LinkedIn Group: Machine Learning, Data Science, and AI
- ZeroToMastery YouTube Channel
- Zero to Mastery Website
If you have any questions about the course or need help with the exercises, please post them in the course Discord or on the ZTM Machine Learning and Data Science course GitHub Discussions page.
Happy learning!
Before we get into the experimentation side of things, it's worth having a little reminder of overfitting and underfitting are.
All experiments should be conducted on different portions of your data.
- Training data set: Use this set for model training, 70-80% of your data is the standard.
- Validation/development data set: Use this set for model hyperparameter tuning and experimentation evaluation, 10-15% of your data is the standard.
- Test data set: Use this set for model testing and comparison, 10-15% of your data is the standard.
These amounts can fluctuate slightly, depending on your problem and the data you have.
- Poor performance on training data means the model hasn’t learned properly and is underfitting. Try a different model, improve the existing one through hyperparameter tuning or collect more data.
- Great performance on the training data but poor performance on test data means your model doesn’t generalize well. Your model may be overfitting the training data. Try using a simpler model or making sure your the test data is of the same style your model is training on.
- Another form of overfitting can come in the form of better performance on test data than training data. This may mean your testing data is leaking into your training data (incorrect data splits) or you've spent too much time optimizing your model for the test set data. Ensure your training and test datasets are kept separate at all times and avoid optimizing a model's performance on the test set (use the training and validation sets for model improvement).
- Poor performance once deployed (in the real world) means there’s a difference in what you trained and tested your model on and what is actually happening. Ensure the data you're using during experimentation matches up with the data you're using in production.
Massive effort getting through the first section! There was a lot to go through and if you're thinking, "wow this is too much...", don't worry, you're not alone. Machine learning is broad and learning a new skill takes time.
One place you might want to check out for some auxiliary learning whilst you go through the rest of this course is the Elements of AI website.
It's got some great introductory explanations of many of the concepts involved in machine learning, data science and artificial intelligence.
Of course, going through the Elements of AI material is completely optional. But if you need a break from coding (we'll be doing plenty of it), remember it's always there.
Now you've had an introduction to machine learning, let's get your computer set up for it!
Python Monthly: Every month, I accumulate all of the best resources and articles, as well as free resources around the web for Python Developers. If you want to stay up to date with the industry and make sure you don't miss any important news, you can check out the monthly newsletter here. It's completely free every month!
Machine Learning Monthly: Written by Daniel, this newsletter covers the latest news and updates in the field of machine learning. You can read past issues here.
Web Developer Monthly: If you're interested in web development, check out this newsletter for the latest news and updates in the field. You can read past issues here.
If you are looking to improve your LinkedIn profile and have others endorse your skills, we have a private ZTM LinkedIn group here. LinkedIn allows you to have recruiters message you with lots of job opportunities. You can join the group by clicking on "LinkedIn Group" and then go ahead and endorse some of the member's skills (other people will do the same for you as they join).
If you have any questions, reach out in our private Discord chat community in the #job-hunting
channel!
UPDATE!!! Zero to Mastery is officially a recognized school! What does this mean for you? It means that you can add it as an educational institution on LinkedIn as part of your profile to wow those employers (as your education history). Check it out here. To add it to your profile:
- Go to your personal LinkedIn profile
- Scroll down to the
Education
section - Click the
+
- Type in
Zero To Mastery Academy
Python is a high-level, interpreted programming language known for its readability and simplicity. It was created by Guido van Rossum and first released in 1991. Python's syntax is designed to be easy to read and write, with a focus on simplicity and readability.
Some key features of Python include:
- Easy-to-read syntax: Python uses indentation to define code blocks, making the code easier to read and understand.
- Extensive standard library: Python comes with a large standard library, which includes modules for handling various tasks like file I/O, regular expressions, and web services.
- Cross-platform compatibility: Python is available on multiple platforms, including Windows, macOS, and Linux.
- Strong community support: Python has a large and active community, which contributes to its extensive ecosystem of libraries and frameworks.
Here's a simple example of Python code:
print("Hello, World!")
Hello, World!
```To run this code, you can save it in a file with a .py
extension and then execute the file using a Python interpreter.
For more information and resources on learning Python, you can visit the official Python website at https://www.python.org/.
Also refer to practpython1.py file for reference
Throughout the course, we will have many exercises to help you learn. Moving forward, these exercises will be attached to each video (if it has an exercise) which can be accessed in your Udemy video player under "resources". To get you comfortable using this feature, and the online Repl.it we are going to use, you can see the exercise for this lesson attached:
https://replit.com/@aneagoie/Operator-Precedence
Good luck and see you in the next video!
The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order:
- abs()
- aiter()
- all()
- anext()
- any()
- ascii()
- bin()
- bool()
- breakpoint()
- bytearray()
- bytes()
- callable()
- chr()
- classmethod()
- compile()
- complex()
- delattr()
- dict()
- dir()
- divmod()
- eval()
- exec()
- filter()
- float()
- format()
- frozenset()
- getattr()
- globals()
- hasattr()
- hash()
- help()
- hex()
- id()
- input()
- int()
- isinstance()
- issubclass()
- iter()
- len()
- list()
- locals()
- map()
- max()
- memoryview()
- min()
- next()
- object()
- oct()
- open()
- ord()
- pow()
- print()
- property()
- range()
- repr()
- reversed()
- round()
- set()
- setattr()
- slice()
- sorted()
- staticmethod()
- str()
- sum()
- super()
- tuple()
- type()
- vars()
- zip()
- import()
Python has a set of built-in methods that you can use on lists/arrays:
Method | Description |
---|---|
append() | Adds an element at the end of the list |
clear() | Removes all the elements from the list |
copy() | Returns a copy of the list |
count() | Returns the number of elements with the specified value |
extend() | Add the elements of a list (or any iterable), to the end of the current list |
index() | Returns the index of the first element with the specified value |
insert() | Adds an element at the specified position |
pop() | Removes the element at the specified position |
remove() | Removes the first item with the specified value |
reverse() | Reverses the order of the list |
sort() | Sorts the list |
Method | Description |
---|---|
clear() | Removes all the elements from the dictionary |
copy() | Returns a copy of the dictionary |
fromkeys() | Returns a dictionary with the specified keys and value |
get() | Returns the value of the specified key |
items() | Returns a list containing a tuple for each key value pair |
keys() | Returns a list containing the dictionary's keys |
pop() | Removes the element with the specified key |
popitem() | Removes the last inserted key-value pair |
setdefault() | Returns the value of the specified key. If the key does not exist: insert the key, with the specified value |
update() | Updates the dictionary with the specified key-value pairs |
values() | Returns a list of all the values in the dictionary |
Method | Description |
---|---|
count() | Returns the number of times a specified value occurs in a tuple |
index() | Searches the tuple for a specified value and returns the position of where it was found |
Method | Description |
---|---|
add() | Adds an element to the set |
clear() | Removes all the elements from the set |
copy() | Returns a copy of the set |
difference() | Returns a set containing the difference between two or more sets |
difference_update() | Removes the items in this set that are also included in another, specified set |
discard() | Remove the specified item |
intersection() | Returns a set, that is the intersection of two or more sets |
intersection_update() | Removes the items in this set that are not present in other, specified set(s) |
isdisjoint() | Returns whether two sets have a intersection or not |
issubset() | Returns whether another set contains this set or not |
issuperset() | Returns whether this set contains another set or not |
pop() | Removes an element from the set |
remove() | Removes the specified element |
symmetric_difference() | Returns a set with the symmetric differences of two sets |
symmetric_difference_update() | inserts the symmetric differences from this set and another |
union() | Return a set containing the union of sets |
update() | Update the set with another set, or any other iterable |
Welcome to the Python course! In this course, you will learn the fundamentals of Python programming, starting from basic concepts like variables, data types, and control flow, and moving on to more advanced topics like functions, modules, and packages.
Here's a brief overview of the topics covered in this course:
-
Control Flow
- Conditional Logic
- Indentation in Python
- Truthy vs Falsey
- Ternary Operator
- Short Circuiting
- Logical Operators
- Exercise: Logical Operators
- is vs ==
- Exercise: Find Duplicates
-
Loops
- For Loops
- Iterables
- Exercise: Tricky Counter
- While Loops
- While Loops 2
- break, continue, pass
-
Data Structures
- Tuples
- Sets
- Set Methods
- Dictionaries
- Dictionary Methods
- Exercise: Tesla
-
Functions
- Functions
- Parameters and Arguments
- Default Parameters and Keyword Arguments
- return
- Exercise: Functions
- *args and **kwargs
- Scope
- Scope Rules
- Global Keyword
- nonlocal Keyword
- Why Do We Need Scope?
- Pure Functions
-
Comprehensions
- List Comprehensions
- Set Comprehensions
- Exercise: Comprehensions
-
Modules and Packages
- Modules in Python
- Packages in Python
- Different Ways To Import
-
Testing
- Python Exam: Testing Your Understanding
-
Best Practices
- Clean Code
- Docstrings
- Pure Functions
This course includes various exercises and examples to help you understand the concepts better. The course also includes a final Python exam to test your understanding of the topics covered.
Happy learning!
Welcome to the Tesla Self-Driving Car Exercise repository! In this exercise, you will find a problem provided by Tesla that needs to be solved. You've just been employed by Tesla, and your task is to tackle this problem related to their self-driving car technology.
You can find the problem statement and the codebase to solve it in the following link: Tesla Self-Driving Car Problem
The solution to the problem can be found within this repository. Make sure to explore the code and understand the approach used to solve the problem.
To get started with this exercise, follow these steps:
- Clone this repository to your local machine using
git clone
. - Navigate to the cloned directory.
- Open the provided link to the problem statement to understand the requirements.
- Explore the code provided to solve the problem.
- Implement any necessary changes or enhancements based on the problem requirements.
Once you've implemented your solution, you can run the code to see the results. Make sure to test it thoroughly to ensure it meets the expected behavior outlined in the problem statement.
If you have any suggestions, improvements, or bug fixes, feel free to contribute to this repository. You can fork the repository, make your changes, and submit a pull request. Your contributions are highly appreciated!
This exercise is provided under the MIT License. Feel free to use, modify, and distribute the code for educational or personal purposes.
Special thanks to Tesla for providing this exercise and allowing us to work on real-world problems in the field of self-driving cars.
Happy coding! If you have any questions or concerns, feel free to reach out. Let's make self-driving cars safer and more efficient together! 🚗💨
This is a course on Python programming. It covers the basics of Python and how to use it for data science and machine learning.
Before you begin, ensure you have the following:
- A computer with internet access
- The latest version of Python installed
- A text editor or IDE for writing Python code
To get started with the course, follow these steps:
- Download the course materials from the course website.
- Install Python on your computer if you haven't already.
- Open the course materials in your text editor or IDE.
- Follow the instructions in the course materials to complete the exercises.
The course materials include the following:
- Video lectures
- Code examples
- Exercises
To use the course materials, follow these steps:
- Watch the video lectures to learn the concepts covered in the course.
- Review the code examples to see how the concepts are implemented in Python.
- Complete the exercises to practice your skills and reinforce your learning.
If you would like to contribute to the course materials, please submit a pull request.
The course materials are licensed under the MIT License.
If you have any questions or feedback, please contact us at [email protected].
This section covers how to set up your environment for Python programming and how to use Jupyter Notebook for data science and machine learning projects.
In this section, you will learn:
- How to install and use Conda, a package and environment management system for Python
- How to set up your environment for Mac, Windows, or Linux
- How to share your Conda environment with others
- How to use Jupyter Notebook for data science and machine learning projects
In this video, we introduce the tools you will be using in this section, including Conda and Jupyter Notebook.
Conda is a package and environment management system for Python. It allows you to create separate environments for your Python projects, which helps to prevent conflicts between packages and dependencies.
In this video, we show you how to create and manage Conda environments. We also cover how to install packages using Conda.
In this video, we show you how to set up your environment for Mac using Conda. We cover how to install Conda, create a new environment, and install packages.
In this video, we continue with the Mac environment setup. We cover how to activate and deactivate environments, and how to use pip to install packages.
In this video, we show you how to set up your environment for Windows using Conda. We cover how to install Conda, create a new environment, and install packages.
In this video, we continue with the Windows environment setup. We cover how to activate and deactivate environments, and how to use pip to install packages.
In this video, we show you how to set up your environment for Linux using Conda. We cover how to install Conda, create a new environment, and install packages.
In this video, we show you how to share your Conda environment with others. We cover how to export and import environments, and how to create an environment.yml file.
In this video, we give you a tour of Jupyter Notebook. We cover how to create and open notebooks, how to run cells, and how to use Markdown.
In this video, we continue with the Jupyter Notebook walkthrough. We cover how to use Magic commands, how to import modules, and how to use widgets.
In this video, we continue with the Jupyter Notebook walkthrough. We cover how to use version control, how to use the terminal, and how to share notebooks.
In this section, you learned how to set up your environment for Python programming and how to use Jupyter Notebook for data science and machine learning projects.
There may come a time where you want to share the contents of your Cond environment with others. could be to share a project work with a colleague or with someone else whos trying to set up their system to have to the same tools as yours.
There are two ways to your Conda environment
- Share your entire project folder (including the environment folder containing all of your Conda packages).
- Share a .yml (pronounced YAM-L) file of your Conda environment.
The benefit of sharing the entire project folder is that it's a very simple setup. Simply share the folder, activate the environment, and run the code. However, an environment folder can be quite a large file to share.
A .yml file is a text file with instructions to tell Conda how to set up an environment. To export your Conda environment as a .yml file, use the following command:
This section covers how to use the Pandas library in Python for data manipulation.
In this section, you will learn:
- How to download and use the Pandas library
- How to work with Series, DataFrames, and CSV files
- How to describe and manipulate data using Pandas
- How to download data from URLs
- How to complete the Pandas Practice assignment
To download the workbooks and assignments for this section, follow the instructions in the previous section on downloading course materials.
In this video, we introduce the Pandas library and show you how to download and install it.
In this video, we show you how to work with Series, DataFrames, and CSV files using Pandas.
In this video, we show you how to download data from URLs using Pandas.
In this video, we show you how to describe data using Pandas.
Pandas provides a convenient way to import CSV files directly from a URL. This is useful if you don't have the data downloaded to your computer or in the same directory as your notebook.
To import a CSV file from a URL, you can use the read_csv()
function and pass the URL as the first argument. For example, to import the heart-disease.csv
file from the course GitHub repo, you can use the following code:
import pandas as pd
heart_disease = pd.read_csv("https://raw.githubusercontent.com/mrdbourke/zero-to-mastery-ml/master/data/heart-disease.csv")
Note that if you're using a link from GitHub, make sure it's in the "raw" format. You can do this by clicking the "Raw" button on the GitHub page for the file.
Importing data from URLs can be a powerful tool for data analysis, as it allows you to access data from various sources without having to download and manage the files yourself. However, be aware that importing data from URLs can be slower than importing from local files, and may also consume more bandwidth.