A Beginner’s Note on Machine Learning: Lessons from My Journey

When I first came across the term Machine Learning, I thought it was something only people working at big tech companies could understand. But as I dug deeper into Artificial Intelligence, I found out that Machine Learning is actually the backbone of it all. What is Machine Learning (ML)? Machine Learning (ML) is a sub-field of Artificial Intelligence (AI) that focuses on creating models which help build systems that can learn from data and make predictions or decisions, without being explicitly programmed to do so. Instead of writing out detailed rules, we simply feed the computer lots of examples, in this case called data, and it finds patterns, learns from them, and uses that knowledge to make predictions or take actions. A basic example is how Netflix or YouTube recommends shows or videos. You don’t have to tell it what you like every time. As you watch and interact, liking, skipping, or finishing certain types of content, the system learns your preferences and starts suggesting similar things. That’s Machine Learning quietly studying your behavior and using that data to make personalized recommendations. Key Concepts in Machine Learning Data: Machine Learning models require data (lots of it) to learn. The model learns patterns from the data you give it, so the better and cleaner the data, the better the learning. Features: Features are the input variables (e.g. age, salary, location). These are the pieces of information you give the model to learn from. Labels: Labels are the output or target you want to predict (e.g. whether someone will buy a product or not). These are the answers or results you want the model to predict. Training: This is the process of teaching a model to learn from the data you provided. Its just like teaching a child with examples and over time, they start to recognize patterns and make decisions on their own. Testing: Testing is when you check if the model learned well by giving it new, unseen data. You usually split your data into training and test sets. Algorithm: An algorithm is the learning method, that is, the step-by-step process (like a recipe) used to find patterns in data. Some examples are Linear Regression, Decision Trees, and Neural Networks. Model: A model is the final product you get after using an algorithm on your data. It is the trained system that can now make predictions or decisions based on new inputs, like a trained assistant that has learned from past experience. Overfitting and Underfitting: Overfitting means the model learned the training data too well that it struggles on new data while Underfitting means the model did not learn enough, so it performs poorly overall. Accuracy, Precision, Recall: These are ways to measure how well your model is doing. Accuracy: How many total predictions did the model get right. Precision: Out of the predicted positives, how many were actually correct. Recall: Out of all actual positives, how many was the model able to detect. Loss Function: This measures how far off the model’s predictions are from the actual answers. The lower the loss, the better. Types of Machine Learning Machine Learning comes in different types, depending on how the model learns from data. The main types are Supervised Learning, Unsupervised Learning, and Reinforcement Learning. 1. Supervised Learning: Supervised Learning model learns from labeled data. The simplest explanation is that this is like training a child with cards, each card has a question and the correct answer. For example, you give the model a bunch of pictures of cats and dogs, and tell it which ones are cats and which ones are dogs. Over time, it learns the difference and can start recognizing them on its own. This has been applied to fraud detection, spam filtering, and predicting house prices. Common Supervised Learning Algorithms/Models: Linear Regression: Categorized under Regression and is mostly used for predicting continuous values (e.g., house prices). Logistic Regression: Categorized under Classification and is mostly used for binary classification (e.g., spam or not spam). Decision Trees: Categorized under Classification and Regression. (e.g., Predicting loan approvals). Random Forest: Categorized under Classification or Regression and is mostly used for more accurate predictions using many decision trees. Support Vector Machines (SVM): Categorized as mostly Classification and is used for separating data into categories with a decision boundary. K-Nearest Neighbors (KNN): Categorized under Classification or Regression and is mostly used for classifying a point based on the ‘k’ closest data points. Naive Bayes: Categorized under Classification and is mostly used for text classification, like spam detection. Neural Networks: Categorized under Classification or Regression depending on the setup and is mostly used for complex tasks like image recognition, speech, etc. 2. Unsupervised Learning:

May 10, 2025 - 05:35
 0
A Beginner’s Note on Machine Learning: Lessons from My Journey

When I first came across the term Machine Learning, I thought it was something only people working at big tech companies could understand. But as I dug deeper into Artificial Intelligence, I found out that Machine Learning is actually the backbone of it all.

What is Machine Learning (ML)?

Machine Learning (ML) is a sub-field of Artificial Intelligence (AI) that focuses on creating models which help build systems that can learn from data and make predictions or decisions, without being explicitly programmed to do so. Instead of writing out detailed rules, we simply feed the computer lots of examples, in this case called data, and it finds patterns, learns from them, and uses that knowledge to make predictions or take actions.

