Consider a dataset with values: [10, 12, 14, 15, 100]. Which statement best describes the effect of the outlier (100) on the mean and median?
Think about how mean and median are calculated and how extreme values affect them.
The mean sums all values and divides by count, so a large outlier increases the mean significantly. The median is the middle value when sorted, so one extreme value has little effect.
What is the output of the following Python code that detects outliers using the interquartile range (IQR)?
import numpy as np data = np.array([5, 7, 8, 12, 15, 18, 22, 100]) Q1 = np.percentile(data, 25) Q3 = np.percentile(data, 75) IQR = Q3 - Q1 outliers = data[(data < Q1 - 1.5 * IQR) | (data > Q3 + 1.5 * IQR)] print(outliers.tolist())
Calculate Q1, Q3, then find values outside 1.5 times the IQR range.
The IQR is Q3 - Q1. Values below Q1 - 1.5*IQR or above Q3 + 1.5*IQR are outliers. Here, only 100 is above the upper bound.
You have a dataset with many outliers. Which regression model is best suited to minimize the effect of outliers on predictions?
Consider which loss functions reduce the influence of extreme errors.
Huber loss combines squared loss for small errors and absolute loss for large errors, reducing outlier impact. Least squares and ridge are sensitive to outliers. Polynomial regression can overfit outliers.
When using DBSCAN clustering on data with noise and outliers, which hyperparameter adjustment helps to better identify outliers as noise points?
Think about how changing min_samples affects noise detection.
Increasing min_samples means a cluster needs more points, so fewer small groups form clusters, and more points are labeled as noise (outliers). Decreasing eps or min_samples has opposite effects.
You have a classification dataset with imbalanced classes and some outliers. Which metric is most reliable to evaluate model performance in this scenario?
Consider metrics that balance false positives and false negatives in imbalanced data.
Accuracy can be misleading with imbalanced data. Precision alone ignores false negatives. F1-score balances precision and recall, providing a better measure. MSE is for regression, not classification.
