Unit 1: Introduction and Data Preprocessing - Practice Quiz

INT395 — Supervised Learning 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 What is the primary characteristic of Supervised Learning?

A. The model interacts with an environment and learns via a reward system.
B. The model learns from a labeled dataset containing input-output pairs.
C. The model groups data points based on inherent similarities without predefined categories.
D. The model learns from unlabeled data to find hidden patterns.

2 Which of the following scenarios is a Regression problem?

A. Grouping customers based on purchasing behavior.
B. Predicting whether an email is spam or not.
C. Classifying an image as a cat or a dog.
D. Predicting the price of a house based on its square footage.

3 Which library in Python is the standard for implementing classic machine learning algorithms like Decision Trees and SVMs?

A. Pandas
B. Matplotlib
C. Scikit-learn
D. NumPy

4 In a dataset, Ordinal Data refers to:

A. Binary data (e.g., True/False).
B. Categorical data with no intrinsic order (e.g., Red, Blue, Green).
C. Categorical data with a clear ordering or ranking (e.g., Low, Medium, High).
D. Continuous numerical data (e.g., Height, Weight).

5 Which Pandas function is primarily used to load data from a Comma Separated Values file?

A. pd.load_csv()
B. pd.read_excel()
C. pd.import_data()
D. pd.read_csv()

6 What is the purpose of the df.describe() method in Pandas?

A. To provide summary statistics (mean, std, min, max) for numerical columns.
B. To visualize the correlation matrix.
C. To show the data types and non-null counts of columns.
D. To drop missing values from the dataframe.

7 When handling missing data, what is Imputation?

A. Converting the missing values to a specific category like "Unknown".
B. Replacing missing values with substituted values (e.g., mean, median, mode).
C. Ignoring the column containing missing values.
D. Removing the rows containing missing values.

8 Which visualization is most effective for identifying Outliers in a numerical feature?

A. Pie Chart
B. Box Plot
C. Scatter Plot
D. Bar Chart

9 In the context of outlier detection, what does the IQR (Interquartile Range) represent?

A. The distance between the mean and the median.
B. The difference between the maximum and minimum values.
C. The standard deviation of the dataset.
D. The difference between the 75th percentile () and the 25th percentile ().

10 What is the formula for Min-Max Scaling (Normalization)?

A.
B.
C.
D.

11 Which scaling technique transforms data to have a mean of 0 and a standard deviation of 1?

A. Standardization (Z-score normalization)
B. Min-Max Scaling
C. Log Transformation
D. Robust Scaling

12 Why is One-Hot Encoding preferred over Label Encoding for nominal categorical variables?

A. It requires less memory.
B. It is faster to compute.
C. It prevents the model from assuming a mathematical order or rank between categories.
D. It handles missing values automatically.

13 What is the Dummy Variable Trap?

A. When categorical variables are not encoded.
B. When the target variable is imbalanced.
C. When missing values are replaced by zeros.
D. When independent variables are highly correlated (multicollinearity) due to including all dummy variables.

14 Which technique is commonly used to handle Class Imbalance by generating synthetic samples for the minority class?

A. Stratified K-Fold
B. SMOTE (Synthetic Minority Over-sampling Technique)
C. Random Undersampling
D. Principal Component Analysis

15 What is the primary goal of Feature Selection?

A. To create new features from existing ones.
B. To scale features to the same range.
C. To fill missing values in the features.
D. To select a subset of relevant features to improve model performance and reduce complexity.

16 Which of the following is an example of a Wrapper Method for feature selection?

A. Correlation Matrix
B. Lasso Regression (L1 regularization)
C. Recursive Feature Elimination (RFE)
D. Variance Threshold

17 What is the purpose of train_test_split in machine learning?

A. To remove outliers from the data.
B. To separate numerical and categorical columns.
C. To split the dataset into features () and target ().
D. To split the dataset into training and validation/test sets to evaluate generalization.

18 What is Data Leakage?

A. When the variance of the data is too high.
B. When data is lost during file transfer.
C. When the model leaks sensitive user information.
D. When information from outside the training dataset (like the test set) is used to create the model.

19 Which plot is best for visualizing the relationship between two continuous variables?

A. Box Plot
B. Scatter Plot
C. Bar Chart
D. Histogram

20 In the context of Pandas, what does df.isnull().sum() return?

A. The sum of all values in the dataframe.
B. The count of unique values in each column.
C. The total number of rows in the dataframe.
D. The count of missing values in each column.

21 When performing a train-test split on an imbalanced dataset, which parameter ensures the class distribution is preserved in both sets?

A. stratify=y
B. random_state=42
C. shuffle=True
D. test_size=0.2

22 Which of the following is a technique for Dimensionality Reduction?

A. Principal Component Analysis (PCA)
B. Linear Regression
C. K-Nearest Neighbors
D. Logistic Regression

23 The Curse of Dimensionality refers to:

A. The error caused by using incorrect units of measurement.
B. Issues that arise when analyzing data in high-dimensional spaces (sparse data, increased computation).
C. The inability to add more features to a model.
D. The difficulty of visualizing 3D data.

24 What is Feature Engineering?

A. Removing all categorical variables.
B. Downloading datasets from the internet.
C. Selecting the best hardware for training.
D. The process of using domain knowledge to extract or create new features from raw data.

25 Which Scikit-learn module contains StandardScaler and MinMaxScaler?