A basic example is how Netflix or YouTube recommends shows or videos. You don’t have to tell it what you like every time. As you watch and interact, liking, skipping, or finishing certain types of content, the system learns your preferences and starts suggesting similar things. That’s Machine Learning quietly studying your behavior and using that data to make personalized recommendations.

Key Concepts in Machine Learning

  • Data: Machine Learning models require data (lots of it) to learn. The model learns patterns from the data you give it, so the better and cleaner the data, the better the learning.

  • Features: Features are the input variables (e.g. age, salary, location). These are the pieces of information you give the model to learn from.

  • Labels: Labels are the output or target you want to predict (e.g. whether someone will buy a product or not). These are the answers or results you want the model to predict.

  • Training: This is the process of teaching a model to learn from the data you provided. Its just like teaching a child with examples and over time, they start to recognize patterns and make decisions on their own.

  • Testing: Testing is when you check if the model learned well by giving it new, unseen data. You usually split your data into training and test sets.

  • Algorithm: An algorithm is the learning method, that is, the step-by-step process (like a recipe) used to find patterns in data. Some examples are Linear Regression, Decision Trees, and Neural Networks.

  • Model: A model is the final product you get after using an algorithm on your data. It is the trained system that can now make predictions or decisions based on new inputs, like a trained assistant that has learned from past experience.

  • Overfitting and Underfitting: Overfitting means the model learned the training data too well that it struggles on new data while Underfitting means the model did not learn enough, so it performs poorly overall.

  • Accuracy, Precision, Recall: These are ways to measure how well your model is doing.
    Accuracy: How many total predictions did the model get right.
    Precision: Out of the predicted positives, how many were actually correct.
    Recall: Out of all actual positives, how many was the model able to detect.

  • Loss Function: This measures how far off the model’s predictions are from the actual answers. The lower the loss, the better.

Types of Machine Learning

Machine Learning comes in different types, depending on how the model learns from data. The main types are Supervised Learning, Unsupervised Learning, and Reinforcement Learning.

1. Supervised Learning:

Supervised Learning model learns from labeled data. The simplest explanation is that this is like training a child with cards, each card has a question and the correct answer. For example, you give the model a bunch of pictures of cats and dogs, and tell it which ones are cats and which ones are dogs. Over time, it learns the difference and can start recognizing them on its own. This has been applied to fraud detection, spam filtering, and predicting house prices.

Common Supervised Learning Algorithms/Models:

  • Linear Regression: Categorized under Regression and is mostly used for predicting continuous values (e.g., house prices).
  • Logistic Regression: Categorized under Classification and is mostly used for binary classification (e.g., spam or not spam).
  • Decision Trees: Categorized under Classification and Regression. (e.g., Predicting loan approvals).
  • Random Forest: Categorized under Classification or Regression and is mostly used for more accurate predictions using many decision trees.
  • Support Vector Machines (SVM): Categorized as mostly Classification and is used for separating data into categories with a decision boundary.
  • K-Nearest Neighbors (KNN): Categorized under Classification or Regression and is mostly used for classifying a point based on the ‘k’ closest data points.
  • Naive Bayes: Categorized under Classification and is mostly used for text classification, like spam detection.
  • Neural Networks: Categorized under Classification or Regression depending on the setup and is mostly used for complex tasks like image recognition, speech, etc.

2. Unsupervised Learning:

Unsupervised Learning learns from data that has no labels. The model has to figure out patterns or groupings on its own. Just opening a suitcase full of mixed clothes and grouping them by type, shirts, trousers, socks, without anyone telling you what is what. That is unsupervised learning. It is often used in customer segmentation or market research, where the goal is to group similar users together.

