{
  "source_file": "0930",
  "source_platform": "Hashnode",
  "author": "Muhammad Fahad Bashir",
  "title_listed": "Introduction to Supervised Learning",
  "keywords": "",
  "domain": "机器学习",
  "content_type": "深度技术解析",
  "is_paid_flag": "否",
  "url": "https://ml-diaries-by-fahd.hashnode.dev/introduction-to-supervised-learning",
  "publish_date": "2025-09-27",
  "corpus_stage": "",
  "notes": "",
  "id": "276d545a5e9b",
  "collected_at": "2026-10-02T14:10:55",
  "title": "Introduction to Supervised Learning",
  "body_markdown": "Introduction to Supervised Learning\nUpdated\nJanuary 11, 2026\n•\n4\nmin read\n•\nView as Markdown\nM\nMuhammad Fahad Bashir\nMachine Learning, Artificial Intelligence\nPart of series\nSupervise Learning\nMachine Learning can be broadly divided into different types, and as we covered earlier in our\narticle (type of machine learning & basic workflow)\n, one of the most widely used types is\nSupervised Learning\n. It’s the foundation behind many AI systems we interact with every day, from spam filters in our email to recommendation systems on Netflix.\nWhat is Supervised Learning?\nSupervised learning is a type of machine learning where a model learns from\nlabeled data\n. This means the dataset already contains both the\ninput (features)\nand the\noutput (target/label)\n.\n👉 Example: Suppose we have animal images with their names (cat, dog, horse). Here, the images are the inputs, and the names are the outputs. The model learns to map inputs → outputs so it can predict the correct label for new data.\nTypes of Supervised Learning\nSupervised learning can be broadly divided into\ntwo main types\n:\nBut here’s the key: the\ntype of problem\ndetermines the algorithm you should choose. If you want to classify something into categories, you use classification algorithms; if you want to predict continuous values, you use regression algorithms.\n1. Classification\nIn classification, the goal is to predict a\ncategory or class label\n.\nExample: Predicting whether an email is\nspam\nor\nnot spam\n.\nCommon Algorithms for Classification:\nLogistic Regression\n→ Despite its name, used for classification (e.g., spam or not spam).\nDecision Trees\n→ Splits data into branches based on conditions for easy interpretability.\nRandom Forests\n→ A collection of decision trees that vote for the best class.\nSupport Vector Machines (SVM)\n→ Finds the best boundary (hyperplane) that separates classes.\nk-Nearest Neighbors (kNN)\n→ Classifies based on the majority label of the nearest neighbors.\n2. Regression\nIn regression, the goal is to predict a\ncontinuous numerical value\n.\nExample: Predicting house prices based on size, location, and number of rooms.\nCommon Algorithms for Regression:\nLinear Regression\n→ Models the relationship between features and target using a straight line.\nDecision Trees\n→ Splits numerical ranges into regions to predict values.\nRandom Forests\n→ Uses multiple trees to give more stable numerical predictions.\nSupport Vector Machines (SVM)\n→ Can also predict continuous values by fitting the best line.\nNeural Networks\n→ Can learn non-linear relationships for complex regression problems.\nGeneral Workflow of Supervised Learning\nNo matter which algorithm you use, the basic workflow remains the same:\nCollect Data\n→ Gather labeled data (features + target).\nPreprocess Data\n→ Handle missing values, outliers, scaling, and encoding.\nSplit Data\n→ Divide into training and testing sets (commonly 70/30).\nChoose the Algorithm\n→ Based on the type of problem (classification or regression), select the most suitable algorithm (e.g., Logistic Regression for classification, Linear Regression for prediction of continuous values).\nTrain the Model\n→ Use the training data to learn patterns.\nEvaluate the Model\n→ Test it on unseen data and measure performance using appropriate metrics (accuracy, precision, recall for classification; MSE, RMSE for regression).\nDeploy & Improve\n→ Fine-tune hyperparameters, add more data, or try different algorithms to improve performance.\nApplications of Supervised Learning\nSupervised learning is everywhere around us. Some common applications include:\nSpam Email Detection\n→ Classify emails as spam or not.\nSentiment Analysis\n→ Detect whether a review is positive or negative.\nMedical Diagnosis\n→ Predict if a patient has a certain disease based on symptoms.\nCredit Scoring\n→ Predict if a customer is likely to default on a loan.\nRecommendation Systems\n→ Suggest movies, products, or songs based on past preferences.\nConclusion\nSupervised Learning is the foundation of many real-world machine learning applications, from email spam detection to predicting house prices. The key lies in\nunderstanding your problem first\n—whether it’s classification or regression—and then selecting the right algorithm to solve it. Once you follow the workflow step by step, even complex algorithms become easier to approach. This structured process not only makes supervised learning understandable for beginners but also helps in building practical, reliable solutions.\n#\nsupervised-learning\n#\nmachine-learning\n#\nbasics\n#\ntutorial\n30\nviews",
  "metadata": {
    "title": "Introduction to Supervised Learning",
    "description": "Learn about supervised learning, a key type of machine learning for tasks like spam detection and recommendation systems, using labeled datasets",
    "keywords": null,
    "author": null,
    "og:title": "Introduction to Supervised Learning",
    "og:description": "Learn about supervised learning, a key type of machine learning for tasks like spam detection and recommendation systems, using labeled datasets",
    "og:url": "https://ml-diaries-by-fahd.hashnode.dev/introduction-to-supervised-learning",
    "og:site_name": "ML Diaries by Fahd",
    "og:image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1758951071631/eb6870e5-8950-4998-b7f5-33179509f569.png",
    "og:image:width": "1200",
    "og:image:height": "630",
    "og:type": "article",
    "twitter:card": "summary_large_image",
    "twitter:title": "Introduction to Supervised Learning",
    "twitter:description": "Learn about supervised learning, a key type of machine learning for tasks like spam detection and recommendation systems, using labeled datasets",
    "twitter:image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1758951071631/eb6870e5-8950-4998-b7f5-33179509f569.png",
    "article:published_time": "2025-09-27T05:32:28.514Z",
    "article:modified_time": "2026-01-11T10:59:02.898Z",
    "article:author": "https://ml-diaries-by-fahd.hashnode.dev/@mfahadbashir"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [],
  "images": [
    {
      "status": "ok",
      "url": "https://cdn.hashnode.com/res/hashnode/image/upload/v1758951071631/eb6870e5-8950-4998-b7f5-33179509f569.png",
      "bytes": 759973,
      "reused": true,
      "local_path": "attachments/276d545a5e9b/images/002.png",
      "src": "https://cdn.hashnode.com/res/hashnode/image/upload/v1758951071631/eb6870e5-8950-4998-b7f5-33179509f569.png",
      "alt": "Introduction to Supervised Learning",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://media.geeksforgeeks.org/wp-content/uploads/20241022160725494723/supervised-machine-learning.webp",
      "bytes": 44626,
      "reused": true,
      "local_path": "attachments/276d545a5e9b/images/004.webp",
      "src": "https://media.geeksforgeeks.org/wp-content/uploads/20241022160725494723/supervised-machine-learning.webp",
      "alt": "supervised-machine-learning",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://cdn-images-1.medium.com/max/1600/1*xs6Jr4iAPvoqszF9JgDWOA.png",
      "bytes": 127307,
      "reused": true,
      "local_path": "attachments/276d545a5e9b/images/005.png",
      "src": "https://cdn-images-1.medium.com/max/1600/1*xs6Jr4iAPvoqszF9JgDWOA.png",
      "alt": "Classification and Regression in Machine Learning",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://cdn.sanity.io/images/oaglaatp/production/33ceca7b1d09dceeb871db649b3bd3b35a623411-3790x3334.png?w=3790&h=3334&auto=format",
      "bytes": 229683,
      "reused": true,
      "local_path": "attachments/276d545a5e9b/images/006.png",
      "src": "https://cdn.sanity.io/images/oaglaatp/production/33ceca7b1d09dceeb871db649b3bd3b35a623411-3790x3334.png?w=3790&h=3334&auto=format",
      "alt": "Machine Learning Types: Here is How to Differentiate Them - StrataScratch",
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://ml-diaries-by-fahd.hashnode.dev/introduction-to-supervised-learning.md",
      "label": "View as Markdown",
      "type": "a"
    },
    {
      "href": "https://hashnode.com/@mfahadbashir",
      "label": "M",
      "type": "a"
    },
    {
      "href": "https://www.linkedin.com/in/muhammad-fahad-bashir-09568216a/",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://ml-diaries-by-fahd.hashnode.dev/series/supervised-learning",
      "label": "Part of series Supervise Learning",
      "type": "a"
    },
    {
      "href": "https://ml-diaries-by-fahd.hashnode.dev/2-types-of-machine-learning-and-their-basic-workflow",
      "label": "article (type of machine learning & basic workflow)",
      "type": "a"
    },
    {
      "href": "https://www.geeksforgeeks.org/machine-learning/supervised-machine-learning/",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://www.enjoyalgorithms.com/blogs/classification-and-regression-in-machine-learning",
      "label": "",
      "type": "a"
    },
    {
      "href": "https://ml-diaries-by-fahd.hashnode.dev/tag/supervised-learning",
      "label": "# supervised-learning",
      "type": "a"
    },
    {
      "href": "https://ml-diaries-by-fahd.hashnode.dev/tag/machine-learning",
      "label": "# machine-learning",
      "type": "a"
    },
    {
      "href": "https://ml-diaries-by-fahd.hashnode.dev/tag/basics",
      "label": "# basics",
      "type": "a"
    },
    {
      "href": "https://ml-diaries-by-fahd.hashnode.dev/tag/tutorial",
      "label": "# tutorial",
      "type": "a"
    }
  ],
  "retry_at": "2026-10-03T08:07:41",
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:50:42Z",
  "source_url": "https://ml-diaries-by-fahd.hashnode.dev/introduction-to-supervised-learning",
  "papers": [],
  "actual_video_files": [],
  "body_chars": 4541,
  "expected_body_images": 4,
  "discovery_status": "ok",
  "delivery_status": "ok",
  "missing_reason": "",
  "raw_html": "attachments/276d545a5e9b/pages/source.html",
  "local_html": "attachments/276d545a5e9b/pages/article.html",
  "body_base_path": "attachments/276d545a5e9b/pages/",
  "body_markdown_path": "attachments/276d545a5e9b/pages/article.md"
}