Module 2: Basics of Machine Learning
What is Machine Learning?
Machine Learning (ML) is a subset of Artificial Intelligence (AI) that enables systems to learn and improve from experience without explicit programming. It involves training models using data to make predictions, classify information, or recognize patterns. ML is widely used in applications like speech recognition, recommendation systems, fraud detection, and medical diagnosis.
Supervised vs. Unsupervised Learning
Machine learning is categorized mainly into Supervised Learning and Unsupervised Learning:
1️⃣ Supervised Learning
- The model is trained using labeled data (input-output pairs).
- The goal is to learn a mapping function from inputs (features) to outputs (labels).
- Examples:
- Spam detection (emails labeled as “spam” or “not spam”)
- House price prediction (features: area, location, number of rooms → output: price)
- Popular algorithms: Linear Regression, Logistic Regression, Decision Trees, Random Forest, Support Vector Machines (SVM), Neural Networks
2️⃣ Unsupervised Learning
- The model is trained using unlabeled data, finding patterns and structures without predefined outputs.
- It is mainly used for clustering and dimensionality reduction.
- Examples:
- Customer segmentation (grouping customers based on behavior)
- Anomaly detection (detecting fraudulent transactions)
- Popular algorithms: K-Means Clustering, DBSCAN, Principal Component Analysis (PCA), Autoencoders
Introduction to Neural Networks
Neural Networks are inspired by the human brain and consist of layers of artificial neurons that process information.
Basic Structure of a Neural Network
- Input Layer: Takes raw data (features).
- Hidden Layers: Perform computations and extract patterns.
- Output Layer: Produces the final prediction or classification.
Types of Neural Networks:
- Feedforward Neural Networks (FNNs) – Basic deep learning models.
- Convolutional Neural Networks (CNNs) – Used for image processing.
- Recurrent Neural Networks (RNNs) – Used for time series and sequential data.
- Transformers – Advanced architectures used in NLP (e.g., GPT, BERT).
Popular ML Algorithms
Here are some of the most widely used machine learning algorithms:
Supervised Learning Algorithms
- Linear Regression – Predicts continuous values (e.g., sales prediction).
- Logistic Regression – Used for binary classification (e.g., spam detection).
- Decision Trees – Splits data into branches to make decisions.
- Random Forest – An ensemble of decision trees for better accuracy.
- Support Vector Machines (SVM) – Finds optimal decision boundaries for classification.
- Neural Networks – Deep learning-based powerful models.
Unsupervised Learning Algorithms
- K-Means Clustering – Groups similar data points.
- Hierarchical Clustering – Creates a tree-like clustering structure.
- DBSCAN – Detects dense clusters in data.
- Principal Component Analysis (PCA) – Reduces dimensionality while preserving information.
Reinforcement Learning (Bonus)
- Q-Learning – A model-free reinforcement learning technique.
- Deep Q-Networks (DQN) – Combines Q-learning with deep learning.
- Policy Gradient Methods – Learn policies to optimize rewards.