Common Unsupervised Learning Algorithms/Models:

  • K-Means Clustering: This groups similar data points into K clusters. For example, it can help a business group customers based on how they shop, like frequent buyers vs occasional ones.
  • Hierarchical Clustering: This is like building a family tree for your data. It starts with individual points and gradually groups them into bigger clusters. It is great for seeing how data naturally fits together. It is useful when you want to visualize nested groupings.
  • Density-Based Spatial Clustering of Applications with Noise (DBSCAN): This groups points that are close to each other and can ignore outliers also known as noisy data. It is useful when the shape of the clusters isn’t nice and round like in K-Means.
  • Principal Component Analysis (PCA): This helps reduce the number of features in your data while still keeping the important stuff. It is useful when your dataset has too many columns and you want to simplify things.
  • t-Distributed Stochastic Neighbor Embedding (t-SNE): Another tool for simplifying data, especially when you want to plot and visualize high-dimensional data in 2D or 3D. It helps you see patterns better.
  • Autoencoders: These are neural networks that learn to squeeze data into a smaller form and then rebuild it. They are often used to detect when something does not look normal (like fraud or errors).
  • Gaussian Mixture Models (GMM): Unlike K-Means which assigns a point to just one group, GMM allows a point to partly belong to multiple groups. An example is saying, “This customer is 70% likely to be in Group A and 30% in Group B.”

3. Reinforcement Learning:

Reinforcement Learning is more like teaching through experience. The model learns by making decisions, getting feedback (reward or punishment), and improving over time. It’s like training a dog, when it gets something right, you give it a treat. When it gets it wrong, you correct it. Reinforcement learning is behind things like game-playing AI (like AlphaGo), robotics, and some self-driving car systems.

Common Reinforcement Learning Algorithms/Models:

  • Q-Learning: This helps an agent learn the best action to take in each situation by trying things out and getting rewards or punishments. For example, a robot can learn to move through a maze without bumping into walls.
  • State-Action-Reward-State-Action (SARSA): This is similar to Q-Learning, but it updates its knowledge based on the action the agent actually takes instead of the best possible one. It is a bit more realistic in unpredictable environments.
  • Policy Gradient Methods: These algorithms do not try to learn values for each action but instead focus on directly learning the best strategy for choosing actions. They are great for tasks with continuous actions, like moving a robot arm.
  • Actor-Critic Methods: This combines two roles, the “Actor” decides what to do, while the “Critic” gives feedback on how good the action was. It helps the model improve both decision-making and judgment over time.
  • Proximal Policy Optimization (PPO): A popular and powerful method used in modern Reinforcement Learning. It balances learning efficiently without taking huge risky steps. It is used in robotics, games, and even by OpenAI in some of their advanced projects.
  • Monte Carlo Methods: These learn by waiting until the end of an experience or episode before updating what they have learned. It is like playing a full game before reviewing what went well or not.

Practical Tools and Frameworks for Machine Learning

  • Scikit-learn: A beginner-friendly Python library with tools for classification, regression, and clustering. It is great for learning and building small-to-medium ML projects.
    Use cases: Classification, regression, clustering, model evaluation.

  • XGBoost: An optimized library for gradient boosting. It is fast, efficient, especially for structured/tabular data, and widely used in ML competitions and real-world applications. It supports Python, R, C++, Java
    Use cases: Credit scoring, churn prediction, sales forecasting.

  • LightGBM: Developed by Microsoft, this is another high-performance gradient boosting library, more memory-efficient than XGBoost, that works well with large datasets. It supports Python, R, C++
    Use cases: Ranking, recommendation systems, fraud detection.

  • CatBoost: Built by Yandex, it handles categorical features automatically and works well out of the box and has great performance with little tuning. It supports Python, R
    Use cases: Web analytics, retail behavior modeling.

  • Statsmodels: A Python library for statistical modeling and hypothesis testing. It is useful when you want detailed statistical insights along with your ML models, especially in linear regression.
    Use cases: Time series forecasting, hypothesis testing.

Example Workflow of a Machine Learning Project

  1. Define the problem: What are you trying to solve
  2. Collect data: Gather relevant and sufficient data
  3. Clean data: Handle missing values, duplicates and outliers
  4. Split data: Use 70 to 80% of the datasets for training and 20 to 30% of the datasets on testing the model
  5. Choose algorithm: Select an appropriate ML algorithm based on the problem and type of data
  6. Train model: Feed the training datasets to the model
  7. Test model: Use unseen data (the testing datasets) to evaluate the model
  8. Tune hyperparameter: Improve the performance of the model
  9. Deploy model: Integrate model into production

Summary

Machine Learning may sound complex at first, but it is about teaching machines to learn from data and make decisions without being manually programmed. To starting out, begin with the basics: understand key concepts like features, labels, training, and algorithms. Start with Scikit-learn for quick implementation, and Jupyter notebook for experiments.

Thank you for reading through.