Convert Figma logo to code with AI

afshinea logostanford-cs-229-machine-learning

VIP cheatsheets for Stanford's CS 229 Machine Learning

17,433
3,920
17,433
18

Top Related Projects

Course to get into Large Language Models (LLMs) with roadmaps and Colab notebooks.

12 weeks, 26 lessons, 52 quizzes, classic Machine Learning for all

A series of Jupyter notebooks that walk you through the fundamentals of Machine Learning and Deep Learning in Python using Scikit-Learn, Keras and TensorFlow 2.

Machine Learning From Scratch. Bare bones NumPy implementations of machine learning models and algorithms with a focus on accessibility. Aims to cover everything from linear regression to deep learning.

Code Repository for Machine Learning with PyTorch and Scikit-Learn

Python Data Science Handbook: full text in Jupyter Notebooks

Quick Overview

The afshinea/stanford-cs-229-machine-learning repository is a comprehensive collection of cheat sheets and refreshers for Stanford's CS 229 Machine Learning course. It provides concise summaries of key machine learning concepts, algorithms, and techniques, serving as a quick reference guide for students and practitioners in the field.

Pros

  • Offers clear and concise summaries of complex machine learning topics
  • Covers a wide range of machine learning concepts and algorithms
  • Available in multiple languages, making it accessible to a global audience
  • Visually appealing and well-organized content

Cons

  • May not provide in-depth explanations for advanced topics
  • Requires some prior knowledge of machine learning concepts
  • Not a substitute for comprehensive course materials or textbooks
  • Limited interactive elements or practical exercises

Code Examples

This repository does not contain code examples as it primarily consists of cheat sheets and summary documents. Therefore, this section is not applicable.

Getting Started

As this is not a code library, there are no specific getting started instructions. However, users can access the cheat sheets by following these steps:

  1. Visit the repository: https://github.com/afshinea/stanford-cs-229-machine-learning
  2. Navigate to the desired language folder (e.g., "en" for English)
  3. Click on the PDF files to view or download the cheat sheets
  4. Use the cheat sheets as quick reference guides while studying machine learning concepts or working on related projects

Competitor Comparisons

Course to get into Large Language Models (LLMs) with roadmaps and Colab notebooks.

Pros of llm-course

  • Focuses specifically on Large Language Models (LLMs), providing in-depth coverage of this cutting-edge topic
  • Includes practical tutorials and hands-on exercises for working with LLMs
  • Regularly updated with the latest developments in the field of LLMs

Cons of llm-course

  • Narrower scope compared to stanford-cs-229-machine-learning, which covers a broader range of ML topics
  • May require more advanced prerequisites in machine learning and natural language processing
  • Less comprehensive coverage of fundamental ML concepts and algorithms

Code Comparison

llm-course (Python):

from transformers import pipeline

generator = pipeline('text-generation', model='gpt2')
generator("Hello, I'm a language model,", max_length=30, num_return_sequences=1)

stanford-cs-229-machine-learning (Python):

import numpy as np

def gradient_descent(X, y, theta, alpha, num_iters):
    m = len(y)
    for i in range(num_iters):
        theta = theta - (alpha / m) * np.dot(X.T, np.dot(X, theta) - y)
    return theta

The code snippets demonstrate the difference in focus between the two repositories. llm-course emphasizes working with pre-trained language models, while stanford-cs-229-machine-learning covers fundamental machine learning algorithms like gradient descent.

12 weeks, 26 lessons, 52 quizzes, classic Machine Learning for all

Pros of ML-For-Beginners

  • More comprehensive curriculum covering a wide range of ML topics
  • Includes hands-on coding exercises and projects
  • Regularly updated with new content and improvements

Cons of ML-For-Beginners

  • Less focused on theoretical foundations compared to stanford-cs-229-machine-learning
  • May not cover advanced topics in as much depth
  • Requires more time investment due to its extensive curriculum

Code Comparison

ML-For-Beginners (Python):

from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
model = LogisticRegression()
model.fit(X_train, y_train)

stanford-cs-229-machine-learning (MATLAB/Octave):

theta = zeros(n, 1);
for i = 1:m
    h = sigmoid(X(i,:) * theta);
    theta = theta - alpha * (h - y(i)) * X(i,:)';
end

The code snippets illustrate the difference in approach: ML-For-Beginners uses popular libraries like scikit-learn for implementation, while stanford-cs-229-machine-learning focuses on implementing algorithms from scratch, providing a deeper understanding of the underlying mathematics.

A series of Jupyter notebooks that walk you through the fundamentals of Machine Learning and Deep Learning in Python using Scikit-Learn, Keras and TensorFlow 2.

Pros of handson-ml3

  • More comprehensive coverage of machine learning topics, including deep learning and neural networks
  • Includes practical, hands-on examples and Jupyter notebooks for interactive learning
  • Regularly updated with the latest machine learning techniques and libraries

Cons of handson-ml3

  • May be overwhelming for beginners due to its extensive content
  • Requires more time investment to work through all the material
  • Less focused on theoretical foundations compared to stanford-cs-229-machine-learning

Code Comparison

stanford-cs-229-machine-learning (Python):

def sigmoid(z):
    return 1 / (1 + np.exp(-z))

