bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/Python

Python

Data Science and Scientific Python

NumPy, Pandas, SciPy, plotting, and machine learning topics grouped into one practical track.

Lesson 1

NumPy Tutorial

NumPy Tutorial

2 min
Read lesson →
Lesson 2visual

Matplotlib Tutorial

Matplotlib Tutorial

2 min
Read lesson →
Lesson 3

Machine Learning

Machine Learning

3 min
Read lesson →
Lesson 4

Pandas Tutorial

Pandas Tutorial

2 min
Read lesson →
Lesson 5

Matplotlib Getting Started

Installation of Matplotlib If you have Python and PIP already installed on a system, then installation of Matplotlib is very easy. Install it using this command: C:\Users\ Your Name >pip install matp…

2 min
Read lesson →
Lesson 6

Machine Learning - Mean Median Mode

Mean, Median, and Mode What can we learn from looking at a group of numbers? In Machine Learning (and in mathematics) there are often three values that interests us: Mean - The average value Median -…

2 min
Read lesson →
Lesson 7visual

SciPy Tutorial

SciPy Tutorial

2 min
Read lesson →
Lesson 8

Matplotlib Pyplot

Pyplot Most of the Matplotlib utilities lies under the pyplot submodule, and are usually imported under the plt alias: import matplotlib.pyplot as plt Now the Pyplot package can be referred to as plt…

2 min
Read lesson →
Lesson 9

Machine Learning - Standard Deviation

Machine Learning - Standard Deviation

3 min
Read lesson →
Lesson 10visual

Django Tutorial

Django Tutorial

2 min
Read lesson →
Lesson 11

Matplotlib Plotting

Plotting x and y points The plot() function is used to draw points (markers) in a diagram. By default, the plot() function draws a line from point to point. The function takes parameters for specifyi…

2 min
Read lesson →
Lesson 12

Machine Learning - Percentiles

Machine Learning - Percentiles

2 min
Read lesson →
Lesson 13visual

Matplotlib Markers

Markers You can use the keyword argument marker to emphasize each point with a specified marker: Example Mark each point with a circle: import matplotlib.pyplot as plt import numpy as np ypoints = np…

4 min
Read lesson →
Lesson 14

Machine Learning - Data Distribution

Machine Learning - Data Distribution

2 min
Read lesson →
Lesson 15

Matplotlib Line

Linestyle You can use the keyword argument linestyle, or shorter ls, to change the style of the plotted line: Example Use a dotted line: import matplotlib.pyplot as plt import numpy as np ypoints = n…

2 min
Read lesson →
Lesson 16visual

Machine Learning - Normal Data Distribution

Normal Data Distribution In the previous chapter we learned how to create a completely random array, of a given size, and between two given values. In this chapter we will learn how to create an arra…

2 min
Read lesson →
Lesson 17

Matplotlib Labels and Title

Create Labels for a Plot With Pyplot, you can use the xlabel() and ylabel() functions to set a label for the x- and y-axis. Example Add labels to the x- and y-axis: import numpy as np import matplotl…

2 min
Read lesson →
Lesson 18

Machine Learning - Scatter Plot

Scatter Plot A scatter plot is a diagram where each value in the data set is represented by a dot. The Matplotlib module has a method for drawing scatter plots, it needs two arrays of the same length…

2 min
Read lesson →
Lesson 19

Matplotlib Adding Grid Lines

Add Grid Lines to a Plot With Pyplot, you can use the grid() function to add grid lines to the plot. Example Add grid lines to the plot: import numpy as np import matplotlib.pyplot as plt x = np.arra…

2 min
Read lesson →
Lesson 20

Machine Learning - Linear Regression

Regression The term regression is used when you try to find the relationship between variables. In Machine Learning, and in statistical modeling, that relationship is used to predict the outcome of f…

4 min
Read lesson →
Lesson 21

Matplotlib Subplot

Display Multiple Plots With the subplot() function you can draw multiple plots in one figure: Example Draw 2 plots: import matplotlib.pyplot as plt import numpy as np #plot 1: x = np.array([0, 1, 2,…

3 min
Read lesson →
Lesson 22

Machine Learning - Polynomial Regression

