Category Archives: Machine Learning

Python – Replace Missing Values with Mean, Median & Mode

Boxplot for deciding whether to use mean, mode or median for imputation

Missing values are common in dealing with real-world problems when the data is aggregated over long time stretches from disparate sources, and reliable machine learning modeling demands for careful handling of missing data. One strategy is imputing the missing values, and a wide variety of algorithms exist spanning simple interpolation (mean. median, mode), matrix factorization methods like SVD, statistical models like Kalman filters, and deep learning methods. Missing value imputation or replacing techniques help machine learning models learn from incomplete data. There are three main missing value imputation techniques – mean, median and mode. Mean is the average of all values in a set, median is the middle number in …

Continue reading

Posted in Data Science, Machine Learning, Python. Tagged with , , .

Feature Selection vs Feature Extraction: Machine Learning

Feature extraction vs feature selection

Machine learning has become an increasingly important tool for businesses and researchers alike in recent years. From identifying patterns in data to making predictions about future outcomes, machine learning algorithms are now being used in a wide variety of fields. However, the success of these algorithms often depends on the quality of the features used to train them. This is where the concepts of feature selection and feature extraction come in. In this blog post, we’ll explore the difference between feature selection and feature extraction, two key techniques used in machine learning to optimize feature sets for better model performance. Both feature selection and feature extraction are used for dimensionality …

Continue reading

Posted in Data Science, Machine Learning. Tagged with , .

Keras: Multilayer Perceptron (MLP) Example


Artificial Neural Networks (ANN) have emerged as a powerful tool in machine learning, and Multilayer Perceptron (MLP) is a popular type of ANN that is widely used in various domains such as image recognition, natural language processing, and predictive analytics. Keras is a high-level API that makes it easy to build and train neural networks, including MLPs. In this blog, we will dive into the world of MLPs and explore how to build and train an MLP model using Keras. We will build a simple MLP model using Keras and train it on a dataset. We will explain different aspects of training MLP model using Keras. By the end of …

Continue reading

Posted in Deep Learning, Machine Learning. Tagged with , .

Neural Network & Multi-layer Perceptron Examples

Single layer neural network

Neural networks are an important part of machine learning, so it is essential to understand how they work. A neural network is a computer system that has been modeled based on a biological neural network comprising neurons connected with each other. It can be built to solve machine learning tasks, like classification and regression problems. The perceptron algorithm is a representation of how neural networks work. The artificial neurons were first proposed by Frank Rosenblatt in 1957 as models for the human brain’s perception mechanism. This post will explain the basics of neural networks with a perceptron example. You will understand how a neural network is built using perceptrons. This …

Continue reading

Posted in Data Science, Deep Learning, Machine Learning. Tagged with , .

K-Fold Cross Validation – Python Example

K-Fold Cross Validation Concepts with Python and Sklearn Code Example

In this post, you will learn about K-fold Cross-Validation concepts with Python code examples. K-fold cross-validation is a data splitting technique that can be implemented with k > 1 folds. K-Fold Cross Validation is also known as k-cross, k-fold cross-validation, k-fold CV, and k-folds. The k-fold cross-validation technique can be implemented easily using Python with scikit learn (Sklearn) package which provides an easy way to calculate k-fold cross-validation models.  It is important to learn the concepts of cross-validation concepts in order to perform model tuning with the end goal to choose a model which has a high generalization performance. As a data scientist / machine learning Engineer, you must have a good …

Continue reading

Posted in Data Science, Machine Learning, Python. Tagged with , , , .

Maximum Likelihood Estimation: Concepts, Examples

maximum likelihood estimation likelihood function

As data science continues to grow in importance and relevance, so too does the need for tools and techniques that can help extract insights from large, complex datasets. One such tool that is becoming increasingly popular among data scientists is Maximum Likelihood Estimation (MLE). This is becoming more so important to learn fundamentals of MLE concepts as it is at the core of generative modeling (generative AI). MLE is a statistical method used to estimate the parameters of a probability distribution, based on a set of observed data points. MLE is particularly important for data scientists because it underpins many of the probabilistic machine learning models that are used today. …

Continue reading

Posted in Data Science, Machine Learning. Tagged with , .

Generative vs Discriminative Models: Examples

generative vs discriminative models

The field of machine learning is rapidly evolving, and with it, the concepts and techniques that are used to develop models that can learn from data. Among these concepts, generative and discriminative models are two widely used approaches in the field. Generative models learn the joint probability distribution of the input features and output labels, whereas discriminative models learn the conditional probability distribution of the output labels given the input features. While both models have their strengths and weaknesses, understanding the differences between them is crucial to developing effective machine learning systems. Real-world problems such as speech recognition, natural language processing, and computer vision, require complex solutions that are able …

Continue reading

Posted in Data Science, Machine Learning. Tagged with , .

Accuracy, Precision, Recall & F1-Score – Python Examples

Classification models are used in classification problems to predict the target class of the data sample. The classification model predicts the probability that each instance belongs to one class or another. It is important to evaluate the performance of the classifications model in order to reliably use these models in production for solving real-world problems. Performance measures in machine learning classification models are used to assess how well machine learning classification models perform in a given context. These performance metrics include accuracy, precision, recall, and F1-score. Because it helps us understand the strengths and limitations of these models when making predictions in new situations, model performance is essential for machine learning. …

