Skip to content

D-Lab's 6 hour introduction to machine learning in Python. Learn how to perform classification, regression, clustering, and do model selection using scikit-learn in Python.

License

Notifications You must be signed in to change notification settings

dlab-berkeley/Python-Machine-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

D-Lab's Python Machine Learning Workshop

Datahub Binder

This repository contains the materials for D-Lab’s Python Machine Learning workshop.

Prerequisites

Prior experience with Python Fundamentals, Python Data Visualization, and Python Data Wrangling is assumed.

Check D-Lab's Learning Pathways to figure out which of our workshops to take!

Workshop Goals

In this workshop, we provide an introduction to machine learning in Python. First, we'll cover some machine learning basics, including its foundational principles. Then, we'll dive into code, understanding how to perform regression, regularization, preprocessing, and classification. There are additional components of the workshop which explore building machine learning pipelines and unsupervised learning. We'll demonstrate how to perform these tasks using scikit-learn, the main package used for machine learning in Python.

This workshop is divided into the following parts:

  1. Part 1: Regression and Regularization. How can we use linear models to predict continuous outputs, and how can we prevent their overfitting?
  2. Part 2: Preprocessing and Classification. What preprocessing steps do we need to take before fitting models? Then, how do we perform classification?
  3. Part 3: Machine Learning Pipeline. We'll walk through a machine learning task, from exploratory data analysis to building an entire machine learning pipeline.

The first two parts are taught as a joint series. Part 3 can be attended on its own, but prior knowledge of Parts 1 and 2 are assumed.

Installation Instructions

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:

  1. Download and install Anaconda (Python 3.9 distribution). Click "Download" and then click 64-bit "Graphical Installer" for your current operating system.

  2. Download the Python-Machine-Learning 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).
  1. Optional: if you're familiar with git, you can instead clone this repository by opening a terminal and entering [email protected]:dlab-berkeley/Python-Machine-Learning.git.

Run the code

Now that you have all the required software and materials, you need to run the code:

  1. 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.

  2. Click the "Launch" button under "Jupyter Notebooks" and navigate through your file system to the Python-Machine-Learning folder you downloaded above.

  3. Click 00_introduction.md to begin.

  4. Press Shift + Enter (or Ctrl + Enter) to run a cell.

Is Python not working on your computer?

If you have a Berkeley CalNet ID, you can run these lessons on UC Berkeley's DataHub by clicking this button:

Datahub

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 folder.

If you don't have a Berkeley CalNet ID, you can still run these lessons in the cloud, by clicking this button:

Binder

By using this button, you cannot save your work unfortunately.

Additional Resources

Check out the following resources to learn more about machine learning:

About the UC Berkeley D-Lab

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.

Other D-Lab Python Workshops

Here are other Python workshops offered by the D-Lab:

Basic competency

Intermediate/advanced copmetency

Contributors

  • Pratik Sachdeva
  • Emily Grabowski
  • George McIntire
  • Sam Temlock
  • Samy Abdel-Ghaffar
  • Sean Perez
  • Christopher Hench

About

D-Lab's 6 hour introduction to machine learning in Python. Learn how to perform classification, regression, clustering, and do model selection using scikit-learn in Python.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published