Machine learning (ML) is a cornerstone of artificial intelligence, enabling models to learn from data and make predictions or decisions. In 2025, understanding the four main types of learning paradigms—supervised, unsupervised, semi-supervised, and reinforcement learning—is crucial for developing effective AI solutions. This post explains each paradigm and provides Python code snippets illustrating popular algorithms used today.
Supervised Learning Algorithms
Supervised learning uses labeled data to learn a mapping from input to output. Typical tasks: classification and regression.
- Regression Algorithms:
- Linear Regression
- Ridge Regression
- Lasso Regression
- Elastic Net Regression
- Support Vector Regression (SVR)
- Decision Tree Regression
- Random Forest Regression
- Gradient Boosting Regression (XGBoost, LightGBM, CatBoost)
- K-Nearest Neighbors Regression
- Classification Algorithms:
- Logistic Regression
- Naive Bayes (Gaussian, Multinomial, Bernoulli)
- Support Vector Machines (SVM)
- Decision Trees
- Random Forest
- Gradient Boosting (XGBoost, LightGBM, CatBoost, AdaBoost, etc.)
- K-Nearest Neighbors (KNN)
- Neural Networks (MLP, Deep Learning)
- Ensemble Methods (often supervised):
- Bagging (Bootstrap Aggregating)
- Boosting (XGBoost, LightGBM, CatBoost, AdaBoost)
- Stacking
- Voting Classifier
Python Example: Random Forest Classifier
from sklearn.ensemble import RandomForestClassifier
model = RandomForestClassifier(n_estimators=100)
model.fit(X_train, y_train)
preds = model.predict(X_test)
Unsupervised Learning Algorithms
Unsupervised learning discovers hidden patterns and structures in unlabeled data. Typical tasks: clustering, dimensionality reduction, association.
- Clustering:
- K-Means
- Hierarchical (Agglomerative/Divisive)
- DBSCAN
- OPTICS
- Affinity Propagation
- Gaussian Mixture Models (Expectation Maximization)
- BIRCH
- Dimensionality Reduction:
- Principal Component Analysis (PCA)
- Linear Discriminant Analysis (LDA)
- Independent Component Analysis (ICA)
- t-Distributed Stochastic Neighbor Embedding (t-SNE)
- Isomap
- Locally Linear Embedding (LLE)
- Autoencoders (Neural Networks)
- Association Rule Mining:
- Apriori
- FP-Growth
- ECLAT
Python Example: K-Means Clustering
from sklearn.cluster import KMeans
model = KMeans(n_clusters=3, random_state=42)
model.fit(X)
labels = model.labels_
Semi-Supervised Learning Algorithms
Semi-supervised learning uses both a small amount of labeled data and a large amount of unlabeled data. This approach is useful when labels are costly or rare.
- Label Propagation
- Label Spreading
- Semi-supervised SVM
- Self-training (pseudo-labeling)
- Graph-based Methods
- Co-training
- Transductive SVM (TSVM)
Python Example: Label Propagation
from sklearn.semi_supervised import LabelPropagation
model = LabelPropagation()
model.fit(X, y) # y contains -1 for unlabeled entries
Reinforcement Learning Algorithms
Reinforcement learning lets agents interact with environments, learning optimal strategies via trial, error, and rewards.
- Q-Learning
- SARSA
- Deep Q-Networks (DQN)
- Policy Gradient Methods (REINFORCE, Actor-Critic, A3C, PPO)
- Monte Carlo Methods
- Temporal Difference (TD) Learning
- TD(λ)
- Double DQN
- Deep Deterministic Policy Gradient (DDPG)
- Trust Region Policy Optimization (TRPO)
Python Example: Q-Learning Skeleton
# initialize Q-table: Q[state, action]
import numpy as np
Q = np.zeros((num_states, num_actions))
for episode in range(episodes):
state = env.reset()
done = False
while not done:
action = np.argmax(Q[state]) if np.random.uniform() > epsilon else env.action_sample()
next_state, reward, done, _ = env.step(action)
Q[state, action] += alpha * (reward + gamma * np.max(Q[next_state]) - Q[state, action])
state = next_state
Deep Learning Algorithms (Cutting-Edge)
Many deep learning models are used in supervised, unsupervised, and RL contexts:
- Artificial Neural Networks (ANNs / MLP)
- Convolutional Neural Networks (CNNs)
- Recurrent Neural Networks (RNNs)
- Long Short-Term Memory Networks (LSTM)
- Gated Recurrent Units (GRU)
- Transformers (BERT, GPT, T5, vision transformers)
- Autoencoders (for unsupervised/representation learning)
- Generative Adversarial Networks (GANs)
See full blog post at dl-algorithms
Python Example: MLP Classifier
from sklearn.neural_network import MLPClassifier
model = MLPClassifier(hidden_layer_sizes=(100, 50))
model.fit(X_train, y_train)
preds = model.predict(X_test)
Quick Table: Algorithms by Paradigm
| Paradigm | Key Algorithms |
|---|---|
| Supervised | Linear/Logistic Regression, SVM, Decision Tree, Random Forest, KNN, Naive Bayes, Gradient Boosting, Neural Nets, Ridge/Lasso/ElasticNet, SVR, GBTs |
| Unsupervised | K-Means, Hierarchical, DBSCAN, OPTICS, PCA, t-SNE, ICA, LDA, GMM, Isomap, Apriori, FP-Growth, ECLAT, Autoencoders |
| Semi-Supervised | Label Propagation, Label Spreading, Self-training, Graph-based, Co-training, TSVM |
| Reinforcement | Q-Learning, SARSA, DQN, Policy Gradient, Monte Carlo, TD-Learning, Actor-Critic, PPO, A3C |
| Deep Learning | MLP, CNN, RNN, LSTM, GRU, Transformers, GAN, Autoencoder |
References and More Reading
Sources & References
Note: This article includes AI-assisted writing and manual curation. Use at your own risk.