\section{Linear Regression}\label{linear-regression}

\subsection{Statical tools}\label{statical-tools}

Numpy comes with some useful statistical tools that we can use to
analyze our data.

\subsubsection{Mean}\label{mean}

The mean is the average of a set of numbers. It is calculated by summing
all the numbers and dividing by the count of numbers.

\begin{Shaded}
\begin{Highlighting}[]
\ImportTok{import}\NormalTok{ numpy }\ImportTok{as}\NormalTok{ np}

\NormalTok{mean }\OperatorTok{=}\NormalTok{ np.mean([}\DecValTok{1}\NormalTok{, }\DecValTok{2}\NormalTok{, }\DecValTok{3}\NormalTok{, }\DecValTok{4}\NormalTok{, }\DecValTok{5}\NormalTok{])}
\NormalTok{median }\OperatorTok{=}\NormalTok{ np.median([}\DecValTok{1}\NormalTok{, }\DecValTok{2}\NormalTok{, }\DecValTok{3}\NormalTok{, }\DecValTok{4}\NormalTok{, }\DecValTok{5}\NormalTok{])}
\NormalTok{std }\OperatorTok{=}\NormalTok{ np.std([}\DecValTok{1}\NormalTok{, }\DecValTok{2}\NormalTok{, }\DecValTok{3}\NormalTok{, }\DecValTok{4}\NormalTok{, }\DecValTok{5}\NormalTok{])}
\NormalTok{variance }\OperatorTok{=}\NormalTok{ np.var([}\DecValTok{1}\NormalTok{, }\DecValTok{2}\NormalTok{, }\DecValTok{3}\NormalTok{, }\DecValTok{4}\NormalTok{, }\DecValTok{5}\NormalTok{])}
\end{Highlighting}
\end{Shaded}
