Artificial Intelligence

How to Classify Star Wars Lego Images using CNN and Transfer Learning

This tutorial is about training deep learning (DL) models to classify Star Wars Lego images. We use the TensorFlow library to create and compare the image classifiers. Are you looking for interesting deep learning projects that are suitable for beginners? Do not worry, this is not another MNIST image classification tutorial. Instead, we are going …

How to Classify Star Wars Lego Images using CNN and Transfer Learning Read More »

[Cheat Sheet] 6 Pillar Machine Learning Algorithms

This machine learning cheat sheet gives you a visual overview of 6 must-know machine learning algorithms (and where to learn more). Linear Regression: train your linear model to predict output values. K-Means Clustering: apply it on unlabeled data to find clusters and patterns in your data. K-Nearest Neighbors: use a similarity metric to find the …

[Cheat Sheet] 6 Pillar Machine Learning Algorithms Read More »

Logistic Regression in Python Scikit-Learn

Logistic regression is a popular algorithm for classification problems (despite its name indicating that it is a “regression” algorithm). It belongs to one of the most important algorithms in the machine learning space. Linear Regression Background Let’s review linear regression. Given the training data, we compute a line that fits this training data so that …

Logistic Regression in Python Scikit-Learn Read More »

Random Forest Classifier with sklearn

Does your model’s prediction accuracy suck but you need to meet the deadline at all costs? Try the quick and dirty “meta-learning” approach called ensemble learning. In this article, you’ll learn about a specific ensemble learning technique called random forests that combines the predictions (or classifications) of multiple machine learning algorithms. In many cases, it …

Random Forest Classifier with sklearn Read More »

SVM sklearn: Python Support Vector Machines Made Simple

Support Vector Machines (SVM) have gained huge popularity in recent years. The reason is their robust classification performance – even in high-dimensional spaces: SVMs even work if there are more dimensions (features) than data items. This is unusual for classification algorithms because of the curse of dimensionality – with increasing dimensionality, data becomes extremely sparse …

SVM sklearn: Python Support Vector Machines Made Simple Read More »

Python Scikit-Learn Decision Tree [Video + Blog]

Decision Trees are powerful and intuitive tools in your machine learning toolbelt. Decision trees are human-readable – in contrast to most other machine learning techniques. You can easily train a decision tree and show it to your supervisors who do not need to know anything about machine learning in order to understand how your model …

Python Scikit-Learn Decision Tree [Video + Blog] Read More »

Neural Networks with SKLearn MLPRegressor

Neural Networks have gained massive popularity in the last years. This is not only a result of the improved algorithms and learning techniques in the field but also of the accelerated hardware performance and the rise of General Processing GPU (GPGPU) technology. In this article, you’ll learn about the Multi-Layer Perceptron (MLP) which is one …

Neural Networks with SKLearn MLPRegressor Read More »

K-Nearest Neighbors (KNN) with sklearn in Python

The popular K-Nearest Neighbors (KNN) algorithm is used for regression and classification in many applications such as recommender systems, image classification, and financial data forecasting. It is the basis of many advanced machine learning techniques (e.g., in information retrieval). There is no doubt that understanding KNN is an important building block of your proficient computer …

K-Nearest Neighbors (KNN) with sklearn in Python Read More »

[Tutorial] K-Means Clustering with SKLearn in One Line

If there is one clustering algorithm you need to know – whether you are a computer scientist, data scientist, or machine learning expert – it’s the K-Means algorithm. In this tutorial drawn from my book Python One-Liners, you’ll learn the general idea and when and how to use it in a single line of Python …

[Tutorial] K-Means Clustering with SKLearn in One Line Read More »

How to Get the Current Value of a Variable in TensorFlow?

Problem Formulation Given a TensorFlow variable created with tf.Variable(). As this variable may have changed during the training process (e.g., using assign()), you want to get the current value of it. How to accomplish this in TensorFlow? Sessions Are Gone in TensorFlow 2 In TensorFlow 1, computations were performed within Sessions. That’s why many people …

How to Get the Current Value of a Variable in TensorFlow? Read More »

Sklearn fit() vs transform() vs fit_transform() – What’s the Difference?

Scikit-learn has a library of transformers to preprocess a data set. These transformers clean, generate, reduce or expand the feature representation of the data set. These transformers provide the fit(), transform() and fit_transform() methods. The fit() method identifies and learns the model parameters from a training data set. For example, standard deviation and mean for …

Sklearn fit() vs transform() vs fit_transform() – What’s the Difference? Read More »

How To Plot SKLearn Confusion Matrix With Labels?

Summary: The best way to plot a Confusion Matrix with labels, is to use the ConfusionMatrixDisplay object from the sklearn.metrics module. Another simple and elegant way is to use the seaborn.heatmap() function. Note: All the solutions provided below have been verified using Python 3.9.0b5. Problem Formulation Imagine the following lists of Actual and Predicted values …

How To Plot SKLearn Confusion Matrix With Labels? Read More »