Polynomial Regression If your data points clearly will not fit a linear regression (a straight line through all data points), it might be ideal for polynomial regression. Polynomial regression, like…

4 min
Read lesson →
Lesson 23

Matplotlib Scatter

Creating Scatter Plots With Pyplot, you can use the scatter() function to draw a scatter plot. The scatter() function plots one dot for each observation. It needs two arrays of the same length, one f…

8 min
Read lesson →
Lesson 24

Machine Learning - Multiple Regression

Machine Learning - Multiple Regression

5 min
Read lesson →
Lesson 25visual

Matplotlib Bars

Creating Bars With Pyplot, you can use the bar() function to draw bar graphs: Example Draw 4 bars: import matplotlib.pyplot as plt import numpy as np x = np.array(["A", "B", "C", "D"]) y = np.array([…

2 min
Read lesson →
Lesson 26

Machine Learning - Scale

Machine Learning - Scale

4 min
Read lesson →
Lesson 27visual

Matplotlib Histograms

Histogram A histogram is a graph showing frequency distributions. It is a graph showing the number of observations within each given interval. Example: Say you ask for the height of 250 people, you m…

3 min
Read lesson →
Lesson 28

Machine Learning - Train/Test

Evaluate Your Model In Machine Learning we create models to predict the outcome of certain events, like in the previous chapter where we predicted the CO2 emission of a car when we knew the weight an…

5 min
Read lesson →
Lesson 29

Matplotlib Pie Charts

Creating Pie Charts With Pyplot, you can use the pie() function to draw pie charts: Example A simple pie chart: import matplotlib.pyplot as plt import numpy as np y = np.array([35, 25, 25, 15]) plt.p…

3 min
Read lesson →
Lesson 30visual

Machine Learning - Decision Tree

Machine Learning - Decision Tree

8 min
Read lesson →
Lesson 31

Machine Learning - Confusion Matrix

Machine Learning - Confusion Matrix

3 min
Read lesson →
Lesson 32

Machine Learning - Hierarchical Clustering

Hierarchical Clustering Hierarchical clustering is an unsupervised learning method for clustering data points. The algorithm builds clusters by measuring the dissimilarities between data. Unsupervise…

4 min
Read lesson →
Lesson 33

Machine Learning - Logistic Regression

Logistic Regression Logistic regression aims to solve classification problems. It does this by predicting categorical outcomes, unlike linear regression that predicts a continuous outcome. In the sim…

5 min
Read lesson →
Lesson 34

Machine Learning - Grid Search

Grid Search The majority of machine learning models contain parameters that can be adjusted to vary how the model learns. For example, the logistic regression model, from sklearn, has a parameter C t…

4 min
Read lesson →
Lesson 35

Preprocessing - Categorical Data

Categorical Data When your data has categories represented by strings, it will be difficult to use them to train machine learning models which often only accepts numeric data. Instead of ignoring the…

9 min
Read lesson →
Lesson 36visual

Machine Learning - K-means

K-means K-means is an unsupervised learning method for clustering data points. The algorithm iteratively divides data points into K clusters by minimizing the variance in each cluster. Here, we will…

3 min
Read lesson →
Lesson 37visual

Machine Learning - Bootstrap Aggregation (Bagging)

Bagging Methods such as Decision Trees, can be prone to overfitting on the training set which can lead to wrong predictions on new data. Bootstrap Aggregation (bagging) is a ensembling method that at…

8 min
Read lesson →
Lesson 38

Machine Learning - Cross Validation

Cross Validation When adjusting models we are aiming to increase overall model performance on unseen data. Hyperparameter tuning can lead to much better performance on test sets. However, optimizing…

5 min
Read lesson →
Lesson 39visual

Machine Learning - AUC - ROC Curve

AUC - ROC Curve In classification, there are many different evaluation metrics. The most popular is accuracy, which measures how often the model is correct. This is a great metric because it is easy…

4 min
Read lesson →
Lesson 40

Machine Learning - K-nearest neighbors (KNN)

KNN KNN is a simple, supervised machine learning (ML) algorithm that can be used for classification or regression tasks - and is also frequently used in missing value imputation. It is based on the i…

4 min
Read lesson →