> For the complete documentation index, see [llms.txt](https://pycoders-nl.gitbook.io/pycoders-handbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pycoders-nl.gitbook.io/pycoders-handbook/~/changes/YTi8eWfJe4r0epZkSSSg/extra-documentation/week16.md).

# maths-stats

Graphics for Machine Learning

## Chart Types

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCT2uaogc5kD-VFywt%2Fimage.png?alt=media\&token=66ecb01e-8e2c-48d1-85db-faf2561f39a2)

### Bar Chart <a href="#bar-chart" id="bar-chart"></a>

&#x20;A *bar chart uses* bars to show comparisons between categories of data. These bars can be displayed horizontally or vertically.

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCTI_LDUP4IJMYNVRr%2Fimage.png?alt=media\&token=a28ab746-9d27-4f00-851b-9b7f5a2457d2)

### Histogram <a href="#histogram" id="histogram"></a>

It provides a visual interpretation of numerical data by showing the number of data points that fall within a specified range of values (called “bins”).

![](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXHD9cWyxymOUWyISn-%2F-MXJLFYRTVRvwrMDVbm8%2Fhistogram.PNG?alt=media\&token=4ae5ce14-5f73-4ed7-a00a-6cb51c4138d7)

### Histogram Line Chart <a href="#histogram-line-chart" id="histogram-line-chart"></a>

&#x20;A **frequency polygon** is a graph constructed by using lines to join the midpoints of each interval, or bin

![](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXHD9cWyxymOUWyISn-%2F-MXJMqjC80scIuwhWdk3%2Ffrekans%20poligonu.PNG?alt=media\&token=b677614d-ee51-4102-9c30-0f8ee6fa66e0)

### Scatter Plot <a href="#scatter-plot" id="scatter-plot"></a>

This diagram is used to find the correlation between these two variables, how they are related.

![](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXHD9cWyxymOUWyISn-%2F-MXJNGmaN6WLitQhq2k3%2Fsacilma%20diyagrami.PNG?alt=media\&token=165ceabe-8e0f-4fbd-8bef-90e65106fc90)

* **Chart1**- Scatter Diagram with Strong Negative Correlation
* **Chart2**- Scatter Diagram with Weak Negative Correlation
* **Chart3**- Scatter Diagram with Strong Positive Correlation
* **Chart4**- Scatter Diagram with Weak Positive Correlation
* **Chart5**- Scatter Diagram with Weakest (or no) Correlation

{% hint style="info" %}
For more details, you can watch [**these series of videos.**](https://www.khanacademy.org/math/ap-statistics/bivariate-data-ap/scatterplots-correlation/v/constructing-scatter-plot)
{% endhint %}

### Box Plot <a href="#boxplot" id="boxplot"></a>

![box plot](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXJUf_C-AuN08jiNqn6%2F-MXJUunemJU82VJkalr8%2Fboxplot.PNG?alt=media\&token=3afcc7cd-7a2b-49a9-a8b6-43a29432f2f6)

![box plot](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXJP_NWQbILVl13SuXy%2F-MXJUbH6n1tcpfs1jIat%2F1_2c21SkzJMf3frPXPAR_gZA.png?alt=media\&token=45f50e23-5cb4-49c2-bc1a-45ff53643695)

### Bubble Chart <a href="#bubble-chart" id="bubble-chart"></a>

![bubble chart](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXJUf_C-AuN08jiNqn6%2F-MXJVP9iBuu9W5Xkk2DR%2Fbubblechartdetails.PNG?alt=media\&token=82c80a26-0aae-4e8e-8850-fc25b8c6cf7a)

* Colors rate the cut of the diamond
* The size of the bubbles and the clarity
* The size of the diamond in the horizontal
* It shows the price in the vertical

### Pie Chart & Donut Chart <a href="#pie-chart-donut-chart" id="pie-chart-donut-chart"></a>

![pie chart](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXJUf_C-AuN08jiNqn6%2F-MXJZUJSbRpZM6EHXAck%2FPieChart.PNG?alt=media\&token=42ad9f7f-3e07-442c-a579-32cac2daf693)

![donut chart](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXJUf_C-AuN08jiNqn6%2F-MXJZaYCmFyYzw3FNf5G%2Fdonutchart.PNG?alt=media\&token=7e03a948-498a-4444-bdb8-abccc488bccb)

#### Pie Chart Example

![correct answer: B](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCV9sgkDeHX4HV7W--%2Fimage.png?alt=media\&token=96bd3a16-2438-4da3-a323-71e07378fe23)

![correct answer: D](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCe8_Kls4QvRLLbiKb%2Fimage.png?alt=media\&token=cca7f5cf-7b92-4aa5-97cf-b48f4767fd0b)

### Stacked Bar Chart

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCVSnqo5lslrFe2ub2%2Fimage.png?alt=media\&token=006cc2af-c8d9-486c-8dbc-e72038f0139c)

### Stacked Area Chart <a href="#stacked-area-chart" id="stacked-area-chart"></a>

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCVWjx7Nnir1gbxyer%2Fimage.png?alt=media\&token=f27026d9-3c33-421d-be4a-19582a351fc4)

### Heat Map

