Neural network models
Inspired by the structure of the human brain made up of layers of interconnected “neurons” that process data in layers to find patterns and make predictions.
Most useful for complex, high-dimensional data with subtle patterns: e.g. image recognition, speech recognition.
Can use labelled inputs and same loss functions as regression algorithms.
Weights
A numeric value that determines how strongly the input from a neuron influences the next neuron’s output.
Biases
A numeric value which is added to a neuron’s weighted sum to alter it. This changes when a neuron ‘activates’ (activation functions shifted left/right) and adds offset to outputs. This helps the network learn offset and thresholds to fit the training data more flexibly.
No biases would severely limit the network’s ability to model complex or realistic patterns. Real data is messy and rarely centered around zero, so the model would have to “force” all its patterns to start from that point, making it much harder (or impossible) to fit the data accurately.
Back-propagation
A method for updating the weights and biases based on how wrong the previous prediction was. This is similar in purpose (but not method) to how gradient descent iteratively improves the accuracy of a model.
Benefits of OOP in ML
Overall, ML models and training/testing data can be structured and split into classes with methods, attributes and inheritance. Separate classes can handle data preprocessing, model training, and evaluation.
Feature engineering
This involves creating new features or transforming existing ones to improve the performance of ML models. It leverages domain knowledge and creativity to extract more meaningful information from the data.
Example:
Creating interaction terms: Combining existing features to capture relationships (e.g., multiplying age and income).
Preprocessing
This involves cleaning and structuring raw data to make it suitable for analysis and model training. The primary goal is to improve the quality of the dataset.
Examples:
- handling missing values
- transformation (standardisation)