Continue reading

Posted in Data Science, Machine Learning, Python. Tagged with , , , .

Neural Network Types & Real-life Examples

deep neural network examples from real-life

Neural networks are a powerful tool for data scientists, machine learning engineers, and statisticians. They have revolutionized the field of machine learning and have become an integral part of many real-world applications such as image and speech recognition, natural language processing, and autonomous vehicles. ChatGPT is a classic example how AI / neural network applications has taken world by storm. But what exactly are they and what are their different types? There are various types of neural networks, each with their own unique architecture and learning algorithm. Understanding the different types of neural networks and their real-life examples is crucial for anyone interested in machine learning and artificial intelligence. In …

Continue reading

Posted in Deep Learning, Machine Learning. Tagged with , .

Sequence to Sequence Models: Types, Examples

sequence-to-sequence model

Sequence to sequence (Seq2Seq) modeling is a powerful machine learning technique that has revolutionized the way we do natural language processing (NLP). It allows us to process input sequences of varying lengths and produce output sequences of varying lengths, making it particularly useful for tasks such as language translation, speech recognition, and chatbot development.  Sequence to sequence modeling also provides a great foundation for creating text summarizers, question answering systems, sentiment analysis systems, and more. With its wide range of applications, learning about sequence to sequence modeling concepts is essential for anyone who wants to work in the field of natural language processing. This blog post will discuss types of …

Continue reading

Posted in Data Science, Machine Learning, NLP. Tagged with , , , .

Hypothesis Testing Steps & Examples

Hypothesis Testing Workflow

Hypothesis testing is a technique that helps scientists, researchers, or for that matter, anyone test the validity of their claims or hypotheses about real-world or real-life events in order to establish new knowledge. Hypothesis testing techniques are often used in statistics and data science to analyze whether the claims about the occurrence of the events are true, whether the results returned by performance metrics of machine learning models are representative of the models or they happened by chance. This blog post will cover some of the key statistical concepts including steps and examples in relation to what is hypothesis testing, how to formulate them and how to use them in …

Continue reading

Posted in AI, Data Science, Machine Learning. Tagged with , , , .

Machine Learning Bias Explained with Examples

machine learning models bias variance vs complexity

In the artificial intelligence (AI) / machine learning (ML) powered world where predictive models have started getting used more often in decision-making areas, the primary concerns of policy makers, auditors and end users have been to make sure that these systems using the models are not making biased/unfair decisions based on model predictions (intentional or unintentional discrimination). Imagine industries such as banking, insurance, and employment where models are used as solutions to decision-making problems such as shortlisting candidates for interviews, approving loans/credits, deciding insurance premiums etc. How harmful it could be to the end users as these decisions may impact their livelihood based on biased predictions made by the model, thereby, …

Continue reading

Posted in AI, Data Science, Machine Learning. Tagged with , , .

Machine Learning Concepts & Examples

Machine Learning Modeling Workflow

Machine learning is a machine’s ability to learn from data. It has been around for decades, but machine learning is now being applied in nearly every industry and job function. In this blog post, we’ll cover a detailed introduction to what is machine learning (ML) including different definitions. We will also learn about different types of machine learning tasks, algorithms, etc along with real-world examples. What is machine learning & how does it work? Simply speaking, machine learning can be used to model our beliefs about real-world events. For example, let’s say a person came to a doctor with a certain blood report. A doctor based on his belief system …

Continue reading

Posted in Data Science, Deep Learning, Machine Learning. Tagged with , , .

Ensemble Methods in Machine Learning: Examples

voting ensemble method

Machine learning models are often trained with a variety of different methods in order to create a more accurate prediction. Ensemble methods are one way to do this, and involve combining the predictions of several different models in order to get a more accurate result. When different models make predictions together, it can help create a more accurate result. Data scientists should care about this because it can help them create models that are more accurate. In this article, we will look at some of the common ensemble methods used in machine learning. Data scientists should care about this because it can help them create models that are more accurate. …

Continue reading

Posted in Data analytics, Data Science, Machine Learning. Tagged with , .

Random Forest Classifier Python Example

random forest classifier machine learning

Random forest classifiers are popular machine learning algorithms that are used for classification. In this post, you will learn about the concepts of random forest classifiers and how to train a Random Forest Classifier using the Python Sklearn library. This code will be helpful if you are a beginner data scientist or just want to quickly get a code sample to get started with training a machine learning model using the Random Forest algorithm. The following topics will be covered: What is a Random Forest Classifier & How do they Work? Random forests are a type of machine learning algorithm that is used for classification and regression tasks. A classifier …

Continue reading

Posted in AI, Data Science, Machine Learning, Python. Tagged with , , .

CART Decision Tree Python Example

CART Decision Tree CLassifier

The Classification and Regression Tree (CART) is a supervised machine learning algorithm used for classification, regression. In this blog, we will discuss what CART decision tree is, how it works, and provide a detailed example of its implementation using Python. What is CART & How does it work? CART stands for Classification And Regression Tree. It is a type of decision tree which can be used for both classification and regression tasks based on non-parametric supervised learning method. The following represents the algorithm steps. First and foremost, the data is split into training and test set.  Take a feature K and split the training data set into two subsets based on …

Continue reading

Posted in Data Science, Machine Learning. Tagged with , .