Unit 2: Nature of Data and Machine Learning
I. Orientation: Data as the Basis of Intelligent Systems
Artificial intelligence depends on the ability of a system to use information to perform tasks that normally require human intelligence, such as recognizing patterns, making predictions, understanding language, or selecting actions. In modern AI, data provides the examples and evidence from which many systems identify useful patterns.
- Data-driven principle: An AI system improves its performance by using information such as text, images, audio, transactions, sensor readings, or user interactions.
- Pattern-based operation: Machines do not usually understand data in the same human way; they detect regularities, relationships, and repeated features.
- Representation: Real-world information must be represented in a machine-readable form, such as words, pixel values, sound recordings, or numerical records.
- Quality dependence: Reliable, relevant, and sufficiently varied data generally produces more useful results than incomplete, inaccurate, or biased data.
- Learning rather than fixed instructions: In traditional software, people specify many rules directly. In machine learning, the system often infers rules from examples.
- Human role: People define goals, collect or label data, choose evaluation criteria, supervise deployment, and monitor errors and unintended effects.
II. Data — The Information Used by AI Systems
A. What is data?
Data is recorded information that can be stored, processed, compared, or used to support decisions. In AI, data acts as the material from which a system identifies patterns and produces outputs.
- Meaning: A single email, photograph, temperature reading, or purchase record is an example of data.
- An email may contain sender, subject, words, and attachments.
- A purchase record may contain product ID, price, time, and customer account.
- Structured data: Information arranged in predictable fields, such as a spreadsheet containing
product,price, andquantity, is easier to organize and search. - Unstructured data: Text documents, photographs, videos, and speech do not naturally fit into fixed rows and columns, but they can still be analyzed by AI.
- Labels: A label identifies the desired category or outcome. For example, an email marked “spam” or “not spam” gives a learning system an example of the correct answer.
- Features: Features are observable properties used to distinguish cases. For an email, possible features include repeated promotional phrases, an unknown sender, or many links.
- Metadata: Metadata describes other data, such as the date a photograph was taken, the device used, or the location attached to a recording.
- Data quality: Missing values, duplicate records, incorrect labels, outdated information, or unfair representation can reduce the reliability of an AI system.
- Training and testing separation: Data used to build a system should be separated from data used to evaluate it, so performance is measured on cases the system has not simply memorized.
- Privacy and permission: Personal data may include names, locations, health details, messages, or browsing behavior; collecting and using it requires responsible handling and appropriate safeguards.
III. Machine Learning — Learning Patterns from Examples
A. What is Machine Learning (ML)? (No math or coding)
Machine learning is a branch of AI in which a system uses data and experience to identify patterns and make predictions or decisions without every individual rule being manually written.
- Purpose: ML is useful when a task involves many examples or changing patterns that would be difficult to describe with a complete list of rules.
- Input and output: A system receives inputs, such as an image or customer history, and produces an output, such as “cat,” “likely fraud,” or a recommended product.
- Training: During training, the system examines examples and adjusts its internal pattern representation so that its outputs become more useful.
- Inference: After training, the system applies learned patterns to new input. Classifying a newly received email is an inference task.
- Generalization: A successful model should work on unfamiliar examples, not only repeat the cases seen during training.
- Supervised learning: The system learns from examples paired with known answers, such as photographs labelled “road” or “not road.”
- Unsupervised learning: The system searches for structure without supplied answer labels, such as grouping customers according to similar purchasing behavior.
- Reinforcement learning: The system learns through actions, feedback, rewards, or penalties, such as an agent learning which moves help it complete a game.
- Model: A model is the learned pattern or decision mechanism used to transform new input into an output. It is not a human-like mind and does not automatically possess common sense.
- Prediction does not guarantee truth: A model may produce a confident output that is incorrect, especially when the new situation differs from its training data.
B. How machines learn from data
Machines learn by using examples, detecting relationships, receiving feedback, and being evaluated on new cases. The process is iterative rather than a single act of “understanding.”
- Collecting examples: Developers gather relevant data, such as thousands of historical emails for a spam detector or product views for a recommendation system.
- Preparing data: Records may be cleaned, organized, labelled, resized, transcribed, or checked for duplicates before learning begins.
- Finding patterns: The system compares examples and detects features associated with outcomes. For instance, certain combinations of suspicious links and urgent wording may frequently occur in spam.
- Adjusting from feedback: If the system predicts “not spam” for a message labelled “spam,” the training process treats that as an error and modifies the model’s future behavior.
- Repeated exposure: The model examines many examples, gradually becoming better at recognizing patterns that appear consistently.
- Validation: A separate set of examples can help select a model and identify whether it is learning useful patterns.
- Testing: Final evaluation uses unseen cases to estimate how the system may perform after deployment.
- Overfitting: A model overfits when it memorizes accidental details in training examples rather than learning general patterns; it may perform well on old examples but poorly on new ones.
- Bias: If training data reflects unequal treatment or excludes important groups, the model can reproduce or amplify those patterns.
- Updating: Data and user behavior change over time. A recommendation system trained on last year’s interests may require monitoring and retraining to remain useful.
IV. Examples of How AI Learns — Practical Applications
A. Examples of how AI learns: spam filters
A spam filter uses learned patterns to estimate whether an incoming message is unwanted, deceptive, or potentially harmful. It illustrates classification: assigning an input to a category.
- Training examples: Historical messages labelled “spam” and “legitimate” provide examples of the two categories.
- Useful signals: The filter may consider sender reputation, unusual links, repeated phrases, message structure, attachments, and whether the recipient has interacted with the sender before.
- Pattern combination: One word alone does not prove that a message is spam. A combination such as an unknown sender, urgent payment language, and a suspicious link is more informative.
- User feedback: When a person moves a message to spam or restores it to the inbox, that action can provide feedback for later improvement, depending on the service’s design.
- Output: The system may place the message in a spam folder, allow it into the inbox, or mark it for additional review.
- Errors: A false positive sends a legitimate message to spam; a false negative allows unwanted mail through. Both matter, but the acceptable balance depends on the application.
- Worked example: A message from an unfamiliar address says “urgent account closure,” includes a shortened link, and asks for credentials. Several signals together may cause the filter to classify it as likely spam, although a human or security system may still need to verify it.
B. Shopping recommendations
A recommendation system predicts which products, videos, or services may interest a person by learning from patterns in behavior and similarities among users or items.
- Behavioral data: Views, searches, clicks, purchases, ratings, time spent, and abandoned carts can indicate interest, although each signal has a different meaning.
- Item similarity: If a customer views several hiking backpacks, the system may identify related items such as water bottles, trail shoes, or camping equipment.
- User similarity: A system may compare one customer’s activity with patterns from other customers who bought or viewed similar products.
- Context: Time, device, location, season, stock availability, and the current page can affect which recommendation is appropriate.
- Feedback loop: Selecting a recommendation supplies additional evidence, while ignoring it may reduce the likelihood of showing similar items later.
- Cold-start problem: A new customer or newly added product has little behavioral history, so the system may initially rely on general popularity, product descriptions, or broad categories.
- Risks: Recommendations can narrow a person’s choices, promote low-quality content, expose sensitive preferences, or reflect commercial priorities rather than neutral usefulness.
- Worked example: After a customer repeatedly views beginner cameras and purchases a memory card, the system may recommend a camera bag or entry-level tripod because the combined actions resemble patterns associated with those products.
V. AI, ML, and Automation — Related but Different Ideas
A. Difference between AI, ML, and automation
AI is the broadest idea, machine learning is one major way to build AI systems, and automation is the use of technology to perform tasks with reduced human intervention. The three concepts overlap, but they are not identical.
- Artificial intelligence (AI): AI refers broadly to systems designed to perform capabilities associated with intelligence, including perception, language processing, reasoning, planning, learning, and decision-making.
- A speech-recognition system, game-playing agent, or image classifier may be described as AI.
- AI does not always require machine learning; some systems use explicitly designed rules.
- Machine learning (ML): ML is a method within AI that learns patterns from data rather than relying entirely on manually written instructions.
- A spam classifier trained on labelled messages is ML and therefore also an AI application.
- ML can be used for prediction without producing broad, human-like intelligence.
- Automation: Automation means carrying out a defined process automatically, usually according to fixed rules, schedules, triggers, or workflows.
- A system that sends an invoice every Friday when a payment is recorded is automation, even if it does not learn.
- A programmed thermostat that turns heating on below a chosen temperature is automated control, not necessarily ML.
- 1. Rule-based automation: People specify the condition and action directly: “When stock falls below ten units, send an alert.” The system follows the instruction consistently but does not infer a new rule from examples.
- 2. Learning-based AI: The system uses data to infer patterns, such as predicting which products a customer may prefer. Its behavior can change as data and feedback change.
- Relationship: ML can automate decisions, and AI systems can contain automated workflows, but automation alone is not AI and AI does not always learn.
- Main distinction: Automation asks, “How can a predefined task be performed automatically?” ML asks, “What patterns in data can help produce or improve the task’s output?” AI asks the broader question of how machines can perform intelligent-seeming functions.
- Human oversight: In all three cases, people remain responsible for defining goals, checking performance, handling exceptional cases, and addressing safety, fairness, privacy, and accountability.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →