Which of the following best explains why machine learning is important in our daily lives?
Think about how computers can get better by seeing examples instead of following fixed instructions.
Machine learning lets computers learn patterns from data and improve over time, which helps in many real-life applications like recommendations, speech recognition, and more.
What will be the output of the following Python code that uses a simple linear regression model to predict a value?
from sklearn.linear_model import LinearRegression import numpy as np # Training data: hours studied vs score X = np.array([[1], [2], [3], [4], [5]]) y = np.array([2, 4, 6, 8, 10]) model = LinearRegression() model.fit(X, y) # Predict score for 6 hours studied prediction = model.predict(np.array([[6]])) print(round(prediction[0], 2))
The model learns a pattern where score doubles the hours studied.
The training data shows a perfect linear relation: score = 2 * hours. For 6 hours, prediction is 12.0.
You want to build a system to recognize objects in photos. Which machine learning model is best suited for this task?
Think about models that work well with images and spatial patterns.
CNNs are designed to process images by capturing spatial features, making them ideal for image classification.
In a medical test for a rare disease, which metric is more important to minimize false negatives (missing sick patients)?
Recall measures how many actual positives are correctly found.
Recall is the metric that shows how many sick patients are correctly identified, minimizing false negatives.
Consider this training loop for a neural network. The loss suddenly becomes very large and training fails. What is the most likely cause?
for epoch in range(10):
optimizer.zero_grad()
outputs = model(inputs)
loss = loss_fn(outputs, targets)
loss.backward()
optimizer.step()
print(f"Epoch {epoch} loss: {loss.item()}")Check if the training loss grows rapidly instead of decreasing.
A very high learning rate can cause the model weights to update too much, making loss explode.