A. sklearn.preprocessing
B. sklearn.linear_model
C. sklearn.metrics
D. sklearn.ensemble

26 If a feature has a Variance of 0, what does it imply?

A. The feature contains only one unique value for all samples.
B. The feature has missing values.
C. The feature has a high correlation with the target.
D. The feature is normally distributed.

27 Which of the following is considered Unstructured Data?

A. Images and Audio files.
B. A CSV file with labeled columns.
C. An Excel spreadsheet.
D. A SQL database table.

28 What does a correlation coefficient of -0.9 indicate between two features?

A. A weak negative linear relationship.
B. A strong negative linear relationship.
C. No relationship.
D. A strong positive linear relationship.

29 When using LabelEncoder, how is the data transformed?

A. It removes the column.
B. It converts text labels into binary columns.
C. It scales the data between 0 and 1.
D. It converts text labels into integers (0, 1, 2, ...).

30 Which algorithm is generally NOT sensitive to the scale of features?

A. K-Means Clustering
B. Support Vector Machines (SVM)
C. Decision Trees
D. K-Nearest Neighbors (KNN)

31 In Scikit-Learn, what is the role of the fit() method?

A. To make predictions on new data.
B. To split the data.
C. To learn parameters (e.g., mean, coefficients) from the training data.
D. To calculate the accuracy of the model.

32 What is the difference between fit_transform() and transform()?

A. fit_transform is used on the training set to learn parameters and apply them; transform is used on the test set using learned parameters.
B. They are identical and can be used interchangeably.
C. transform is only used for image data.
D. fit_transform is used on the test set; transform is used on the training set.

33 Which Seaborn plot is used to visualize the Distribution of a single numerical variable?

A. sns.heatmap()
B. sns.countplot()
C. sns.histplot() (or distplot)
D. sns.scatterplot()

34 How do you handle Duplicate Rows in Pandas?

A. df.remove_copies()
B. df.delete_repeats()
C. df.unique()
D. df.drop_duplicates()

35 In PCA, what represents the direction of maximum variance in the data?

A. The Eigenvalues
B. The Covariance matrix
C. The Principal Components (Eigenvectors)
D. The Mean vector

36 What is Target Encoding (or Mean Encoding)?

A. Encoding categorical variables based on the mean of the target variable for that category.
B. Replacing the target with the mean of the features.
C. Encoding the target variable into a One-Hot vector.
D. Assigning random numbers to the target.

37 Which of the following indicates a skewed distribution?

A. Mean = Median = Mode
B. The distribution is symmetrical.
C. The tail of the distribution is longer on one side than the other.
D. The standard deviation is 0.

38 What is the result of executing df.info()?

A. A concise summary of the DataFrame including index dtype, columns, non-null values, and memory usage.
B. A correlation heatmap.
C. A summary of statistical metrics.
D. The first 5 rows of the DataFrame.

39 Before feeding text data into a supervised learning model, it must be converted into numerical vectors. This process is called:

A. Imputation
B. Vectorization (e.g., TF-IDF, Bag of Words)
C. Normalization
D. Classification

40 Which method helps in identifying Multicollinearity among features?

A. ROC Curve
B. Scatter plot of Feature vs Target
C. Heatmap of the Correlation Matrix
D. Confusion Matrix

41 If a dataset has missing values that are MCAR (Missing Completely At Random), which handling method is generally safe if the dataset is large?

A. Dropping the rows with missing values.
B. Replacing with a constant like -1.
C. Leaving them as NaN.
D. Using a complex prediction model.

42 What is the advantage of using a Pipeline in Scikit-Learn?

A. It creates a graphical user interface.
B. It allows for parallel processing on GPUs.
C. It chains together multiple processing steps (scaling, encoding, modeling) into a single object, preventing data leakage.
D. It automatically selects the best algorithm.

43 Which feature selection method uses a model's coef_ or feature_importances_ attribute to select features?

A. Unsupervised Method
B. Filter Method
C. Wrapper Method
D. Embedded Method

44 What is the shape of the output of df.shape in Pandas?

A. (Total Elements,)
B. (Number of Columns, Number of Rows)
C. (Number of Unique Values,)
D. (Number of Rows, Number of Columns)

45 Which of the following is a Classification algorithm?

A. Polynomial Regression
B. Linear Regression
C. Ridge Regression
D. Logistic Regression

46 When detecting outliers using the Z-score method, a common threshold to identify an outlier is a Z-score absolute value greater than:

A. 3
B. 1
C. 1.5
D. 10

47 What is the correct syntax to drop a column named 'ID' from a Pandas DataFrame df?

A. df.drop('ID', axis=0)
B. df.remove('ID')
C. df.delete('ID')
D. df.drop('ID', axis=1)

48 Why is Data Exploration (EDA) a critical first step?

A. It automatically trains the model.
B. It is required by the Python interpreter.
C. It increases the size of the dataset.
D. To understand data structure, detect anomalies, test assumptions, and determine preprocessing needs.

49 Which encoding technique creates a binary column for every category level?

A. One-Hot Encoding
B. Target Encoding
C. Ordinal Encoding
D. Label Encoding

50 What is the main drawback of PCA?

A. It increases the dimensionality of the data.
B. It is computationally very expensive for small datasets.
C. The resulting Principal Components are often difficult to interpret in terms of original features.
D. It only works on categorical data.