Learning to write Mathematical notations is critical, when you are taking a note in your Machine Learning classes or building a custom ML algorithm.
Advantage of Markdown approach: you may use any IDE to write Markdown.
This article is focused on how to write mathematical notations for ML. So, I won’t be covering details of each algorithm. you will find most commonly used notations and how to write them below
Simple Linear Regression:
Using one variable to predict a value of other variable
$\hat{y}$ = $\theta_0 + \theta_1 x_1$
Mean Squared Error:
Mean of all Residual Errors shows how poorly the line fits with the data set
MSE = $\frac{1}{n} \Sigma_{i=1}^n({y}-\hat{y})^2$
Logistic Regression & Thresholds:
$\Theta^T$ X = $\theta_0$ + $\theta_1$ * $$x_1$$Threshold: (Step function)
- $\hat{y}$ = 0 if $\Theta^T$ X < 0.5
- $\hat{y}$ = 1 if $\Theta^T$ X $\ge$ 0.5
Sigmoid function:
$\Sigma(\Theta^TX)$ = $$\frac{1} {1 + e^-\Theta^Tx }$$
$\hat{y}$ = $\Sigma(\Theta^T X)$
Cost function:
$Cost(\hat{y}$, y) = $\frac{1}{2}(\Sigma(\theta^TX)-y)^2$
Mean squared error for cost function:
J($\theta$) = $\frac{1}{m} \Sigma_{i=1}^{m} Cost(\hat{y}, y)$
Logistic Regression Cost function:
$J(\Theta)$ = -$\frac{1}{m} \Sigma_{i=1}^my^ilog(\hat{y}^i) + (1-y^i)log(1-\hat{y}^i)$
Finally, once you get used to writing mathematical notation for markdown it is much fun to work on Machine Learning algorithms
Happy Coding
For further learning — please checkout resources below: