{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# CS 236756 - Technion - Intro to Machine Learning\n", "---\n", "\n", "#### Tal Daniel\n", "\n", "## Tutorial 01 - Probability Refresher and Maximum Likelihood Estimator (MLE)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Agenda\n", "---\n", "* [Probability Basics](#-Probability-Basics)\n", "* [Bayes Rule](#-Bayes-Rule)\n", "* [Expectation & Variance](#-Mean-&-Variance)\n", "* [Correlation](#-Correlation)\n", "* [Maximum Likelihood Estimator](#-Maximum-Likelihood-Estimation-(MLE))\n", "* [Recommended Videos](#-Recommended-Videos)\n", "* [Credits](#-Credits)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "slideshow": { "slide_type": "skip" } }, "outputs": [], "source": [ "# imports for the tutorial\n", "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "%matplotlib notebook" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Probability Basics\n", "---\n", "We define the following:\n", "* **Experiment** - an experiment or trial is any procedure that can be infinitely repeated and has a well-defined set of possible outcomes, known as the sample space.\n", " * Example: toss a coin twice\n", "* **Sample Space ($\\Omega$)** - possible outcomes of an experiment\n", " * Example (coin toss): {HH, HT, TH, TT} (H = Heads, T = Tails)\n", "* **Event** - a subset of possible outcomes\n", " * Example (coin toss): A = {HH} , B= {HT, TH}" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "* **Probability (of an event)** - a number assigned to an event\n", " * Example (coin toss): $Pr(A) = \\frac{1}{4}$\n", "* **Axioms**:\n", " 1. $0 \\leq Pr(A) \\leq 1$\n", " 2. $Pr(\\Omega) = 1 $\n", " 3. $Pr(A \\cup B) = Pr(A) + Pr(B) - P(A \\cap B)$ (if $A, B$ are independent $P(A \\cap B) = 0$)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "\n", "(image from tistats.com)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "#### Summary\n", "\n", "\n", "| Term | Usually donated by | Definition | Example |\n", "| --- | --- | --- | --- |\n", "| **Experiment** | |
\n", " | Gender | \n", "Height | \n", "
---|---|---|
0 | \n", "Male | \n", "187.571423 | \n", "
1 | \n", "Male | \n", "174.706036 | \n", "
2 | \n", "Male | \n", "188.239668 | \n", "
3 | \n", "Male | \n", "182.196685 | \n", "
4 | \n", "Male | \n", "177.499761 | \n", "
5 | \n", "Male | \n", "170.822660 | \n", "
6 | \n", "Male | \n", "174.714106 | \n", "
7 | \n", "Male | \n", "173.605229 | \n", "
8 | \n", "Male | \n", "170.228132 | \n", "
9 | \n", "Male | \n", "161.179495 | \n", "