AI Course
What is Machine Learning?
Machine Learning (ML) is a subset of Artificial Intelligence that enables a system to learn patterns from data and improve its performance on a task, without being explicitly programmed with rules for every possible scenario.
Instead of following hard-coded instructions, an ML model is trained on data, identifies patterns within it, and uses those patterns to make predictions or decisions on new, unseen data.
Key building blocks of ML
- Data — The raw information (text, images, numbers, etc.) used to train a model. The quality and quantity of data heavily influence how well a model performs.
- Model — The mathematical structure that learns patterns from data during training, and is later used to make predictions.
- Training — The process of feeding data into a model so it can learn relationships and patterns.
- Inference — Using a trained model to make predictions or generate output on new data it hasn't seen before.
- Features — The individual measurable properties or characteristics in the data that a model uses to learn (e.g., a patient's age, blood pressure, and surgery type when predicting outcomes).
The three core ML approaches
-
Supervised learning
- Trained on a dataset that has been labeled by humans.
- Used when there is a specific, known output in mind.
- Example: Training a model on emails labeled "spam" or "not spam" so it can classify new emails.
-
Unsupervised learning
- Trained on data that has not been labeled.
- Used to discover hidden patterns or groupings when there is no predefined output.
- Example: Grouping customers into segments based on purchasing behavior, without predefined categories.
-
Reinforcement learning
- Trained through trial-and-error, guided by rewards or penalties (feedback).
- Used to improve a model's performance on a specific task over time.
- Example: A game-playing AI that improves its strategy by receiving a reward for winning moves and a penalty for losing ones.
How a typical ML model is trained (high-level lifecycle)
- Collect data — Gather a dataset relevant to the task.
- Prepare/clean data — Remove errors, fill gaps, and format data consistently.
- Choose an approach — Decide between supervised, unsupervised, or reinforcement learning based on the goal and available data.
- Train the model — Feed the data into the model so it can learn patterns.
- Evaluate the model — Test the model against data it hasn't seen to measure accuracy and reliability.
- Deploy the model — Release the trained model for real-world use (inference).
- Monitor and retrain — Track performance over time and retrain with new data as needed, since a model does not keep learning on its own after deployment.
Machine Learning vs. Rule-based systems
- How it works
- Machine Learning: Learns patterns from data.
- Rule-based AI: Follows fixed, hard-coded rules.
- Adapts to new data
- Machine Learning: Yes, when retrained.
- Rule-based AI: No.
- Best suited for
- Machine Learning: Complex, variable, real-world data.
- Rule-based AI: Predictable, narrow tasks.
- Example
- Machine Learning: Predicting patient outcomes from historical data.
- Rule-based AI: A chatbot that replies with a fixed link when it sees the phrase "tracking number".
Common challenges in Machine Learning
- Bias in training data — If the data used to train a model reflects existing biases, the model can learn and repeat those biases in its predictions.
- Data quality and quantity — Poor, incomplete, or insufficient data leads to unreliable models.
- Overfitting — A model that learns the training data too precisely may perform poorly on new, real-world data.
- Lack of real-time learning — Once deployed, most models don't continue learning from new data automatically; they need to be retrained and redeployed with updated data.
- Explainability — Some ML models (especially complex ones) can be difficult for humans to interpret, making it harder to understand why a particular prediction was made.
Why this matters in practice
Understanding these ML basics helps in recognizing:
- What kind of data a system needs to perform well.
- Why AI tools sometimes produce biased or inaccurate results.
- Why human oversight and periodic retraining remain necessary, even for well-performing models.
- How to evaluate whether a given task is better suited to supervised, unsupervised, or reinforcement learning — or whether a simpler rule-based approach would do the job just as well.