def cost_function(theta, X, y):
    m = len(y)
    h = sigmoid(X.dot(theta))
    J = (-1/m) * (y.T.dot(np.log(h)) + (1-y).T.dot(np.log(1-h)))
    return J

handson-ml3 (Python):

from sklearn.linear_model import LogisticRegression

log_reg = LogisticRegression(random_state=42)
log_reg.fit(X_train, y_train)

y_pred = log_reg.predict(X_test)
accuracy = accuracy_score(y_test, y_pred)

The stanford-cs-229-machine-learning example shows a more low-level implementation of logistic regression, while handson-ml3 demonstrates the use of scikit-learn for a higher-level, practical approach.

Machine Learning From Scratch. Bare bones NumPy implementations of machine learning models and algorithms with a focus on accessibility. Aims to cover everything from linear regression to deep learning.

Pros of ML-From-Scratch

  • Provides complete implementations of machine learning algorithms from scratch, offering a deeper understanding of their inner workings
  • Includes a wider range of algorithms and models, covering more advanced topics
  • Code is well-organized and modular, making it easier to understand and modify

Cons of ML-From-Scratch

  • Lacks comprehensive explanations and theoretical background compared to stanford-cs-229-machine-learning
  • May be more challenging for beginners due to its focus on implementation details rather than conceptual understanding
  • Does not provide as many visual aids or summary sheets for quick reference

Code Comparison

ML-From-Scratch (Linear Regression implementation):

class LinearRegression(Regression):
    def fit(self, X, y):
        X = np.insert(X, 0, 1, axis=1)
        U, S, V = np.linalg.svd(X.T.dot(X))
        S = np.diag(S)
        self.w = V.dot(np.linalg.pinv(S)).dot(U.T).dot(X.T).dot(y)

stanford-cs-229-machine-learning (Linear Regression formula):

θ = (X^T X)^(-1) X^T y

The stanford-cs-229-machine-learning repository focuses on providing theoretical explanations and formulas, while ML-From-Scratch offers complete code implementations.

Code Repository for Machine Learning with PyTorch and Scikit-Learn

Pros of machine-learning-book

  • More comprehensive coverage of machine learning topics
  • Includes practical code examples and implementations
  • Regularly updated with new content and improvements

Cons of machine-learning-book

  • Less focused on a specific course curriculum
  • May be overwhelming for beginners due to its breadth

Code Comparison

stanford-cs-229-machine-learning:

# No code examples available in this repository

machine-learning-book:

from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=1)
sc = StandardScaler()
X_train_std = sc.fit_transform(X_train)
X_test_std = sc.transform(X_test)

Summary

stanford-cs-229-machine-learning provides concise cheat sheets and summaries for Stanford's CS229 course, making it ideal for quick reference and exam preparation. machine-learning-book offers a more comprehensive approach to machine learning, with practical code examples and a broader range of topics. While stanford-cs-229-machine-learning is more focused on a specific curriculum, machine-learning-book may be better suited for those looking for in-depth explanations and hands-on implementation.

Python Data Science Handbook: full text in Jupyter Notebooks

Pros of PythonDataScienceHandbook

  • Comprehensive coverage of Python data science libraries (NumPy, Pandas, Matplotlib, Scikit-Learn)
  • Interactive Jupyter notebooks for hands-on learning and experimentation
  • Practical examples and real-world applications

Cons of PythonDataScienceHandbook

  • Less focus on theoretical machine learning concepts
  • May not cover advanced topics in as much depth as stanford-cs-229-machine-learning
  • Limited coverage of deep learning and neural networks

Code Comparison

PythonDataScienceHandbook:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression

stanford-cs-229-machine-learning:

import numpy as np
import matplotlib.pyplot as plt
from scipy import stats

def gradient_descent(X, y, theta, alpha, num_iters):
    m = len(y)
    J_history = np.zeros(num_iters)

The PythonDataScienceHandbook code focuses on importing popular data science libraries, while stanford-cs-229-machine-learning demonstrates a more algorithm-focused approach with a custom gradient descent implementation.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Machine Learning cheatsheets for Stanford's CS 229

Available in العربية - English - Español - فارسی - Français - 한국어 - Português - Türkçe - Tiếng Việt - 简中 - 繁中

Goal

This repository aims at summing up in the same place all the important notions that are covered in Stanford's CS 229 Machine Learning course, and include:

  • Refreshers in related topics that highlight the key points of the prerequisites of the course.
  • Cheatsheets for each machine learning field, as well as another dedicated to tips and tricks to have in mind when training a model.
  • All elements of the above combined in an ultimate compilation of concepts, to have with you at all times!

Content

VIP Cheatsheets

IllustrationIllustrationIllustrationIllustration
Supervised LearningUnsupervised LearningDeep LearningTips and tricks

VIP Refreshers

IllustrationIllustration
Probabilities and StatisticsAlgebra and Calculus

Super VIP Cheatsheet

Illustration
All the above gathered in one place

Website

This material is also available on a dedicated website, so that you can enjoy reading it from any device.

Translation

Would you like to see these cheatsheets in your native language? You can help us translating them on this dedicated repo!

Authors

Afshine Amidi (Ecole Centrale Paris, MIT) and Shervine Amidi (Ecole Centrale Paris, Stanford University)