Overview
This class introduced the course structure and the fundamental distinction between conventional and machine learning (ML) programming. The instructor assessed student backgrounds and outlined the syllabus, which spans Basic ML, Deep Learning, and basic NLP. The session established that ML is a system's ability to learn from data without explicit programming, contrasting it with rule-based approaches. This foundational lecture sets the stage for understanding when and why ML is necessary, positioning it within the broader curriculum of advanced topics.
Learning outcomes
- Distinguish between conventional programming and ML/AI-based programming.
- Explain why ML is used when explicit, rule-based solutions are not feasible.
- Describe the essential role of data and the structure of a dataset (features and target variable) in ML.
- Identify scenarios where ML is appropriate versus where conventional programming suffices.
Core concepts
Conventional vs. ML Programming
Conventional programming relies on explicit human-written logic (e.g., if-else rules) to produce outputs from inputs. ML programming feeds data (inputs and corresponding outputs) to an algorithm, which learns implicit patterns to map new inputs to outputs. This distinction matters because it defines the problems each approach can solve: conventional programming for well-defined logical tasks, ML for tasks where rules are unknown or too complex to codify.
Role of Data in ML
Data is the mandatory raw material for ML. An ML model learns by iteratively scanning datasets comprised of features (input attributes) and a target variable (the correct output). Without sufficient and representative data, ML modeling cannot occur. This concept is central because it shifts the focus from writing logic to curating and preparing data.
Implicit vs. Explicit Programming
Explicit programming involves manually specifying all solution steps. Implicit programming, characteristic of ML, involves providing a system with examples (data) from which it automatically infers the solution rules. This shift enables solving problems that lack a clear algorithmic solution, connecting to the core promise of ML: learning from experience.
Formulas and maths
(No formulas were presented in this part.)
Worked examples
Email Validation Example
Conventional Approach: A programmer writes a function with explicit rules (e.g., check for '@', no spaces, dot not at the start). The code directly encodes the validation logic.
ML Approach: 1. Require a dataset of, for example, 10,000 email IDs. 2. Each row contains features (the email string, possibly decomposed) and a class label/target variable ("yes" for valid, "no" for invalid). 3. An ML algorithm scans this dataset multiple times to learn patterns distinguishing valid from invalid emails. 4. A change in rules (e.g., allowing spaces) requires a new dataset with examples of the new rule and complete retraining of the model, whereas in conventional programming, only one if-else statement needs modification.
Image Recognition Example
- Case A: Feed an ML algorithm a dataset of cat and dog images with labels. The algorithm learns patterns to distinguish cats from dogs.
- Case B: Feed the same ML algorithm code a dataset of laptop and mobile phone images with labels. Without changing the code, the algorithm now learns patterns to distinguish laptops from mobiles. The purpose of the algorithm is determined by the data, not the code.
Questions asked in class
- Q: Which is more accurate, conventional programming or ML? A: Conventional programming gives correct answers always, assuming the logic is correct; ML may give wrong answers as it learns probabilistic patterns.
- Q: Which is easier to change when requirements change (e.g., allowing spaces in email)? A: Conventional programming (change one if-else statement). ML requires new data and retraining.
- Q: If conventional programming is better, why learn ML? A: ML is used when a mathematical or logical solution does not exist (e.g., recognizing cats and dogs). In such cases, ML finds solutions from data where conventional programming cannot.
- Q: Does ML reduce human effort? A: Not necessarily; it can increase effort because creating large, accurate datasets is laborious. ML does not replace conventional programming but solves a different class of problems.
- Q: Can you tell the purpose of an ML algorithm by reading its code? A: No. Unlike conventional programming, the same ML code can be used for entirely different tasks (e.g., cat/dog or laptop/mobile recognition) depending on the data provided.
Key takeaways
- Machine Learning is defined as a system's ability to automatically learn and improve from experience (data) without being explicitly programmed.
- The course will cover three modules: Basic ML, Deep Learning (basic to advanced), and basic NLP.
- Data is fundamental to ML; without data, there is no model.
- A standard ML dataset is structured with features (input columns) and a target variable/class label (output column).
- Conventional programming uses explicit logic; ML uses implicit learning from data.
- ML is not inherently more accurate than conventional programming; it is probabilistic.
- Changing the task in conventional programming requires code changes; in ML, it requires data changes.
- The same ML algorithm can perform different tasks based on the training data it receives.
- ML is necessary when problems lack a clear algorithmic or rule-based solution.
- Implementing ML can involve significant human effort in dataset creation and curation.
- Coding sessions will use Python, with introductory classes provided for those unfamiliar with it.
- Assessment is based entirely on MCQ-based assignments and quizzes.
Exam-style questions
-
Describe a problem where machine learning is necessary, and justify why conventional programming would not be suitable. Outline: Choose a problem like image recognition or sentiment analysis. Argue that no explicit set of rules can reliably define all variations (e.g., of a cat's appearance or positive sentiment). State that ML learns these complex, implicit patterns from data.
-
A rule for validating user IDs changes. Compare the steps required to update a conventional program versus an ML model. Outline: Conventional: Locate and modify the specific conditional statement in the code. ML: 1) Collect new data reflecting the updated rule, 2) Re-label the dataset if necessary, 3) Retrain the model on the new dataset from scratch or via fine-tuning.
-
Explain the statement: "In ML, the purpose of the algorithm is determined by the data, not the code." Provide an example. Outline: ML algorithms are general-purpose pattern learners. Example: The same neural network code trained on cat/dog data becomes a pet classifier; trained on laptop/mobile data, it becomes an electronics classifier. The code remains constant; the data defines the task.
Glossary
- Advanced Machine Learning - A postgraduate course focused primarily on deep learning, assuming prior ML knowledge.
- Conventional Programming - Writing programs with explicit, human-coded logic and rules.
- Features - The input attributes or columns in a dataset used by an ML model to make predictions.
- Implicit Programming - The ML approach of learning solution patterns from data without explicit human instruction.
- Machine Learning - A system's ability to automatically learn and improve from experience without being explicitly programmed.
- Target Variable/Class Label - The output or correct answer column in a dataset that an ML model learns to predict.
Follow-ups
- Detailed discussion on the differences between AI, ML, and Deep Learning.
- Reference books for the course will be provided.
- Specific industry use cases will not be covered comprehensively due to time constraints.
- Exact number of assignments and quizzes to be confirmed.
- Coverage of all syllabus topics (e.g., some case studies like bioinformatics) may be limited due to time spent on basics.
- Introduction to Python and data handling libraries (e.g., pandas) in upcoming coding classes.