Machine Learning Essentials (2 of 3)

Ronald Berry
6 min readOct 3, 2023

“Machine learning algorithms can figure out how to perform important tasks by generalizing from examples.” — Pedro Domingos

Source: useng

Introduction

In Part 1 of our exploration into Machine Learning Essentials, we introduced Machine Learning discussing types of Machine Learning and key terms.

Now, in Part 2, we’ll dig deeper and review the Machine Learning process.

Just like baking a cake involves a series of steps, Machine Learning follows a structured process. From gathering ingredients (data collection) to perfecting the recipe (model training), the Machine Learning process ensures that we create a predictive model that is not only accurate but also useful.

In Part 2 of Machine Learning Essentials, we’ll delve into the Machine Learning process where data is the raw material, and algorithms are the recipes for success (continuing our baking theme). In doing so, we’ll embark on a path that takes us through data acquisition, preparation, analysis, model selection, training, testing, adjustment, and deployment. Along the way, we’ll encounter crucial concepts to refine and validate our model such as feature extraction, evaluation metrics, overfitting, underfitting, and the essential technique of cross-validation.

This process ensures not only the accuracy of the model but also its real-world usefulness. Each of these elements plays a pivotal role in crafting robust and effective machine learning solutions.

Ok, let’s start baking (I’m getting hungry).

The Machine Learning Process

Source: Artificially Digital

In the ever-evolving landscape of machine learning, the journey from raw data to a fully functional model capable of making intelligent decisions is a meticulous and structured process. At the heart of this transformative journey lies a series of essential steps, each playing a pivotal role in shaping the ultimate success of the endeavor.

  1. Data Acquisition: Gathering relevant data that the model will learn from.
  2. Data Preparation: Cleaning, transforming, and preparing data for analysis.
  3. Data Wrangling: Occurs after data preprocessing and is employed when making the machine learning model. It involves cleaning the raw dataset into a format compatible with the machine learning models
  4. Data Analysis: Selecting the most important aspects of the data.
  5. Model Selection: Choosing the appropriate algorithm for the task.
  6. Model Training: Teaching the model using the training data.
  7. Model Testing: Evaluating the model on unseen data to ensure it generalizes well. Assessing the model’s performance using various metrics.
  8. Model Adjustment: Adjusting model parameters for better performance.
  9. Deployment: Implementing the model for real-world applications.

Each of these stages plays a vital role in the machine learning process, guiding data from its raw form to actionable intelligence, and ultimately, transforming complex algorithms into real-world solutions. The machine learning process is not merely a journey; it’s a masterpiece in the making, a testament to human ingenuity, where data meets intelligence.

Other Key Aspects of the Machine Learning Process

Feature Extraction

Imagine you’re building a facial recognition system. You wouldn’t want your algorithm to analyze every pixel in an image; that would be like studying each grain of sand on a beach.

Feature Extraction is the art of selecting the most relevant grains of sand to build an accurate mode. More specifically, Feature extraction involves selecting the most relevant data attributes to train a model effectively. It’s akin to focusing on specific traits when identifying a person from a crowd. Good feature extraction can greatly enhance a model’s performance.

Model Selection

Model Selection process involves choosing the most suitable algorithm or model architecture for a given task. It typically entails experimenting with various algorithms, assessing their performance using evaluation metrics, and selecting the model that best fits the problem’s characteristics and goals. Model Selection is a critical step as the choice of model significantly impacts a model’s accuracy and generalization to real-world data.

Model Training

Model Training is a fundamental step in machine learning, where the model learns patterns from data to make predictions. Training a Machine Learning model is like teaching a child to ride a bike. At first, there might be wobbles and falls (mistakes), but with time and guidance (data), the model becomes proficient at making predictions.

Evaluation Metrics

How do we know if our Machine Learning model is doing a good job? Evaluation Metrics are like the report card for our model’s performance. Evaluation Metrics measure how well a model generalizes to new, unseen data. Enabling the selection of the most suitable model. Evaluation Metrics are broken down into two categories — Classification Accuracy Metrics and Regression Metrics.

Evaluation Metrics are typical broken down into two groups:

how well a model generalizes to new, unseen data. Enabling the selection of the most suitable model. Evaluation Metrics are broken down into two categories — Classification Accuracy Metrics and Regression Metrics.

Source: Artificially Digital

Classification Accuracy Metrics: This is like sorting things into different categories. For example, deciding whether an item is a cake or not a cake is a classification task. Types of classification metrics include:

  1. Accuracy: Measures the proportion of correctly classified instances.
  2. Precision: Measures how many of the predicted positive instances were actually positive.
  3. Recall (Sensitivity): Measures how many of the actual positive instances were correctly predicted.
  4. F1-Score: A balance between precision and recall, useful when both false positives and false negatives need to be minimized.
  5. ROC-AUC (Receiver Operating Characteristic — Area Under the Curve): Evaluates a model’s ability to distinguish between two classes.

Regression Metrics: In regression, we’re not putting things into categories, but we’re trying to predict a number. For example, predicting the price of a cake based on its features is a regression task. Types of regression metrics include:

  1. Mean Squared Error (MSE): Measures the average squared difference between predicted and actual values.
  2. Root Mean Squared Error (RMSE): The square root of MSE, providing errors in the same units as the target variable.
  3. Mean Absolute Error (MAE): Measures the average absolute difference between predicted and actual values.
  4. R-squared (Coefficient of Determination): Measures the proportion of variance in the dependent variable explained by the model. A higher R-squared indicates a better fit.

These evaluation metrics help data scientists and machine learning practitioners assess the accuracy, precision, recall, and overall performance of their models, whether they’re dealing with classification tasks or regression problems. The choice of metric depends on the specific problem, the importance of false positives/negatives, and the nature of the data.

Cross-Validation

Cross-Validation is a technique used to assess a model’s performance by splitting the data into multiple subsets, ensuring robustness and that it generalizes well on unseen data to prevent overfitting. Think of Machine Learning models as cars, and your dataset as different terrains. Just as you’d test a car’s performance on various surfaces, we use cross-validation to ensure that our model works well in different scenarios, avoiding the pitfalls of overfitting.

Conclusion

The journey of machine learning is akin to the meticulous process of baking a cake. In Part 2 of Machine Learning Essentials, we have explored the essential steps feature extraction, model training, evaluation metrics, overfitting, underfitting, and cross-validation, all crucial for building effective models.

Join us in Part 3 of Machine Learning Essentials, as we close out our series and explore real-life applications of Machine Learning, ethical concerns, and glimpse into what the future holds.

About the Authors

Ronald (Ron) Berry is a Co-Founder of Artificially Digital. Ron has extensive global experience and success in the B2B and B2C digital transformation spaces in a variety of global industries ranging in size from startups to the Fortune 100.

Dr. Shams Syed is a Co-Founder of Artificially Digital. Dr. Syed has extensive experience in software development, particularly in the artificial intelligence (AI) space for several innovative startups. Dr. Syed is renowned for his research, contributions, and publications in essential programming techniques, machine learning, computer vision, algorithm optimizations, and natural language processing. Dr. Syed holds a PhD in computer science from University of South Carolina.

Contact info@artificiallydigital.com for more information.

--

--

Ronald Berry

Ronald Berry is an executive with global experience and success in B2B and B2C digital transformation in a variety of industries and companies.