\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Water (watersippin)} \pdfinfo{ /Title (machine-learning-cheat-sheet.pdf) /Creator (Cheatography) /Author (Water (watersippin)) /Subject (Machine Learning Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Machine Learning Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Water (watersippin)} via \textcolor{DarkBackground}{\uline{cheatography.com/183877/cs/38304/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Water (watersippin) \\ \uline{cheatography.com/watersippin} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 20th April, 2023.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{tabularx}{17.67cm}{x{6.908 cm} x{10.362 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Basic Terminology}} \tn % Row 0 \SetRowColor{LightBackground} Feature & A piece of data that is used as input, like a pixel of an image, or numerical values like cost of an item. \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} Label & The goal or target that the model is trying to predict, like figuring out if a spam email is spam or not. \tn % Row Count 10 (+ 5) % Row 2 \SetRowColor{LightBackground} Example & An example is a piece of data that contains both the features and the label so the model can learn the target. \tn % Row Count 15 (+ 5) % Row 3 \SetRowColor{white} Epoch & An epoch is a complete iteration over the training data, like flipping through a deck of flash cards, can be tuned to adjust accuracy. \tn % Row Count 21 (+ 6) % Row 4 \SetRowColor{LightBackground} Weights & Weights are parameters/numeric values that represent the strength of the connection of the input and the target output. These can be adjusted for accuracy. \tn % Row Count 28 (+ 7) % Row 5 \SetRowColor{white} Bias & Just like weights, Bias' are just parameters/numeric values that represent overall activation of the neurons in the model. \tn % Row Count 34 (+ 6) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{6.908 cm} x{10.362 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Basic Terminology (cont)}} \tn % Row 6 \SetRowColor{LightBackground} Neuron & A neuron is just made up of weights, bias, and an activation function \tn % Row Count 3 (+ 3) % Row 7 \SetRowColor{white} Activation Function & An activation function is a mathematical function that combines the inputs and the bias to produce an output signal. \tn % Row Count 8 (+ 5) % Row 8 \SetRowColor{LightBackground} Loss & Loss is the difference from the predicted value, with the true value. The goal is to adjust parameters to reduce loss. \tn % Row Count 13 (+ 5) % Row 9 \SetRowColor{white} Labeled data & Labeled data contains the features and the classified label so the model learns from it. \tn % Row Count 17 (+ 4) % Row 10 \SetRowColor{LightBackground} Unlabeled data & Unlabeled data is unclassified data for unsupervised learning. Useful because labeled data is hard to come by or long to label. \tn % Row Count 23 (+ 6) % Row 11 \SetRowColor{white} Layer & A layer in a neural network is a group of neurons that process a set of input data, apply some processing to it, and produce an output signal that is passed on to the next layer or to the final output of the network. \tn % Row Count 32 (+ 9) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{6.908 cm} x{10.362 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Basic Terminology (cont)}} \tn % Row 12 \SetRowColor{LightBackground} Neural Network & A neural network is a ML model composed of interconnected layers of nodes, or neurons, that process input data and produce output predictions. The neural network learns from data and adjusts its internal parameters to improve the accuracy of its predictions over time. \tn % Row Count 12 (+ 12) % Row 13 \SetRowColor{white} Model & A model is a representation of a system or a process that is created by training a machine learning algorithm on a dataset. \tn % Row Count 18 (+ 6) % Row 14 \SetRowColor{LightBackground} Training & Training is the process of teaching a model to recognize patterns in data and make accurate predictions. This happens by showing it labeled examples. \tn % Row Count 25 (+ 7) % Row 15 \SetRowColor{white} Inference & Inference is the process of using a trained model to make predictions on new, unseen data. \tn % Row Count 29 (+ 4) % Row 16 \SetRowColor{LightBackground} Regression & Regression is a way of making predictions based on input data. For example, if you want to predict how much a house will sell for based on its size, location, and other features, you can use regression. The goal of regression is to find a mathematical formula that accurately predicts the output value (in this case, the sale price) based on the input values (in this case, the size, location, and other features of the house). \tn % Row Count 47 (+ 18) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{6.908 cm} x{10.362 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Basic Terminology (cont)}} \tn % Row 17 \SetRowColor{LightBackground} Classification & Classification is like sorting objects into different boxes based on their features. For example, if you want to sort fruit into boxes based on their color, you would put all the red apples in one box, all the green apples in another box, and so on. In machine learning, classification is a similar process, but instead of fruit, we sort data into categories or classes based on input features. \tn % Row Count 17 (+ 17) % Row 18 \SetRowColor{white} \seqsplit{Hyper-Parameters} & Hyperparameters are parameters that are set before the training of a machine learning model and determine the behavior of the training algorithm. \tn % Row Count 24 (+ 7) % Row 19 \SetRowColor{LightBackground} Gradient Descent & Gradient Descent is an optimization algorithm commonly used to find the optimal values of the parameters of a model that minimize a given cost or loss function. \tn % Row Count 31 (+ 7) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{6.908 cm} x{10.362 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Basic Terminology (cont)}} \tn % Row 20 \SetRowColor{LightBackground} SDG & Stochastic Gradient Descent (SDG) is a variant of gradient descent that updates the parameters of the model for each data point in the dataset. SDG is commonly used in machine learning for large datasets because it is faster and more efficient than batch gradient descent. \tn % Row Count 12 (+ 12) % Row 21 \SetRowColor{white} Batch Descent & Batch Gradient descent updates the model parameters using the gradient of the loss function computed over the entire training dataset. \tn % Row Count 18 (+ 6) % Row 22 \SetRowColor{LightBackground} Mini Batch Descent & Mini Batch Gradient Descent updates the model parameters using the gradient of the loss function computed over a small randomly selected subset of the training dataset. \tn % Row Count 25 (+ 7) % Row 23 \SetRowColor{white} Learning Rate & The learning rate is a hyperparameter that controls how much the model parameters are updated during training. It determines the step size at each iteration of the optimization algorithm, such as gradient descent or its variants. \tn % Row Count 35 (+ 10) \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{6.908 cm} x{10.362 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Basic Terminology (cont)}} \tn % Row 24 \SetRowColor{LightBackground} Convergence & Convergence refers to the point at which the optimization algorithm has found the optimal values of the model parameters and has reached the minimum value of the loss function. \tn % Row Count 8 (+ 8) % Row 25 \SetRowColor{white} Emperical Risk Minimization & Empirical Risk Minimization is a principle in machine learning and statistics that states that the best model for a given problem is the one that minimizes the empirical risk or training error. \tn % Row Count 17 (+ 9) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{x{2.5905 cm} x{14.6795 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Activations}} \tn % Row 0 \SetRowColor{LightBackground} ReLU & The ReLU activation function is used to determine whether a neuron in a neural network should "fire" or not. When the input to the ReLU function is positive, the function outputs the input value. When the input is negative, the function outputs zero. \tn % Row Count 8 (+ 8) % Row 1 \SetRowColor{white} \seqsplit{Sigmoid} & Sigmoid is an activation function that maps any input value to a value between 0 and 1, and is commonly used in binary classification problems. \tn % Row Count 13 (+ 5) % Row 2 \SetRowColor{LightBackground} \seqsplit{Softmax} & Softmax is an activation function that is used to convert a vector of numbers into a probability distribution, and is commonly used in multiclass classification problems. \tn % Row Count 18 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} x{15.543 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Algorithms}} \tn % Row 0 \SetRowColor{LightBackground} MSE & Mean Squared Error (MSE) is a metric used to measure the performance of regression models. It calculates the average squared difference between the predicted values and the actual values for a set of data points. A smaller value of MSE indicates that the model is making more accurate predictions, while a larger value of MSE indicates that the model is making less accurate predictions. \tn % Row Count 11 (+ 11) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{17.67cm}{p{1.727 cm} x{15.543 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{17.67cm}}{\bf\textcolor{white}{Algorithms}} \tn % Row 0 \SetRowColor{LightBackground} MSE & Mean Squared Error (MSE) is a metric used to measure the performance of regression models. It calculates the average squared difference between the predicted values and the actual values for a set of data points. A smaller value of MSE indicates that the model is making more accurate predictions, while a larger value of MSE indicates that the model is making less accurate predictions. \tn % Row Count 11 (+ 11) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \end{document}