A heat map is a graphical representation where individual values of a matrix are represented as colors. A heat map is very useful in visualizing the concentration of values between two dimensions of a matrix. This helps in finding patterns and gives a perspective of depth.

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCVdBXjNaa1ZQAQ0iR%2Fimage.png?alt=media\&token=4cae4a25-1f46-4b6f-a2a7-97d5aeefb419)

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCVjC1O6acHYNRvMdv%2Fimage.png?alt=media\&token=bc165299-f593-4ac3-938b-995dce6328a6)

To better understand the table above, a heat map is more useful:

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCVqDggxpMLqhY4ZnQ%2Fimage.png?alt=media\&token=b81a2498-85b0-4ced-acd7-9af59d3dca53)

### Recap

Below flow chart is very handy when choosing the best chart type to use.

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCWN6JG5N4PhB1DYvI%2Fimage.png?alt=media\&token=ae8d0b19-2435-4171-9ce4-7c2bf27b7b16)

{% hint style="success" %}
These are the chart types we'll cover here. Of course, there are many more.
{% endhint %}

## Common Functions Reference

### Linear Functions <a href="#lineer-func" id="lineer-func"></a>

![linear function](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXJfsfHWybg-3qxCaPw%2F-MXJkDeMW54mf9B3tkqw%2Flineer_fonk.PNG?alt=media\&token=05a2374d-70bf-4f36-aaef-c9d2f353c188)

&#x20;`m = (change in y) / (change in x)`   -----> Slope or Gradient (how steep the line is)

`b = value of y when x=0`      ----> just to see where the line crosses the Y axis.

![positive - negative slope](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCYBA5bIx3yuYiOcoQ%2Fimage.png?alt=media\&token=5a3a72d2-71f2-47cf-bd45-a714304c262c)

#### Linear Function Example

![positive slope](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCZdaC6Uuegv63baSH%2Fimage.png?alt=media\&token=e7d231d5-7e00-4941-860e-b77f672fb5cf)

![negative slope](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCbMEKA1Mo3RxqoQPn%2Fimage.png?alt=media\&token=abe91966-e626-4b5a-aa10-88a7d476f120)

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCbQBtcqOqreu6DALV%2Fimage.png?alt=media\&token=80854c77-a05b-44e2-a812-fb8c8de3e29e)

### Parabolic Functions <a href="#parabolic-func" id="parabolic-func"></a>

**b is easy:** just see where the line crosses the Y axis.

![parabolic function](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXYbC1MljHNBc9INhQr%2F-MXYdlDV_WEeW1wozSa4%2Fsquare_function.PNG?alt=media\&token=64c666ba-742c-4ad2-9aa5-2c1db99a3faa)

### Cube Functions

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCbs26owQaVCFFQANy%2Fimage.png?alt=media\&token=f3c3dbac-f21b-4a9d-b247-6f51f4f981ce)

### Square Root Functions

![](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCbxouALo28xBLsXwB%2Fimage.png?alt=media\&token=0949de83-a292-402d-a4e0-529b9d960f0e)

## How Polynomials Behave

&#x20;A polynomial looks like this:

![](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXYi75zM9UT2mu4jInZ%2F-MXYqb_LUJ7yK3t1UVbo%2Fpolinomlooklike.PNG?alt=media\&token=efeb901f-3dff-45dd-859e-ffeaf6709990)

![](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXYi75zM9UT2mu4jInZ%2F-MXYrEM4AWEbtTbcp16u%2Fnosharp.PNG?alt=media\&token=dd2f4b7b-e4dd-417f-8d81-6d1159fc08e5)

![Even values of "n"](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXYsy6VQHJdyT0KJ3pz%2F-MXYt1q9xNdGKB3ihiiM%2Fustciftpolinom.PNG?alt=media\&token=26960364-ff27-4c0e-8153-630347c0f078)

![Odd values of "n"](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXYsy6VQHJdyT0KJ3pz%2F-MXYt5wo4uI1S50n3uLQ%2Fusttekpolinom.PNG?alt=media\&token=bc562306-1f0a-4812-a3bb-9f318e083a35)

![](https://gblobscdn.gitbook.com/assets%2F-MXGmo73ypQ9hppzH3aI%2F-MXYsy6VQHJdyT0KJ3pz%2F-MXYtPzPVat8rpCimu8i%2Fpolinomexample.PNG?alt=media\&token=6b40c6dd-4521-4905-bfbd-cbc6dfd302f4)

#### Examples

![correct answer: B](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCd3zAOUIH9u4UHJ_3%2Fimage.png?alt=media\&token=c92b1504-172b-4993-a550-c2fad4545077)

![correct answer: A](https://2843449504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXS9gjR6N_CAer7Mflk%2F-MZCSgNjr0HsXUR9OGBd%2F-MZCdDlOfwxtw5-C9hjs%2Fimage.png?alt=media\&token=74432413-b47b-43d7-b1c2-bfe73c3a2a07)

## Exercises

1- What is "Numerical Reasoning Test"? Where is it used?

2- Go on to [**this site and take the Numerical Reasoning test**](https://www.assessment-training.com/Training/Free#/test/266?mode=free\&pid=0)**.** (I advise you to solve it without time limit.)

Good luck!
