Deep Learning Prerequisites: Logistic Regression in Python
4.6 (929 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
9,986 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Deep Learning Prerequisites: Logistic Regression in Python to your Wishlist.

Add to Wishlist

Deep Learning Prerequisites: Logistic Regression in Python

Data science techniques for professionals and students - learn the theory behind logistic regression and code in Python
Best Selling
4.6 (929 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
9,986 students enrolled
Last updated 8/2017
English
Curiosity Sale
Current price: $10 Original price: $120 Discount: 92% off
30-Day Money-Back Guarantee
Includes:
  • 4 hours on-demand video
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • program logistic regression from scratch in Python
  • describe how logistic regression is useful in data science
  • derive the error and update rule for logistic regression
  • understand how logistic regression works as an analogy for the biological neuron
  • use logistic regression to solve real-world business problems like predicting user actions from e-commerce data and facial expression recognition
  • understand why regularization is used in machine learning
View Curriculum
Requirements
  • You should know how to take a derivative
  • You should know some basic Python coding
  • Install numpy and matplotlib
Description

This course is a lead-in to deep learning and neural networks - it covers a popular and fundamental technique used in machine learning, data science and statistics: logistic regression. We cover the theory from the ground up: derivation of the solution, and applications to real-world problems. We show you how one might code their own logistic regression module in Python.

This course does not require any external materials. Everything needed (Python, and some Python libraries) can be obtained for free.

This course provides you with many practical examples so that you can really see how deep learning can be used on anything. Throughout the course, we'll do a course project, which will show you how to predict user actions on a website given user data like whether or not that user is on a mobile device, the number of products they viewed, how long they stayed on your site, whether or not they are a returning visitor, and what time of day they visited.

Another project at the end of the course shows you how you can use deep learning for facial expression recognition. Imagine being able to predict someone's emotions just based on a picture!

If you are a programmer and you want to enhance your coding abilities by learning about data science, then this course is for you. If you have a technical or mathematical background, and you want use your skills to make data-driven decisions and optimize your business using scientific principles, then this course is for you.

This course focuses on "how to build and understand", not just "how to use". Anyone can learn to use an API in 15 minutes after reading some documentation. It's not about "remembering facts", it's about "seeing for yourself" via experimentation. It will teach you how to visualize what's happening in the model internally. If you want more than just a superficial look at machine learning models, this course is for you.


NOTES:

All the code for this course can be downloaded from my github: /lazyprogrammer/machine_learning_examples

In the directory: logistic_regression_class

Make sure you always "git pull" so you have the latest version!


HARD PREREQUISITES / KNOWLEDGE YOU ARE ASSUMED TO HAVE:

  • calculus
  • linear algebra
  • probability
  • Python coding: if/else, loops, lists, dicts, sets
  • Numpy coding: matrix and vector operations, loading a CSV file


TIPS (for getting through the course):

  • Watch it at 2x.
  • Take handwritten notes. This will drastically increase your ability to retain the information.
  • Write down the equations. If you don't, I guarantee it will just look like gibberish.
  • Ask lots of questions on the discussion board. The more the better!
  • Realize that most exercises will take you days or weeks to complete.
  • Write code yourself, don't just sit there and look at my code.


USEFUL COURSE ORDERING:

  • (The Numpy Stack in Python)
  • Linear Regression in Python
  • Logistic Regression in Python
  • (Supervised Machine Learning in Python)
  • (Bayesian Machine Learning in Python: A/B Testing)
  • Deep Learning in Python
  • Practical Deep Learning in Theano and TensorFlow
  • (Supervised Machine Learning in Python 2: Ensemble Methods)
  • Convolutional Neural Networks in Python
  • (Easy NLP)
  • (Cluster Analysis and Unsupervised Machine Learning)
  • Unsupervised Deep Learning
  • (Hidden Markov Models)
  • Recurrent Neural Networks in Python
  • Artificial Intelligence: Reinforcement Learning in Python
  • Natural Language Processing with Deep Learning in Python



Who is the target audience?
  • Adult learners who want to get into the field of data science and big data
  • Students who are thinking of pursuing machine learning or data science
  • Students who are interested in pursuing statistics and coding in Python instead of R
  • People who know some machine learning but want to be able to relate it to artificial intelligence
  • People who are interested in bridging the gap between computational neuroscience and machine learning
Students Who Viewed This Course Also Viewed
Curriculum For This Course
43 Lectures
03:52:45
+
Start Here
4 Lectures 20:15

This lecture will outline what will be learned in the course. I explain the importance of knowing the math, and provide short descriptions of each section later covered. Feel free to skip it and jump right into the 3rd video.

Preview 04:02

How to Succeed in this Course
05:28

Difference between supervised and unsupervised learning. Difference between classification and regression. Feel free to skip this one if you already know this.

Preview 01:53

Introduction to the E-Commerce Course Project
08:52

An easy first quiz

Easy first quiz
1 question
+
Basics: What is linear classification? What's the relation to neural networks?
8 Lectures 28:12

I discuss what linear classification is from a general standpoint, without invoking any specifics related to logistic regression. I provide a 2-dimensional binary classification example and go over how we would classify data into 1 of 3 cases: positive class, negative class, and don't know / not sure.

Linear Classification
04:49

In this lecture I discuss a brief history of neural networks, and talk about how the characteristics of the neuron (action potential, signal propagation, inhibitory and excitatory behavior) are modeled in different ways: the Hodgkin Huxley mdoel, the FitzHugh Nagumo model, and the logistic model.

Biological inspiration - the neuron
03:36

I show the feedforward calculation for the output of a logistic unit.

How do we calculate the output of a neuron / logistic classifier? - Theory
04:18

I show how to code the feedforward calculation for the output of a logistic unit in Python and numpy.

How do we calculate the output of a neuron / logistic classifier? - Code
04:30

E-Commerce Course Project: Pre-Processing the Data
05:24

E-Commerce Course Project: Making Predictions
03:00

Feedforward Quiz
01:24

Prediction Section Summary
01:11
+
Solving for the optimal weights
10 Lectures 44:11
Training Section Introduction
01:38

I show how we can solve for the weights in a logistic regression model if we make assumptions about the distributions of the input data (equal variance, Gaussian-distributed).

A closed-form solution to the Bayes classifier
05:59

All these symbols can get confusing so this is a lecture to give a short and simple description of what each letter "stands for". These are important to get right now, because we'll use it for this course and every later course on deep learning and machine learning.

What do all these symbols mean? X, Y, N, D, L, J, P(Y=1|X), etc.
03:37

I show the cross-entropy error formula, and describe why this is used as an appropriate objective function for logistic regression.

The cross-entropy error function - Theory
02:46

I show how to calculate the cross-entropy error of your model in Python and numpy.

The cross-entropy error function - Code
04:53

Visualizing the linear discriminant / Bayes classifier / Gaussian clouds
02:28

I show how to derive the likelihood and log-likelihood of your model and data, and I show how maximizing the likelihood is equivalent to minimizing the cross-entropy.

Maximizing the likelihood
06:34

I explain how gradient descent can be used to solve for the minima of a function, and the algorithm that can be used to iteratively update the logistic weights.

Updating the weights using gradient descent - Theory
06:20

I show how to code weight updates for logistic regression using gradient descent in Python and numpy.

Updating the weights using gradient descent - Code
03:09

E-Commerce Course Project: Training the Logistic Model
06:47
+
Practical concerns
10 Lectures 47:39
Practical Section Introduction
02:45

Interpreting the Weights
04:07

L2 Regularization - Theory
08:38

I show how to apply regularization for logistic regression in Python.

L2 Regularization - Code
01:43

L1 Regularization - Theory
02:53

L1 Regularization - Code
06:13

L1 vs L2 Regularization
03:05

I show how logistic regression can be used to solve the donut problem (where one class is circular and is inside another circular class).

The donut problem
10:01

This lecture describes how to apply logistic regression to the XOR problem by making it a 3-dimensional problem.

The XOR problem
06:12

Practical Section Summary
02:02
+
Checkpoint and applications: How to make sure you know your stuff
3 Lectures 10:21

This is a clip from my natural language processing course. It shows you how to apply logistic regression to sentiment analysis - measuring how positive or negative a word is.

Preview 05:13


BONUS: Exercises + how to get good at this
02:48
+
Project: Facial Expression Recognition
4 Lectures 34:48
Facial Expression Recognition Problem Description
12:21

The class imbalance problem
06:01

Utilities walkthrough
05:45

Facial Expression Recognition in Code
10:41
+
Appendix
4 Lectures 47:19
Gradient Descent Tutorial
04:30

How to install Numpy, Scipy, Matplotlib, Pandas, IPython, Theano, and TensorFlow
17:32

How to Code by Yourself (part 1)
15:54

How to Code by Yourself (part 2)
09:23
About the Instructor
Lazy Programmer Inc.
4.6 Average rating
12,686 Reviews
66,950 Students
19 Courses
Data scientist and big data engineer

I am a data scientist, big data engineer, and full stack software engineer.

For my masters thesis I worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons communicate with their family and caregivers.

I have worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. I've created new big data pipelines using Hadoop/Pig/MapReduce. I've created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

I have taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School. 

Multiple businesses have benefitted from my web programming expertise. I do all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies I've used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases I've used MySQL, Postgres, Redis, MongoDB, and more.