ML Basics

Machine Learning Fundamentals

Basic knowledge of Machine Learning.

2020-09-07

Overview of Machine Learning Algorithms

Supervised/Unsupervised Learning Supervised learning The training data you feed to the algorithm includes the desired solutions, called labels Typical task: Classification Regression Important supervised learning algo: k-Nearest Neighbors Linear Regression Logistic Regression Support Vector Machine (SVM) Decision Trees and Random Forests Neural Networks Unsupervised learning Training data is unlabeled.

2020-08-17

Evaluation

TL;DR Confusion matrix, ROC, and AUC Confuse matrix A confusion matrix tells you what your ML algorithm did right and what it did wrong. Known Truth Positive Negative Prediction Positive True Positive (TP) False Positive (FP) Precision = TP / (TP+FP) Negative False Negative (FN) True Negative (TN) TPR = Sensitivity = Recall = TP / (TP + FN) Specificity = TN / (FP+TN) FPR = FP / (FP + TN) = 1 - Specificity Row: Prediction Column: Known truth Each cell:

2020-08-17

End-to-End Machine Learning Project

1. Look at the big picture 1.1 Frame the problem Consider the business objective: How do we expect to use and benefit from this model? 1.2 Select a performance measure 1.

2020-08-17

Math Basics

Linear Algebra Vectors Vector: multi-dimensional quantity Each dimension contains different information (e.g.: Age, Weight, Height…) represented as bold symbols A vector $\boldsymbol{x}$ is always a column vector $$ \boldsymbol{x}=\left[\begin{array}{l} {1} \\\\ {2} \\\\ {4} \end{array}\right] $$ A transposed vector $\boldsymbol{x}^T$ is a row vector $$ \boldsymbol{x}^{T}=\left[\begin{array}{lll} {1} & {2} & {4} \end{array}\right] $$ Vector Operations Multiplication by scalars $$ 2\left[\begin{array}{l} {1} \\\\ {2} \end{array}\right]=\left[\begin{array}{l} {2} \\\\ {4} \end{array}\right] $$ Addtition of vectors $$ \left[\begin{array}{l}{1} \\\\ {2} \end{array}\right]+\left[\begin{array}{l}{3} \\\\ {1}\end{array}\right]=\left[\begin{array}{l}{4} \\\\ {3} \end{array}\right] $$ Scalar (Inner) products: Sum the element-wise products $$ \boldsymbol{v}=\left[\begin{array}{c}{1} \\\\ {2} \\\\ {4}\end{array}\right], \quad \boldsymbol{w}=\left[\begin{array}{l}{2} \\\\ {4} \\\\ {8}\end{array}\right] $$ $$ \langle v, w\rangle= 1 \cdot 2+2 \cdot 4+4 \cdot 8=42 $$ Length of a vector: Square root of the inner product with itself $$ \|\boldsymbol{v}\|=\langle\boldsymbol{v}, \boldsymbol{v}\rangle^{\frac{1}{2}}=\left(1^{2}+2^{2}+4^{2}\right)^{\frac{1}{2}}=\sqrt{21} $$ Matrices Matrix: rectangular array of numbers arranged in rows and columns

2020-08-17