AI & ML — 60 questions
Play ▸- #1 · In machine learning, what are the input variables a model uses to make a prediction called?
- #2 · Which kind of learning trains on examples that come with the correct answer attached?
- #3 · In reinforcement learning, what signal does the agent learn from?
- #4 · How many rows end up in
X_test? from sklearn.model_selection import train_test_spl
- #5 · What is wrong with this preprocessing order? scaler = StandardScaler().fit(X) # all rows X_scal
- #6 · What does the "no free lunch" theorem say about learning algorithms?
- #7 · Predicting a house's sale price from its size and location is which type of task?
- #8 · What does a binary logistic regression model output for an input?
- #9 · With uniform voting, what does this k-NN classifier predict for the query point? # distance to query point -> label 1.2 -> cat 0.4
- #10 · What is the Gini impurity of this node? Decision-tree node: class A: 6 samples class B: 2
- #11 · What does a linear support vector machine maximize when choosing its decision boundary?
- #12 · What is
y_hat? import numpy as np w = np.array([2.0, -1.0]) b = 0
- #13 · Which value must you choose before running standard k-means?
- #14 · In PCA, what are the principal components?
- #15 · After one assignment step and one update step, where is C1? k-means, k=2 C1 = (0, 0) C2 = (6, 6) points: (1,0)
- #16 · What is an advantage of DBSCAN over k-means?
- #17 · What is the fewest number of components that keeps at least 90% of the variance? pca.explained_variance_ratio_ # [0.62, 0.21, 0.09,
- #18 · What is the precision of this classifier? Pred + Pred - Actual + 40 20 Actual - 10 30
- #19 · What is the F1 score for the positive class? Pred + Pred - Actual + 30 10 Actual - 20 40
- #20 · What is this model's recall on the positive class? Test set: 990 negatives, 10 positives Model: alway
- #21 · For cancer screening, where missing a real case is the costliest mistake, which metric matters most?
- #22 · What does
scores contain? scores = cross_val_score(model, X, y, cv=5)
- #23 · What is the RMSE? y_true = [3, 5, 9, 4] y_pred = [1, 7, 5, 4] # erro
- #24 · What does this return? import torch torch.relu(torch.tensor([-2.0, 0.0, 3
- #25 · How many trainable parameters does this layer have? import torch.nn as nn layer = nn.Linear(784, 128)
- #26 · What is
out.shape? x = torch.randn(32, 10) fc = nn.Linear(10, 5) out
- #27 · Rounded to two decimals, what is
probs? logits = [2.0, 1.0, 0.0] probs = softmax(logits)
- #28 · What range of values can the sigmoid activation output?
- #29 · What do residual (skip) connections mainly help with in very deep networks?
- #30 · What do these loss curves show? epoch train_loss val_loss 1 0.90 0.95 2 0.50 0.60
- #31 · How many batches (iterations) make up one epoch? dataset size = 10,000 samples DataLoader(ds, batch
- #32 · What is the new value of
w? w = 0.5 grad = 2.0 # dLoss/dw lr = 0.1 w = w - lr
- #33 · What bug does this PyTorch training loop have? for x, y in loader: loss = loss_fn(model(x), y) lo
- #34 · In PyTorch, what does calling
model.eval() do?
- #35 · What is the most likely cause of this loss behavior? step loss 1 2.30 2 5.10 3 18.70 4 nan
- #36 · In NLP, what is tokenization?
- #37 · What IDF value does "the" get? corpus: 4 documents term "the" appears in all 4 id
- #38 · What property of word embeddings does this illustrate? vec("king") - vec("man") + vec("woman") ~ vec("que
- #39 · What is the cosine similarity of
a and b? a = [1, 0, 1] b = [1, 1, 0]
- #40 · Why can transformers train faster on long text than RNNs?
- #41 · What is the language model's perplexity? mean cross-entropy per token = 2.0 nats
- #42 · What does a GPT-style LLM learn to predict during pretraining?
- #43 · What happens to an LLM's sampled output when you lower the temperature?
- #44 · Why are the attention scores divided by
sqrt(d_k)? scores = Q @ K.T / math.sqrt(d_k) weights = softma
- #45 · What does retrieval-augmented generation (RAG) add to an LLM call?
- #46 · This prompt relies on which technique? great movie -> positive boring plot -> negative lo
- #47 · What does this mask do in a decoder? mask = torch.triu(torch.ones(4, 4), diagonal=1).bo
- #48 · How does LoRA fine-tune a large model cheaply?
- #49 · What is
out.shape? x = torch.randn(1, 3, 32, 32) conv = nn.Conv2d(3,
- #50 · What is the output? input 4x4: 1 3 2 0 4 2 1 5 0 1 3 2 2 6 1 1 MaxPool
- #51 · Why apply random flips and crops to training images?
- #52 · Which parameters will the optimizer actually update? model = torchvision.models.resnet18(weights="DEFAU
- #53 · What is the IoU (intersection over union) of the two boxes? box A: x1=0, y1=0, x2=4, y2=4 box B: x1=2, y1=2, x
- #54 · How many trainable parameters does this layer have (bias included)? nn.Conv2d(in_channels=3, out_channels=16, kernel_s
- #55 · What is algorithmic bias in an ML system?
- #56 · What is the main risk of this model? Training data: 10 years of past hiring decisions 9
- #57 · An LLM confidently cites a research paper that does not exist. What is this called?
- #58 · An LLM agent reads this page while browsing. What attack is this? Retrieved web page text: "Ignore previous instruct
- #59 · What does differential privacy guarantee about a model trained on personal data?
- #60 · What are SHAP values used for?