$$f(x) = x^2$$

### The probability of getting (k) heads when flipping (n) coins is
\begin{equation*}
P(E)   = {n \choose k} p^k (1-p)^{ n-k}
\end{equation*}

\begin{equation}
\int y\, \mathrm{d}x
\end{equation}

## Mean, Median, Mode

Mean, median, and mode are different measures of center in a numerical data set. They each try to summarize a dataset with a single number to represent a "typical" data point from the dataset.

__Mean:__ The "average" number; found by adding all data points and dividing by the number of data points.


\begin{equation}
\bar{y} = \frac{\sum y}{N}
\end{equation}

- $\sum y$ Take all the values and add them up
- divide by the total number of observations you have

__Median__ The middle number found by ordering all data points and picking out the one in the middle (or if there are two middle numbers, taking the mean of those two numbers).


To get the median

\begin{equation}
y = \tilde{x}
\end{equation}

$ y = [1,2,3,4,4,3,2,1] $

$ y = 4 $


The __mode__ is the most commonly occurring data point in a dataset. The mode is useful when there are a lot of repeated values in a dataset. There can be no mode, one mode, or multiple modes in a dataset.

## Standard Deviation

__Standard deviation__ is a number used to tell how measurements for a group are spread out from the average (mean), or expected value. A low standard deviation means that most of the numbers are close to the average. A high standard deviation means that the numbers are more spread out.

$$s = \sqrt{\frac{1}{N-1} \sum_{i=1}^N (x_i - \overline{x})^2}$$

## Variance

The __Variance__ is defined as: The average of the squared differences from the Mean. To calculate the variance follow these steps: Find the __Mean__, Then for each number: subtract the __Mean__ and square the result (the squared difference).

$$\sigma^2 = \frac{\displaystyle\sum_{i=1}^{n}(x_i - \mu)^2} {n}$$

## What is RMSE

 $RMSE = \sqrt{\frac{1}{n}\sum_{i=1}^{n}{\Big(\frac{d_i -f_i}{\sum_i}\Big)^2}}$
 
 
 ## Root mean squared error (RMSE)
RMSE is a quadratic scoring rule that also measures the average magnitude of the error. It’s the square root of the average squared differences between prediction and actual observation. 

 $RMSE = \sqrt{\frac{1}{n}\Sigma_{i=1}^{n}{\Big(\frac{d_i -f_i}{\Sigma_i}\Big)^2}}$
 
 we can do this simply from sklearn:

```python
from sklearn.metrics import mean_squared_error
from math import sqrt
rmse = sqrt(mean_squared_error(y_actual, y_predicted))
print(rmse)

# another way
n = len(predictions)
rmse = np.linalg.norm(predictions - targets) / np.sqrt(n)

# and another way
from sklearn.metrics import mean_squared_error
from math import sqrt
expected = [0.0, 0.5, 0.0, 0.5, 0.0]
predictions = [0.2, 0.4, 0.1, 0.6, 0.2]
mse = mean_squared_error(expected, predictions)
rmse = sqrt(mse)
print('RMSE: %f' % rmse)

```
The mean square root and square root of it will be useful.



```python
#pip install sklearn
```


```python
from sklearn.metrics import mean_squared_error
from math import sqrt
expected = [0.0, 0.5, 0.0, 0.5, 0.0]
predictions = [0.2, 0.4, 0.1, 0.6, 0.2]
mse = mean_squared_error(expected, predictions)
rmse = sqrt(mse)
print('RMSE: %f' % rmse)
```

    RMSE: 0.148324



```python

```

8c439924029e755a257e54b9864909f1adbe929d
ipynb
Jupyter Notebook
Data Science and Machine Learning/Machine-Learning-In-Python-THOROUGH/RECAP_DS/01_BASIC_STATISTICS/01_Math_Basics.ipynb
okara83/Becoming-a-Data-Scientist
f09a15f7f239b96b77a2f080c403b2f3e95c9650
MIT
Data Science and Machine Learning/Machine-Learning-In-Python-THOROUGH/RECAP_DS/01_BASIC_STATISTICS/01_Math_Basics.ipynb
okara83/Becoming-a-Data-Scientist
f09a15f7f239b96b77a2f080c403b2f3e95c9650
MIT
Data Science and Machine Learning/Machine-Learning-In-Python-THOROUGH/RECAP_DS/01_BASIC_STATISTICS/01_Math_Basics.ipynb
okara83/Becoming-a-Data-Scientist
f09a15f7f239b96b77a2f080c403b2f3e95c9650
MIT
2022-02-09T15:41:33.000Z
2022-02-11T07:47:40.000Z
Qwen/Qwen-72B
1. YES
2. YES