Elena' s AI Blog

Machine Learning Series

Elena Daehnhardt

Midjourney AI-generated art
Image credit: Illustration created with Midjourney, prompt by the author.
Image prompt

“An illustration representing cloud computing”

Machine Learning: From Foundations to Fine-Tuning

This series is ordered from beginner concepts to advanced practice. Start at Part 1 and build up.

Series Progress

14 of 14 posts published


Learning Path

Part 1: Deep Learning vs Machine Learning

Artificial Intelligence (AI) is a field of computer science. AI provides methods and algorithms to mimic human intelligence, reasoning, and decision-making and provide insights, which businesses could use in research or industry to build new exciting and innovative products or services. Machine Learning (ML) is a subset of AI with algorithms that learn from data. In this post, we sort out the differences between AI and ML.

Deep Learning vs Machine Learning

Part 2: Tools and Data to Experiment with Machine Learning

Python open-source library scikit-learn provides a comprehensive selection of machine learning techniques (regression, classification, clustering), feature selection, metrics, preprocessing, and other functionality. At this moment, Scikit-learn, is lacking deep learning functionality; however, we can use TensorFlow with the Scikit Flow wrapper for creating neural networks using the Scikit-learn approach.

Tools and Data to Experiment with Machine Learning

Part 3: Feature preprocessing

Machine Learning algorithms often require that data is in a specific type. For instance, we can use only numerical data. In other cases, ML algorithms would perform better or converge faster when we preprocess data before training the model. Since we do this step before training the model, we call it preprocessing.

Feature preprocessing

Part 4: TensorFlow: Regression Model

I have described regression modeling in TensorFlow. We have predicted a numerical value and adjusted hyperparameters to better model performance with a simple neural network. We generated a dataset, demonstrated a simple data split into training and testing sets, visualised our data and the created neural network, evaluated our model using a testing dataset.

TensorFlow: Regression Model

Part 5: TensorFlow: Evaluating the Regression Model

In this post, we have performed the evaluation of four regression models using TensorFlow. MAE and MSE error metrics were used to compare the Sequential models while finding the best neural network architecture regarding the defined hyperparameters.

TensorFlow: Evaluating the Regression Model

Part 6: TensorFlow: Multiclass Classification Model

In Machine Learning, the classification problem is categorising input data into different classes. For instance, we can categorise email messages into two groups, spam or not spam. In this case, we have two classes, we talk about binary classification. When we have more than two classes, we talk about multiclass classification. In this post, I am going to address the latest multiclass classification, on the example of categorising clothing items into clothing types.

TensorFlow: Multiclass Classification Model

Part 7: TensorFlow: Convolutional Neural Networks for Image Classification

In this post, I have demonstrated CNN usage for birds recognition using TensorFlow and Kaggle 400 birds species dataset. We observed how the model works with the original and augmented images.

TensorFlow: Convolutional Neural Networks for Image Classification

Part 8: TensorFlow: Transfer Learning (Feature Extraction) in Image Classification

Image classification is a complex task. However, we can approach the problem while reusing state-of-the-art pre-trained models. Using previously learned patterns from other models is named "Transfer Learning." This way, we can efficiently apply well-tested models, potentially leading to excellent performance.

TensorFlow: Transfer Learning (Feature Extraction) in Image Classification

Part 9: TensorFlow: Transfer Learning (Fine-Tuning) in Image Classification

We used a 400 species birds dataset for building bird species predictive models based on EffeicientNetB0 from Keras. The baseline model showed already an excellent Accuracy=0.9845. However, data augmentation did not help in improving accuracy, which slightly lowered to 0.9690. Further, this model with a data augmentation layer was partially unfrozen, retrained with a lower learning rate, and reached an Accuracy=0.9850.

TensorFlow: Transfer Learning (Fine-Tuning) in Image Classification

Part 10: TensorFlow: Evaluating the Saved Bird Species Prediction Model

In this post, I have described the process of in-depth model evaluation. I have reused the previously created EffecientNetB0 model, which is fine-tuned with the 400 Bird Species Kaggle dataset. As a result, I have found out which bird species are not well predicted.

TensorFlow: Evaluating the Saved Bird Species Prediction Model

Part 11: Machine Learning Tests using the Titanic dataset

In this post, we created and evaluated several machine-learning models using the Titanic Dataset. We have compared the performance of the Logistic Regression, Decision Tree and Random Forest from Python's library scikit-learn and a Neural Network created with TensorFlow. The Random Forest Performed the best!

Machine Learning Tests using the Titanic dataset

Part 12: Decision Tree versus Random Forest, and Hyperparameter Optimisation

Decision trees, with their elegant simplicity and transparency, stand in stark contrast to the robust predictive power of Random Forest, an ensemble of trees. In this post, we compare the key distinctions, advantages, and trade-offs between these two approaches. We will use Scikit-Learn for training and testing both models and also perform hyperparameter optimisation to find both model parameters for improved performance.

Decision Tree versus Random Forest, and Hyperparameter Optimisation

Part 13: Cross-Validation Techniques

Building a machine learning model is easy; proving it actually works on unseen data is the hard part. In this post, we cover cross-validation techniques—from traditional K-Fold to Stratified and Time-Series splits—using hands-on examples in scikit-learn.

Cross-Validation Techniques

Part 14: LoRA fine-tuning wins

You no longer need to retrain entire language models. LoRA allows you to teach new capabilities via tiny adapters. Here is the architectural code, deployment cheat sheets, and production pitfalls.

LoRA fine-tuning wins

Start Here

Start with Part 1: Deep Learning vs Machine Learning.

All Posts