To learn data science and machine learning, you need to prepare some necessary math knowledge.
Calculus provides the basic math tools for solving machine learning problems, such as calculating the gradient. Below are the notes on Calculus:
Definition of a derivative:
$f'(x)=\frac{d f(x)}{dx}=\lim_{\Delta x\to0}(\frac{f(x+\Delta x)-f(x)}{\Delta x})$
Rules of derivative:
Sum rule:
$\frac{d}{dx}(f(x)+g(x)) = \frac{d}{dx}(f(x)) + \frac{d}{dx}(g(x))$
Power rule:
Given $f(x)=ax^b$, then $f'(x)=abx^{(b-1)}$
Product rule:
Given $A(x)=f(x)g(x)$,
then $A'(x)=f'(x)g(x)+f(x)g'(x)$
Chain rule:
Given $h=h(p)$ and $p=p(m)$,
then $\frac{dh}{dm}=\frac{dh}{dp} \times \frac{dp}{dm}$
Total derivative:
For the function $f(x,y,z,...)$, where each variable is a function of parameter $t$, the total derivative is:
$\frac{df}{dt} = \frac{\partial f}{\partial x} \frac{dx}{dt} + \frac{\partial f}{\partial y} \frac{dy}{dt} + \frac{\partial f}{\partial z} \frac{dz}{dt} + ...$
Derivatives of named functions:
$\frac{d}{dx}(\frac{1}{x}) = - \frac{1}{x^2}$
$\frac{d}{dx}(sin(x)) = cos(x)$
$\frac{d}{dx}(cos(x)) = - sin(x)$
$\frac{x}{dx}(e^x)=e^x$