You have loaded a dataset with 1000 samples and 20 features into a Pandas DataFrame. Some samples have missing values for a few features. If you want to remove rows with fewer than 15 non-null values, what method would you use?
Q4MCQ2 marks
1.25
2.56
4.25
1.12
Given code will return an error.
Q5MCQ2 marks
It adjusts the learning rate based on the number of iterations.
It defines the initial value for the learning rate and keeps it constantthroughout training.
It determines the maximum step size allowed during training.
It specifies the fraction of the dataset used for each step in the stochasticgradient descent.
Q6MCQ2 marks
It determines the number of features to select for each base model.
It controls the number of base learners (models) to train in the ensemble.
It decides the maximum number of samples to use in each base model.
It ensures randomness in the sample selection for each base model.
Q7MCQ2 marks
The percentage of training samples used to train each base estimator.
The number of base estimators trained on subsets of the training data.
The maximum number of features used by each base estimator duringtraining.
The total number of samples used to train all base estimators combined.
Q8MCQ2 marks
It increases the variance among individual trees.
It decreases the variance among individual trees.
It reduces the number of samples used for training each tree.
It reduces overfitting by restricting tree depth.
Q9MCQ2 marks
The total amount spent by each customer.
The cluster assignments indicating which group each customer belongs to.
The number of items purchased by each customer.
The centroid coordinates of the clusters formed.
Q10MCQ2 marks
It increases the model’s capacity to fit the training data closely, potentiallycausing overfitting.
It adds a stronger regularization term to the loss function, reducing themodel’s complexity and helping prevent overfitting.
It makes the model more prone to overfitting by increasing its sensitivity tonoise in the training data.
It directly affects the learning rate, controlling how fast the model convergesduring training.
Q11MCQ2 marks
Consider the following two statements and select the correct answer: 1. Statement 1: The multinomial Naive Bayes classifier is suitable for classification with discrete features 2. Statement 2: Two dependent features do not impact GaussianNB performance because internally it calculates the conditional probability independently for each feature.
Both statements are True
Only statement 1 is True
Only statement 2 is True
Both statements are False
Q12MCQ3 marks
Q13MCQ3 marks
Q14MCQ3 marks
s1 = s2
s1 < s2
s1 > s2
Q15MCQ3 marks
Q16MCQ3 marks
[0]
[1]
[0.5]
[2]
Q17MCQ3 marks
Output score is likely to increase.
Output score is likely to decrease.
Output score may increase or decrease depending on other factors.
Output score will remain the same.
Q18MCQ3 marks
Outputs the number of iterations and the final silhouette score of the clusters.
Outputs the cluster labels for each data point and the maximum distancebetween clusters.
Outputs the coordinates of the cluster centroids and the number of points ineach cluster.
Outputs the coordinates of the cluster centroids and the sum of squareddistances of samples to their closest cluster center.
Q19MCQ3 marks
Q20MCQ3 marks
Q21MCQ3 marks
Q22MCQ4 marks
8
16
32
64
Q23MSQ2 marksselect all that apply
Which of the following are techniques for dimensionality reduction?
Auto-generated summary from the source site. Handy as a checklist; the lessons above explain each idea from scratch.
Here’s a structured summary of core topics, concepts, principles, and equations essential for the Diploma Level: Machine Learning Practice (Computer-Based Exam), along with Mermaid knowledge graphs to visualize relationships.
1. Core Topics & Concepts
A. Data Preprocessing
Key Concepts:
One-Hot Encoding (OneHotEncoder)
Converts categorical features into binary (0/1) columns.
Example:
from sklearn.preprocessing import OneHotEncoder
ohe = OneHotEncoder(sparse_output=False)
ohe.fit_transform([['apple'], ['banana'], ['apple']])
Output Shape: (n_samples, n_categories).
Note: If input has mixed types (e.g., `[['apple', 3], ['banana', 1]])**, all columns are treated as categorical by default (unless specified otherwise).
Correct Answer for Q2: D (6) (3 categories for fruit + 3 for numbers).
Feature Scaling
MinMaxScaler: Scales features to [0, 1] range.
Formula:
Xscaled=Xmax−XminX−Xmin
Key Attribute: scaler.data_max_ (stores max values per feature).
StandardScaler: Standardizes features to mean=0, std=1.
Formula:
Xscaled=σX−μ
Handling Missing Data
dropna() in Pandas:
thresh=N: Drops rows with fewer than N non-null values.
Example: df.dropna(thresh=15) keeps rows with ≥15 non-null values.
Polynomial Features
PolynomialFeatures(degree=d): Generates polynomial/combination features up to degree d.
Example (degree=2): Input: [[a], [b]] → Output: [[1, a, a²], [1, b, b²]].