The aim this piece is to demonstrate some concepts of functional programming in Python, let’s dive-in!

*Part Derivative:*

The following function calculates the slope on a non-linear line.

The aim this piece is to demonstrate some concepts of functional programming in Python, let’s dive-in!

*Part Derivative:*

The following function calculates the slope on a non-linear line.

**what is the probability of a random person being infected, given a positive test result?** Assuming test sensitivity of 95% and 5% of the population are infected.

The correct answer is 20%. If your answer was much higher, then you have committed a **base rate fallacy**, and here is why…

Using a pipeline to transform data will allow you to use the preprocessing step as a tunable hyperparameter during grid search. We do this by creating a class.

The custom transformer class should inherit the *BaseEstimator* and *TransformerMixin* class.

In this example, we will use the titanic data set. We aim to…

The following is an implementation of cellular automata using Love2D (an engine for game development).

So, what is Cellular Automata?

A cellular automaton is a collection of “colored” cells on a grid of specified shape that evolves through a number of discrete time steps according to a set of rules…

Principal component analysis (PCA) is a dimension reduction algorithm. It transforms the data to a lower dimension, making it easy to visualize; for example, a human is a 3D object in space, a shadow of a human is a 2D representation of a human.

PCA utilizes Singular Value Decomposition (SVD)…

There are many ways to create a counter; one way is the **object-oriented** programming way:

- First, create a class
*Counter*. - Create an object
*counter*. - Now, Every time you call the
*counter*object, it gets incremented by 1.

`1`

2

3

4

Now, the **functional** programming way:

- First, we create…

Fitting nonlinear data with a linear model is a technique called Polynomial Regression. The intuition is that the model will have a higher degree of freedom to fit the data.

First, we generate the data (note that **y** is a quadratic function of **X**):

`m = 100`

X = 9 *…

When it comes to Visual Studio Code, some prefer to download the binary directly from Microsoft. However, with frequent updates come unnecessary manual labor.

The following is a shell script you run when a new version is released:

The alternative:

`sudo snap install code --classic`

That’s all, folks!

Here is a method to integrate a preprocessing utility from Keras with a model from Scikit-learn. The complete Jupyter notebook is in the reference section below.

We will be working with the MNIST data set:

- 60,000 Examples for the training set.
- 10,000 Examples for the test set.
- 784 Features (Images…

If it walks like a duck, quacks like a duck, then it is probably a duck!

Python is a dynamic language, which means it executes many programming behaviors (such as duck typing) at runtime.

Duck typing is simply looking at the behavior of an object to determine its type. In contrast, Normal typing looks at the type of an object to determine its behavior.

In the following example, we have a duck and a robot class.

Output:

`Quack Quack Quack`

I Quack too!

Both quack! Does it mean that the robot is a duck?

The idea is to determine the type of object based on its behavior, hence the abductive reasoning.

Sayonara!