Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
What is the defining characteristic of supervised learning?
Not quite. Try another option.
Answer: It learns from labeled data with known outputs
Supervised learning uses input-output pairs, where each training example has a known label or target value.
Question 2 of 60 · unsupervised · Easy
Which of the following best describes unsupervised learning?
Not quite. Try another option.
Answer: Finding patterns in data without labeled outputs
Unsupervised learning works with data that has no labels and discovers hidden structure such as clusters or groupings.
Question 3 of 60 · supervised · Easy
Which of the following is an example of a supervised learning task?
Not quite. Try another option.
Answer: Email spam classification using labeled emails
Spam classification uses emails labeled as spam or not-spam, making it a supervised task.
Question 4 of 60 · unsupervised · Easy
Clustering is most commonly associated with which type of learning?
Not quite. Try another option.
Answer: Unsupervised learning
Clustering groups similar data points together without using labels, which is a core unsupervised technique.
Question 5 of 60 · logistic regression · Easy
Logistic regression is primarily used for which kind of problem?
Not quite. Try another option.
Answer: Classification problems
Despite its name, logistic regression is a classification algorithm that predicts the probability of class membership.
Question 6 of 60 · logistic regression · Easy
Which function is used by logistic regression to map values to a range between 0 and 1?
Not quite. Try another option.
Answer: Sigmoid function
The sigmoid (logistic) function squashes any real value into the range .
Question 7 of 60 · supervised · Easy
In supervised learning, the known correct answer for each training example is called the:
Not quite. Try another option.
Answer: Label
The label (or target) is the known output value associated with each input in supervised learning.
Question 8 of 60 · supervised · Easy
Which two categories are the main types of supervised learning problems?
Not quite. Try another option.
Answer: Classification and regression
Supervised learning splits into classification (discrete outputs) and regression (continuous outputs).
Question 9 of 60 · unsupervised · Easy
Which of the following is an unsupervised learning technique?
Not quite. Try another option.
Answer: K-means clustering
K-means groups data into clusters without labels, making it an unsupervised method.
Question 10 of 60 · logistic regression · Easy
The output of logistic regression can be interpreted as a:
Not quite. Try another option.
Answer: Probability of belonging to a class
Logistic regression outputs a value between 0 and 1 that represents the probability of the positive class.
Question 11 of 60 · logistic regression · Easy
A common default threshold to convert a logistic regression probability into a class label is:
Not quite. Try another option.
Answer: 0.5
By default, probabilities above are classified as the positive class and below as the negative class.
Question 12 of 60 · unsupervised · Easy
Which of the following does unsupervised learning typically NOT require?
Not quite. Try another option.
Answer: Labeled output data
Unsupervised learning operates without labeled outputs; it only needs the input data itself.
Question 13 of 60 · supervised · Easy
Predicting house prices from features like size and location is an example of:
Not quite. Try another option.
Answer: Supervised regression
Predicting a continuous value like price from labeled training data is a supervised regression task.
Question 14 of 60 · logistic regression · Easy
Which task is best suited for logistic regression?
Not quite. Try another option.
Answer: Predicting whether a tumor is benign or malignant
A binary yes/no outcome like benign vs malignant is exactly what logistic regression predicts.
Question 15 of 60 · unsupervised · Easy
Dimensionality reduction techniques such as PCA are considered:
Not quite. Try another option.
Answer: Unsupervised learning
PCA and similar methods find structure in unlabeled data to reduce features, which is an unsupervised task.
Question 16 of 60 · supervised · Easy
In supervised learning, what is the model trained to predict?
Not quite. Try another option.
Answer: The output label from input features
A supervised model learns a mapping from input features to the known output labels.
Question 17 of 60 · logistic regression · Easy
What is the range of the sigmoid function output in logistic regression?
Not quite. Try another option.
Answer: Between 0 and 1
The sigmoid function always produces values in the open interval , suitable for probabilities.
Question 18 of 60 · supervised · Easy
Which statement about classification is correct?
Not quite. Try another option.
Answer: It predicts discrete category labels
Classification is a supervised task that assigns inputs to discrete categories or classes.
Question 19 of 60 · unsupervised · Easy
Which scenario is an example of unsupervised learning?
Not quite. Try another option.
Answer: Segmenting customers into groups without predefined categories
Grouping customers without predefined labels is a clustering task, which is unsupervised.
Question 20 of 60 · logistic regression · Easy
Logistic regression is often used for which of the following?
Not quite. Try another option.
Answer: Binary classification
Logistic regression is most commonly applied to binary classification, predicting one of two possible classes.
Question 21 of 60 · supervised · Medium
A bank builds a model to predict a customer's exact credit score (a continuous value between 300 and 850) based on income, age, and debt. What type of supervised learning task is this?
Not quite. Try another option.
Answer: Regression
The target (credit score) is a continuous numeric value, so this is a regression task. Classification predicts discrete categories, while clustering and dimensionality reduction are unsupervised methods.
Question 22 of 60 · supervised · Medium
You are given a dataset of emails, each labeled as "spam" or "not spam". You train a model to predict the label for new emails. Which characteristic makes this a supervised learning problem?
Not quite. Try another option.
Answer: The training data includes labeled outputs for each input
Supervised learning requires labeled training data, where each input is paired with a known output. Here every email has a spam/not-spam label, defining a supervised classification task.
Question 23 of 60 · unsupervised · Medium
A retailer wants to group customers into segments based on purchasing behavior, but has no predefined categories. Which learning approach is most appropriate?
Not quite. Try another option.
Answer: Unsupervised clustering
With no predefined labels, the goal is to discover natural groupings. Clustering, an unsupervised technique, is designed exactly for this purpose.
Question 24 of 60 · logistic regression · Medium
In logistic regression for binary classification, the model outputs a probability using the sigmoid function . If , what is the predicted probability?
Not quite. Try another option.
Answer:
Substituting : . This is the decision boundary point where the model is equally uncertain between classes.
Question 25 of 60 · logistic regression · Medium
A logistic regression model uses a default threshold of to assign classes. For a sample it outputs a probability of . How is this sample classified?
Not quite. Try another option.
Answer: Positive class (1)
Since , the predicted probability exceeds the threshold, so the sample is assigned to the positive class (1).
Question 26 of 60 · supervised · Medium
Which of the following is a key difference between regression and classification in supervised learning?
In supervised learning, regression targets continuous numeric outputs while classification targets discrete class labels. Both use labeled data.
Question 27 of 60 · unsupervised · Medium
Which of the following tasks is an example of unsupervised learning?
Not quite. Try another option.
Answer: Grouping news articles into topics without predefined categories
Unsupervised learning works without labels. Grouping articles into unknown topics is clustering, whereas the other options rely on labeled target values (supervised).
Question 28 of 60 · logistic regression · Medium
Why is linear regression generally unsuitable for a binary classification problem where logistic regression is preferred?
Not quite. Try another option.
Answer: Its predictions are unbounded and can fall outside the probability range
Linear regression can output values below 0 or above 1, which are invalid as probabilities. Logistic regression applies the sigmoid to constrain outputs to .
Question 29 of 60 · logistic regression · Medium
In logistic regression, the term is called the log-odds or logit. If increases, what happens to the predicted probability?
Not quite. Try another option.
Answer: It increases toward 1
The sigmoid is monotonically increasing, so as grows the output approaches 1. Larger logits mean higher predicted probability of the positive class.
Question 30 of 60 · supervised · Medium
A model is trained on 1000 labeled images of cats and dogs, then tested on new unlabeled images. Which phase uses the labels directly?
Not quite. Try another option.
Answer: The training phase
Labels are used during training to learn the mapping from inputs to outputs. At test time the model predicts labels for new, unlabeled inputs.
Question 31 of 60 · unsupervised · Medium
A data scientist reduces a dataset from 50 features to 2 features to visualize it, without using any target variable. This is an example of which unsupervised task?
Not quite. Try another option.
Answer: Dimensionality reduction
Reducing the number of features while preserving structure, without labels, is dimensionality reduction (e.g., PCA), a core unsupervised technique.
Question 32 of 60 · logistic regression · Medium
Logistic regression is typically trained by minimizing which loss function?
Not quite. Try another option.
Answer: Binary cross-entropy (log loss)
Logistic regression uses binary cross-entropy (log loss), which penalizes confident wrong predictions heavily and matches the probabilistic sigmoid output.
Question 33 of 60 · logistic regression · Medium
A logistic regression coefficient for feature is . What does a positive coefficient indicate?
Not quite. Try another option.
Answer: Increasing raises the probability of the positive class
A positive coefficient increases the logit as grows, which raises the sigmoid output and thus the probability of the positive class.
Question 34 of 60 · supervised · Medium
Which pair of algorithm and problem type is correctly matched in supervised learning?
Not quite. Try another option.
Answer: Logistic regression — classification
Logistic regression is a supervised classification algorithm. K-means is unsupervised clustering, and linear regression is supervised regression (not clustering).
Question 35 of 60 · unsupervised · Medium
What is a common challenge when evaluating unsupervised clustering results compared to supervised models?
Not quite. Try another option.
Answer: There are no ground-truth labels to directly measure accuracy
Because unsupervised methods lack labels, standard accuracy cannot be computed. Evaluation relies on internal metrics like silhouette score or domain judgment.
Question 36 of 60 · logistic regression · Medium
If a logistic regression model predicts probability for the positive class, what is the odds ratio for that prediction?
Not quite. Try another option.
Answer:
Odds . This means the positive outcome is 4 times as likely as the negative outcome.
Question 37 of 60 · supervised · Medium
A model performs very well on training data but poorly on new test data. In supervised learning, this problem is known as:
Not quite. Try another option.
Answer: Overfitting
Overfitting occurs when a model memorizes training patterns (including noise) and fails to generalize to unseen data, causing poor test performance.
Question 38 of 60 · unsupervised · Medium
Which scenario best fits an unsupervised anomaly detection use case?
Not quite. Try another option.
Answer: Flagging unusual credit card transactions with no prior fraud labels
Detecting rare, unusual patterns without labeled examples is an unsupervised anomaly detection task. The other options use labeled targets (supervised).
Question 39 of 60 · logistic regression · Medium
To extend logistic regression to a problem with three or more mutually exclusive classes, which approach is commonly used?
Not quite. Try another option.
Answer: Softmax (multinomial) logistic regression
For multiple exclusive classes, the sigmoid is generalized to the softmax function, giving multinomial logistic regression that outputs a probability per class.
Question 40 of 60 · logistic regression · Medium
In a logistic regression model, the decision boundary separating the two classes (at threshold 0.5) corresponds to which condition on the logit ?
Not quite. Try another option.
Answer:
The threshold occurs when , which happens at . Thus the decision boundary is defined by .
Question 41 of 60 · logistic regression · Hard
In logistic regression, the log-likelihood is maximized instead of minimizing squared error. Why is the mean squared error (MSE) loss avoided when the model outputs ?
Not quite. Try another option.
Answer: MSE with the sigmoid yields a non-convex loss surface, causing gradient descent to get stuck in local minima
Combining MSE with the sigmoid produces a non-convex objective in the weights, so optimization can converge to poor local minima. Cross-entropy (log-loss) with the sigmoid is convex, guaranteeing a global optimum.
Question 42 of 60 · logistic regression · Hard
A logistic regression model gives coefficient for feature . Holding all else constant, a one-unit increase in changes the odds of the positive class by approximately what factor?
Not quite. Try another option.
Answer: Multiplies the odds by
The odds ratio is . Coefficients act multiplicatively on the odds, not additively on the probability.
Question 43 of 60 · logistic regression · Hard
During training on perfectly linearly separable data, the unregularized logistic regression weights tend to do what?
Not quite. Try another option.
Answer: Grow without bound as the log-loss keeps decreasing toward zero
With perfect separation, pushing weights larger makes predicted probabilities approach 0/1 and the loss keeps shrinking, so the magnitudes diverge. Regularization (e.g., L2) is needed to keep them finite.
Question 44 of 60 · supervised · Hard
You train a model with very low training error but high validation error. Adding more training examples barely helps. What is the most likely diagnosis and fix?
Not quite. Try another option.
Answer: High variance (overfitting); reduce model complexity or add regularization
A large train-validation gap with low training error signals high variance (overfitting). More data helps only slowly; reducing complexity or adding regularization directly addresses variance.
Question 45 of 60 · unsupervised · Hard
K-means is applied to data with two clusters of very different densities and non-spherical shapes. Why does it often fail?
Not quite. Try another option.
Answer: It assumes isotropic, equally-sized spherical clusters via Euclidean distance to centroids
K-means minimizes within-cluster squared Euclidean distance, implicitly assuming roughly spherical, similarly-sized clusters. Non-spherical or unequal-density clusters violate this, so points get misassigned.
Question 46 of 60 · logistic regression · Hard
In L1-regularized logistic regression, increasing the regularization strength tends to produce what effect distinct from L2?
Not quite. Try another option.
Answer: Drives some coefficients exactly to zero, performing feature selection
L1 (Lasso) penalty has a corner at zero that pushes weak coefficients to exactly zero, yielding sparse solutions. L2 shrinks coefficients smoothly but rarely to exactly zero.
Question 47 of 60 · supervised · Hard
For a highly imbalanced classification task (1% positives), which single metric is most misleading if used alone?
Not quite. Try another option.
Answer: Accuracy, since predicting all-negative already scores
With 1% positives, a trivial all-negative classifier achieves 99% accuracy while catching zero positives. Accuracy alone hides this failure; precision, recall, and F1 expose it.
Question 48 of 60 · logistic regression · Hard
The decision boundary of standard logistic regression in feature space is what geometric object?
Not quite. Try another option.
Answer: A hyperplane defined by
The predicted probability equals where , which is a linear hyperplane. The sigmoid is monotonic, so the boundary itself is linear despite the nonlinear output.
Question 49 of 60 · unsupervised · Hard
When using the elbow method to choose in K-means, why can it be unreliable?
Not quite. Try another option.
Answer: The within-cluster sum of squares often decreases smoothly with no clear elbow
For many real datasets the WCSS curve declines gradually without a sharp bend, making the elbow ambiguous. Metrics like silhouette score or gap statistic can supplement or replace it.
Question 50 of 60 · supervised · Hard
A colleague standardizes features using statistics computed over the entire dataset before splitting into train and test. What is the primary problem?
Not quite. Try another option.
Answer: Data leakage: test-set information influences the scaling applied to training
Fitting the scaler on all data lets test statistics leak into preprocessing, giving optimistic performance estimates. Scalers must be fit on training data only, then applied to the test set.
Question 51 of 60 · logistic regression · Hard
Softmax (multinomial logistic) regression with classes has a redundancy in its parameters. What is it?
Not quite. Try another option.
Answer: Adding a constant vector to all class weight vectors leaves predictions unchanged
Softmax is invariant to adding the same vector to every class's weights, so the parameterization is over-complete. Fixing one class's weights to zero (or regularizing) removes the redundancy.
Question 52 of 60 · unsupervised · Hard
PCA is applied for dimensionality reduction but the features have wildly different units and variances. What must be done first, and why?
Not quite. Try another option.
Answer: Standardize features, else high-variance features dominate the principal components
PCA maximizes variance, so features with large numeric scales dominate the components regardless of importance. Standardizing to unit variance ensures each feature contributes fairly.
Question 53 of 60 · logistic regression · Hard
You lower the classification threshold of a logistic regression model from to . What is the expected effect on recall and precision for the positive class?
Not quite. Try another option.
Answer: Recall increases while precision typically decreases
A lower threshold labels more instances positive, catching more true positives (higher recall) but also admitting more false positives (lower precision). The threshold trades one against the other.
Question 54 of 60 · supervised · Hard
In k-fold cross-validation, increasing toward leave-one-out (LOOCV) generally has what effect on the bias and variance of the performance estimate?
Not quite. Try another option.
Answer: Lower bias but higher variance of the estimate
Larger uses more data per training fold (lower bias), but the highly overlapping training sets make the fold estimates strongly correlated, raising the variance of the averaged estimate.
Question 55 of 60 · unsupervised · Hard
DBSCAN is often preferred over K-means when the data has what characteristic?
Not quite. Try another option.
Answer: Arbitrary-shaped clusters and noise/outliers to be flagged
DBSCAN groups points by density reachability, so it finds arbitrary shapes and labels sparse points as noise. K-means forces spherical partitions and assigns every point to a cluster.
Question 56 of 60 · logistic regression · Hard
The gradient of the logistic regression log-loss with respect to weights for one example is . What practical consequence follows when the model is very confident and wrong?
Not quite. Try another option.
Answer: The error term approaches its maximum, producing a large update
A confident wrong prediction makes near when (or vice versa), so the residual approaches , its largest magnitude, driving a strong corrective gradient. Confident-correct cases give near-zero gradients.
Question 57 of 60 · supervised · Hard
Two models have identical accuracy but different ROC-AUC values. What does the higher-AUC model do better?
Not quite. Try another option.
Answer: Ranks positive instances above negatives more consistently across all thresholds
AUC measures the probability that a random positive is scored higher than a random negative, i.e. ranking quality across thresholds. Accuracy is threshold-specific, so equal accuracy can coexist with different ranking ability.
Question 58 of 60 · unsupervised · Hard
A silhouette score close to for most points indicates what about the clustering?
Not quite. Try another option.
Answer: Points lie near the boundary between two clusters, so cluster separation is weak
Silhouette compares intra-cluster to nearest inter-cluster distance; values near mean a point is roughly equidistant to its own and a neighboring cluster, signaling overlapping, poorly-separated clusters.
Question 59 of 60 · supervised · Hard
Why is supervised learning fundamentally unable to solve a task where no labeled examples of the target exist, even with abundant data?
Not quite. Try another option.
Answer: It learns a mapping from inputs to known outputs, which requires labeled targets to fit
Supervised learning fits a function by minimizing error against known labels . Without labels there is no target to optimize toward, so an unsupervised or self-supervised approach is required.
Question 60 of 60 · logistic regression · Hard
You add a feature that is an exact linear combination of two existing features to a logistic regression model. What issue arises?
Not quite. Try another option.
Answer: Perfect multicollinearity makes the coefficient estimates unstable and non-unique
A redundant linear combination creates perfect multicollinearity, so infinitely many weight combinations give the same fit and individual coefficients become unidentifiable. Regularization or dropping the redundant feature resolves it.
That's unit 4
Answer a few questions and your score shows up here.
Nearly through. Did unit 4 of BTY587 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 4 of BTY587 save you a night before the exam?
Then you can help keep it free for the next batch. 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.