All community articles
Public

Machine Learning Fundamentals: This is a cornerstone of modern AI.

Machine Learning allows systems to learn from data to make predictions or decisions without explicit programming. It encompasses Supervised Learning (predicting continuous values with Regression or categories with Classification from labeled data), Unsupervised Learning (finding patterns in unlabeled data), and Reinforcement Learning (learning through trial and error).

Machine Learning (ML) is a subfield of AI that enables systems to learn from data, identify patterns, and make decisions with minimal human intervention. Instead of being explicitly programmed for every possible scenario, ML models are "trained" on data to learn relationships and predict outcomes or discover hidden structures.

### Supervised Learning

Supervised learning is a type of machine learning where the model learns from labelled data. This means that for each input in the training dataset, there is a corresponding correct output. The model's goal is to learn a mapping function from the input to the output so that it can accurately predict the output for new, unseen inputs.

* Regression:
* Purpose: To predict a continuous numerical value.
* Examples: Predicting house prices based on features like size and location, forecasting stock prices, estimating a person's age based on their image, or predicting temperature.
* Common Algorithms: Linear Regression, Polynomial Regression, Decision Trees, Random Forests, Support Vector Regression (SVR).
* How it works: The model learns the relationship between input features and a continuous target variable. For instance, in linear regression, it tries to find the best-fitting line that minimises the error between predicted and actual values.

* Classification:
* Purpose: To predict a categorical label or class.
* Examples: Classifying emails as spam or not spam, identifying whether an image contains a cat or a dog, diagnosing a disease (e.g., benign or malignant tumour), or determining if a customer will churn.
* Common Algorithms: Logistic Regression, K-Nearest Neighbors (KNN), Support Vector Machines (SVM), Decision Trees, Random Forests, Naive Bayes.
* How it works: The model learns to assign input data points to one of several predefined categories. For example, a spam classifier learns patterns in email text and sender information to decide if an email belongs to the "spam" category or "not spam."

### Unsupervised Learning

Unsupervised learning deals with unlabelled data. In this scenario, the model is given input data without any corresponding output labels. The goal is to discover hidden patterns, structures, or relationships within the data itself.

* Clustering:
* Purpose: To group similar data points together into clusters.
* Examples: Customer segmentation (grouping customers with similar purchasing behaviours), anomaly detection (identifying unusual data points that don't fit into any cluster), organising large datasets, or image segmentation.
* Common Algorithms: K-Means, Hierarchical Clustering, DBSCAN.
* How it works: Algorithms identify inherent groupings in the data based on similarity. For instance, K-Means aims to partition 'n' observations into 'k' clusters in which each observation belongs to the cluster with the nearest mean.

* Dimensionality Reduction:
* Purpose: To reduce the number of features (dimensions) in a dataset while retaining as much important information as possible. This is useful for visualisation, reducing computational cost, and mitigating the "curse of dimensionality."
* Examples: Compressing images, noise reduction in data, preparing data for other machine learning algorithms, or visualising high-dimensional data in 2D or 3D.
* Common Algorithms: Principal Component Analysis (PCA), t-Distributed Stochastic Neighbour Embedding (t-SNE), Linear Discriminant Analysis (LDA).
* How it works: These algorithms transform the data into a lower-dimensional space. PCA, for example, finds new orthogonal dimensions (principal components) that capture the maximum variance in the data.

### Reinforcement Learning (Basic Concepts)

Reinforcement Learning (RL) is a type of machine learning where an "agent" learns to make decisions by interacting with an environment. The agent receives rewards for desirable actions and penalties for undesirable ones, with the ultimate goal of maximising its cumulative reward over time.

* Key Components:
* Agent: The learner or decision-maker.
* Environment: The world with which the agent interacts.
* State: The current situation of the agent in the environment.
* Action: A move made by the agent in a given state.
* Reward: A feedback signal from the environment, indicating how good or bad an action was.
* Policy: The strategy that the agent uses to determine its next action based on the current state.
* How it works: The agent performs an action in a state, the environment transitions to a new state and provides a reward. The agent learns through trial and error, adjusting its policy to choose actions that lead to higher rewards.
* Examples: Training AI to play games (e.g., AlphaGo, chess), robotics (teaching robots to perform tasks), autonomous driving, resource management.