0
0
AI for Everyoneknowledge~20 mins

How training data shapes AI behavior in AI for Everyone - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Data-Driven AI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does biased training data affect AI predictions?

Imagine an AI model trained mostly on images of cats with white fur. What is the most likely effect on the AI's ability to recognize cats with black fur?

AThe AI will have difficulty recognizing black cats because it saw mostly white cats during training.
BThe AI will ignore fur color and only focus on cat shapes, so no effect.
CThe AI will recognize black cats just as well as white cats.
DThe AI will refuse to classify any cat that is not white.
Attempts:
2 left
💡 Hint

Think about what the AI learned from the examples it saw most often.

🔍 Analysis
intermediate
2:00remaining
Output of model accuracy with imbalanced training data

Consider a classification model trained on 95% class A and 5% class B data. After training, the model predicts all inputs as class A. What is the approximate accuracy on the training set?

AI for Everyone
total_samples = 1000
class_A_samples = 950
class_B_samples = 50
correct_predictions = 950  # model predicts all as class A
accuracy = correct_predictions / total_samples
print(f"Accuracy: {accuracy:.2f}")
AAccuracy: 0.05
BAccuracy: 0.95
CAccuracy: 1.00
DAccuracy: 0.50
Attempts:
2 left
💡 Hint

How many samples are correctly predicted if the model always predicts class A?

Hyperparameter
advanced
2:00remaining
Choosing training data size for better AI behavior

You want to improve an AI model's ability to generalize to new data. Which training data strategy is best?

AUse a large, diverse dataset covering many scenarios.
BUse a very small, clean dataset to avoid noise.
CUse only data from one specific case to specialize the model.
DUse random data unrelated to the task to increase size.
Attempts:
2 left
💡 Hint

Think about what helps the model learn to handle different situations.

Metrics
advanced
2:00remaining
Interpreting precision and recall with skewed training data

An AI model trained on data with 90% negative and 10% positive cases achieves 90% accuracy. However, its precision is 0.5 and recall is 0.1 for the positive class. What does this tell you about the model's behavior?

AThe model is good at finding positive cases but often makes false alarms.
BThe model ignores the positive class and only predicts negatives.
CThe model perfectly identifies positive cases but fails on negatives.
DThe model misses many positive cases and is not reliable at identifying them.
Attempts:
2 left
💡 Hint

Recall measures how many actual positives are found. Precision measures how many predicted positives are correct.

🔍 Analysis
expert
2:00remaining
Why does this AI model fail to learn from training data?

Given this training loop snippet, why does the model's loss not decrease?

for epoch in range(5):
    for x, y in train_loader:
        optimizer.zero_grad()
        output = model(x)
        loss = loss_fn(output, y)
        loss.backward()
        optimizer.step()
AThe model(x) call is missing input data, so output is empty.
BThe optimizer.step() is called before loss.backward(), so gradients are not computed.
CThe loss.backward function is not called properly because parentheses are missing.
DThe optimizer.zero_grad() is called after loss.backward(), so gradients accumulate.
Attempts:
2 left
💡 Hint

Check how functions are called in Python.