nsoojin/coursera-ml-py
nsoojin/coursera-ml-py has 1,435 GitHub stars and 487 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-09 04:42 UTC. Last push 2020-09-02.
Python programming assignments for Machine Learning by Prof. Andrew Ng in Coursera
Measured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalCoursera Machine Learning Assignments in Python

About
If you've finished the amazing introductory Machine Learning on Coursera by Prof. Andrew Ng, you probably got familiar with Octave/Matlab programming. With this repo, you can re-implement them in Python, step-by-step, visually checking your work along the way, just as the course assignments.
How to start
Dependencies
This project was coded in Python 3.6
- numpy
- matplotlib
- scipy
- scikit-learn
- scikit-image
- nltk
Installation
The fastest and easiest way to install all these dependencies at once is to use Anaconda.
Important Note
There are a couple of things to keep in mind before starting.
- all column vectors from octave/matlab are flattened into a simple 1-dimensional ndarray. (e.g., y's and thetas are no longer m x 1 matrix, just a 1-d ndarray with m elements.)
So in Octave/Matlab,
Now, it is>> size(theta) >> (2, 1)>>> theta.shape >>> (2, ) - numpy.matrix is never used, just plain ol' numpy.ndarray
Contents
Exercise 1
- Linear Regression
- Linear Regression with multiple variables
Exercise 2
- Logistic Regression
- Logistic Regression with Regularization
Exercise 3
- Multiclass Classification
- Neural Networks Prediction fuction
Exercise 4
- Neural Networks Learning
Exercise 5
- Regularized Linear Regression
- Bias vs. Variance
Exercise 6
- Support Vector Machines
- Spam email Classifier
Exercise 7
- K-means Clustering
- Principal Component Analysis
Exercise 8
- Anomaly Detection
- Recommender Systems
Solutions
You can check out my implementation of the assignments here. I tried to vectorize all the solutions.
Explore related projects
tensorflow/tensorflow
An Open Source Machine Learning Framework for Everyone
201,400 starshuggingface/transformers
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
168,668 starsAUTOMATIC1111/stable-diffusion-webui
Stable Diffusion web UI
165,261 starsComfy-Org/ComfyUI
The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
145,835 stars