Beginner-Friendly Topic
Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on. You've got this! 🚀
Data and Examples
Data is the foundation of AI. Without data, an AI system cannot learn anything. Understanding what data is and why it matters is the most important concept in this module.
What is Data in AI?
Data in AI is simply a collection of examples. Each example is a piece of information the AI can learn from.
Data can be:
- Text: emails, articles, conversations, reviews
- Numbers: prices, temperatures, distances, scores
- Images: photos, X-rays, satellite images
- Audio: speech recordings, music, environmental sounds
- Video: security footage, medical videos, driving footage
The more relevant examples you have, the better the AI can learn.
Deep Learning ⊂ Machine Learning ⊂ Artificial Intelligence
Data Examples in Different Industries
- Email spam detection: data is thousands of emails labeled as spam or not spam
- House price prediction: data is records of houses sold, with price, size, location, and features
- Medical diagnosis: data is thousands of patient records with symptoms and confirmed diagnoses
- Recommendation system: data is the history of what millions of users watched, rated, or purchased
- Self-driving car: data is millions of hours of driving footage with labels for road, pedestrians, traffic lights
What Data Looks Like in Python
# Data in AI is often stored as a list of examples
# Each example has input values and a correct answer
# Example: Fruit classification data
fruit_data = [
# [weight_grams, diameter_cm, color_code] -> fruit_name
([150, 7.5, 1], "apple"), # color 1 = red
([180, 8.0, 1], "apple"),
([120, 7.0, 2], "orange"), # color 2 = orange
([130, 6.8, 2], "orange"),
([200, 15.0, 3], "banana"), # color 3 = yellow
([210, 16.0, 3], "banana"),
]
# The AI will look at these examples and learn:
# "Heavier, longer objects with color code 3 tend to be bananas"
# "Lighter, rounder objects with color code 1 tend to be apples"
# Print a summary of the data
print(f"Total training examples: {len(fruit_data)}")
print()
for features, label in fruit_data:
print(f"Features: weight={features[0]}g, diameter={features[1]}cm -> {label}")Tip
Tip
In the AI industry, people often say 'garbage in, garbage out.' If you feed an AI bad or biased data, it will learn bad or biased patterns. The quality of an AI system is almost always limited by the quality of its training data.
Key Takeaways
- Data is the foundation of AI.
- Email spam detection: data is thousands of emails labeled as spam or not spam
- House price prediction: data is records of houses sold, with price, size, location, and features
- Medical diagnosis: data is thousands of patient records with symptoms and confirmed diagnoses