Machine Learning (ML) is a subset of **Artificial Intelligence (AI)** that enables systems to learn from data and improve their performance over time without being explicitly programmed. Instead of following predefined rules, ML models discover patterns in data to make predictions, recognize trends, or automate decision-making. ![[EN-machine-learning-vs-deep-learning 1.png | 400]] ML is revolutionizing industries by allowing computers to **adapt autonomously**. Unlike traditional programming, where a developer provides explicit instructions, ML models learn from data. It powers innovations such as: - **Recommendation Systems** (Netflix, YouTube, Spotify) - **Autonomous Vehicles** (Self-driving cars) - **Natural Language Processing (NLP)** (Chatbots, Translation) - **Predictive Analytics** (Stock market, Healthcare) ## Types of Machine Learning Machine learning techniques can be broadly categorised into three types: ### Supervised Learning Supervised learning is a category of machine learning where algorithms are trained on labeled datasets to predict outcomes or recognize patterns. In this approach, the algorithm learns from examples that have both input data and corresponding correct output values. #### Key Characteristics - **Labeled Data**: Training data includes both input features and the correct output values (labels). - **Teacher-Student Model**: Similar to learning from a teacher who provides examples with correct answers. - **Mapping Function**: The algorithm learns to map inputs to outputs based on the training examples. #### Types of Supervised Learning 1. [[Classification]] - Predicts categorical outputs (discrete classes) - Examples: - Binary classification (spam/not spam, fraud/legitimate) - Multi-class classification (grading students as A, B, C, D, F) - Image recognition (identifying objects in photos) 2. [[Regression]] - Predicts continuous numerical values - Examples: - Price prediction - Temperature forecasting - Sales forecasting #### Applications - Fraud detection systems - Email spam filters - Medical diagnosis - Image and speech recognition - Predictive analytics - Customer behavior prediction #### Process 1. Data collection and labeling 2. Feature selection and preprocessing 3. Algorithm selection 4. Model training using labeled data 5. Model evaluation and validation 6. Deployment for making predictions on new data #### Advantages - Generally more accurate than unsupervised learning - Clear evaluation metrics for model performance - Well-suited for prediction tasks - Easier to understand the learning process #### Challenges - Requires large amounts of labeled data - Labeling data can be time-consuming and expensive - Risk of overfitting to training data - May struggle with previously unseen patterns ### Unsupervised Learning Unsupervised learning is a branch of machine learning where algorithms analyze unlabeled data to discover hidden patterns, structures, and relationships without explicit guidance. Unlike supervised learning, there are no predefined output labels to guide the learning process. #### Key Characteristics - **No Labeled Data**: Works with raw, unlabeled data - **Self-Organization**: Algorithms identify patterns on their own - **Exploratory Analysis**: Often used to gain insights into data structure - **Pattern Discovery**: Finds relationships and structures that may not be obvious #### Types of Unsupervised Learning 1. [[Clustering]] - Groups similar data points together based on inherent similarities - Examples: - K-means clustering - Hierarchical clustering - DBSCAN (Density-Based Spatial Clustering of Applications with Noise) - Mean-shift clustering 2. [[Association]] - Discovers rules that describe relationships between variables - Examples: - Apriori algorithm - FP-growth algorithm - Market basket analysis 3. [[Dimensionality Reduction]] - Reduces the number of features while preserving data integrity - Examples: - Principal Component Analysis (PCA) - t-SNE (t-Distributed Stochastic Neighbor Embedding) - Autoencoders - Feature selection techniques 4. [[Anomaly Detection]] - Identifies outliers or unusual patterns in data - Examples: - Isolation Forest - One-class SVM - Autoencoders for anomaly detection #### Applications - **Customer Segmentation**: Grouping customers with similar behaviors - **Recommendation Systems**: Finding patterns in user preferences - **Market Basket Analysis**: Discovering product associations - **Image and Text Processing**: Extracting features and patterns - **Anomaly Detection**: Identifying fraud or system failures - **Feature Learning**: For use in other machine learning tasks - **Data Visualization**: Reducing dimensions for better visualization #### Process 1. Data collection and preprocessing 2. Algorithm selection based on the problem 3. Model training on unlabeled data 4. Pattern interpretation and evaluation 5. Application of discovered insights #### Advantages - No need for labeled data, which can be costly to obtain - Can discover hidden patterns not obvious to humans - Useful for exploratory data analysis - Can handle complex, high-dimensional data - Foundation for many generative AI models #### Challenges - Results can be difficult to interpret - Evaluating model performance is more subjective - May discover patterns that aren't relevant or useful - Often requires more data than supervised approaches - Computing resource requirements can be high for large datasets ### Reinforcement Learning [[Reinforcement Learning]] (RL) is a type of machine learning where an agent learns to make decisions by interacting with an environment to maximize a reward signal. The agent learns through trial and error, receiving feedback in the form of rewards or penalties for its actions. ## Key Characteristics - **Agent-Environment Interaction**: The agent takes actions in an environment and receives feedback - **Reward Signal**: Provides feedback on the quality of actions taken - **No Direct Supervision**: Unlike supervised learning, there are no labeled examples of correct actions - **Sequential Decision Making**: Focuses on making a series of decisions over time - **Delayed Rewards**: Feedback may come after multiple actions, creating a credit assignment problem ## Core Components 1. **Agent**: The learner or decision-maker 2. **Environment**: The world with which the agent interacts 3. **State**: The current situation of the agent in the environment 4. **Action**: What the agent can do in each state 5. **Reward**: Feedback signal indicating how good an action was 6. **Policy**: The strategy the agent follows to determine actions 7. **Value Function**: Prediction of future rewards for states or actions ## Types of Reinforcement Learning 1. **Value-Based Methods** - Focus on estimating the value of states or actions - The agent selects actions based on these value estimates - Examples: - Q-Learning: Learns the value of action-state pairs - Deep Q-Networks (DQN): Combines Q-learning with deep neural networks 2. **Policy-Based Methods** - Directly learn the optimal policy without estimating value functions - Optimize the policy directly through gradient-based methods - Examples: - Policy Gradient: Updates policy parameters to maximize expected rewards - Proximal Policy Optimization (PPO): Improves training stability ## Applications - Game playing (Chess, Go, video games) - Robotics and autonomous vehicles - Resource management and scheduling - Personalised recommendations - Trading and finance - Healthcare treatment planning ## Key Challenges - Exploration vs. Exploitation trade-off - Credit assignment for delayed rewards - Sample efficiency - Generalisation to new situations - Stability during learning --- ### Resources for Learning Machine Learning #### Books 1. [_Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow_ - Aurelien Geron](http://14.139.161.31/OddSem-0822-1122/Hands-On_Machine_Learning_with_Scikit-Learn-Keras-and-TensorFlow-2nd-Edition-Aurelien-Geron.pdf) 2. _Pattern Recognition and Machine Learning_ - Christopher M. Bishop 3. [_The Hundred-Page Machine Learning Book_ - Andriy Burkov](https://themlbook.com/) #### Online Courses 1. [Coursera - Machine Learning (Andrew Ng)](https://www.coursera.org/learn/machine-learning) - Famous Machine Learning Course Series Offered by Andrew Ng 2. [Fast.ai - Practical Deep Learning for Coders](https://course.fast.ai/) 3. [MIT OpenCourseWare - Introduction to Deep Learning](http://introtodeeplearning.com/) ##### Video Tutorials 1. [Machine Learning Full Course](https://www.youtube.com/watch?v=7eh4d6sabA0) - Beginner-friendly machine learning tutorial uses real-world data. 2. [Machine Learning Basics - Playlist](https://www.youtube.com/watch?v=gmvvaobm7eQ&list=PLeo1K3hjS3uvCeTYTeyfe0-rN5r8zn9rw) - Beginner-friendly machine learning playlist with mathematical explanations with deeper understandings #### Practical Learning Platforms 1. [Kaggle](https://www.kaggle.com) - Datasets, ML competitions & notebooks. 2. Google Colab - Free Jupyter notebook environment with GPUs. 3. [Hugging Face](https://huggingface.co/) - NLP & transformer models. --- ## Next Steps - Explore **Supervised Learning** → [[Regression]] | [[Classification]] - Dive into **Unsupervised Learning** → [[Clustering]] | [[Dimensionality Reduction]] - Understand **Neural Networks** → [[Deep Learning]]