This repository contains the materials for D-Lab’s Python Machine Learning Fundamentals workshop. Prior experience with Python Fundamentals is assumed.
In this workshop, we provide an introduction to machine learning in Python. First, we'll cover some machine learning basics, including its foundational principles, types of machine learning algorithms, how to fit models, and how to evaluate them. Then, we'll explore several machine learning tasks, includes classification, regression, and clustering. We'll demonstrate how to perform these tasks using scitkit-learn
, the main package used for machine learning in Python. Finally, we'll go through an automatic model selection tool called TPOT
.
Basic familiarity with Python is assumed. If you are not comfortable with the material in Python Fundamentals, we recommend attending that workshop first.
Anaconda is a useful package management software that allows you to run Python and Jupyter notebooks very easily. Installing Anaconda is the easiest way to make sure you have all the necessary software to run the materials for this workshop. Complete the following steps:
-
Download and install Anaconda (Python 3.9 distribution). Click "Download" and then click 64-bit "Graphical Installer" for your current operating system.
-
Download the Python-Machine-Learning-Fundamentals workshop materials:
- Click the green "Code" button in the top right of the repository information.
- Click "Download Zip".
- Extract this file to a folder on your computer where you can easily access it (we recommend Desktop).
- Optional: if you're familiar with
git
, you can instead clone this repository by opening a terminal and enteringgit@github.com:dlab-berkeley/Python-Machine-Learning-Fundamentals.git
.
Now that you have all the required software and materials, you need to run the code:
-
Open the Anaconda Navigator application. You should see the green snake logo appear on your screen. Note that this can take a few minutes to load up the first time.
-
Click the "Launch" button under "Jupyter Notebooks" and navigate through your file system to the
Python-Machine-Learning-Fundamentals
folder you downloaded above. -
Click
00_introduction.md
to begin. -
Press Shift + Enter (or Ctrl + Enter) to run a cell.
If you have a Berkeley CalNet ID, you can run these lessons on UC Berkeley's DataHub by clicking this button:
By using this link, you can save your work and come back to it at any time. When you want to return to your saved work, just go straight to DataHub https://datahub.berkeley.edu, sign in, and you click on the Python-Machine-Learning-Fundamentals
folder.
If you don't have a Berkeley CalNet ID, you can still run these lessons in the cloud, by clicking this button:
By using this button, you cannot save your work unfortunately.
Check out the following resources to learn more about machine learning:
- scikit-learn Tutorials.
- Stanford's CS229 course materials.
- IBM's free course of machine learning in Python.
- The Elements of AI course.
D-Lab works with Berkeley faculty, research staff, and students to advance data-intensive social science and humanities research. Our goal at D-Lab is to provide practical training, staff support, resources, and space to enable you to use R for your own research applications. Our services cater to all skill levels and no programming, statistical, or computer science backgrounds are necessary. We offer these services in the form of workshops, one-to-one consulting, and working groups that cover a variety of research topics, digital tools, and programming languages.
Visit the D-Lab homepage to learn more about us. You can view our calendar for upcoming events, learn about how to utilize our consulting and data services, and check out upcoming workshops.
Here are other Python workshops offered by the D-Lab:
- Computational Text Analysis in Python
- Introduction to Machine Learning in Python
- Introduction to Artificial Neural Networks in Python
- Fairness and Bias in Machine Learning
- Samy Abdel-Ghaffar
- Sean Perez
- Christopher Hench
- Pratik Sachdeva
- George McIntire
- Sam Temlock
- Emily Grabowski