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:
Now, the functional programming way:
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:
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:
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.
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.