Home / Past papers / MLP End Term / this paper

What will be the output of the following block of code? 



What is the output of the following block of code? 



What is the output of the following code snippet?
Which of the options will be the correct output for the following code snippet? 



Which of the options will be the correct output for the following code snippet? 



Which of the following options is correct explained variance score for the following code snippet applying PCA technique.
Which of the following options is the correct output of the following block of code? 







Which of the following options represent the correct output of the following block of code? 




Which of the following options is the possible output for the following block of code?
What operation does the following code implement?
Which of the following options represent the recall value for the class 2 in the confusion matrix shown in Figure 1 if y_true = [0, 1, 2, 2, 2], y_pred = [0, 0, 2, 2, 1] ?
Consider the following code block and mark the correct output.
Consider X and y as the training dataset. What will be the output of the following code?
Consider the following block of code and mark all possible correct options.
What will be the output of the following code block: 



Which of the following options represent the output of the following block of code? 



Which of the following statements will be true based on the following diagram?
Which of the following options is the correct output of the following block of code?
Which of the following is likely to be the correct output of the code given below?
For the following block of code, we get the output as 0.9875. How would the output change if we decrease max depth value ?:
Consider the following block of code and mark the correct option.
Consider the following code snippet. What value should we fill at the blank place, so that given code block creates graph as shown below:
Calculate the coefficient of determination (R2) [up to 1 decimal point] based on the following block of code.
In the given block of code, the Iris dataset having shape (150,4) has been loaded for model training. What do you think will be the output of the code given below?
Code snippet written below plots a graph for some dataset X as shown below. In the given dendrogram which sample is most similar to the sample having label as 1 ?

What will be the output of the following code?
What will be the output of the following code? 
Which of the following is likely to be the correct output:
Which of the following is/are true about the following block of the code? 



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 exam, along with Mermaid knowledge graphs to visualize relationships.
Datasets:
load_* (e.g., load_wine, load_iris) and fetch_* (e.g., fetch_california_housing) return a Bunch object (dictionary-like with keys like data, target, feature_names).make_blobs generates synthetic datasets for clustering/classification.
n_samples, centers, n_features, random_state.(n_samples, n_features).Data Preprocessing:
Scaling:
StandardScaler: Standardizes features (mean=0, std=1).
scaler.mean_: Mean of training data.scaler.transform(X): Applies scaling.MaxAbsScaler: Scales by maximum absolute value (preserves sparsity).add_dummy_feature: Adds a column of 1s (bias term) to X.Encoding:
MultiLabelBinarizer: Converts multi-label data to binary matrix.PolynomialFeatures: Generates polynomial/interaction features.
degree=2, interaction_only=True: Includes only interactions (e.g., ), not squares ().Model Evaluation:
Cross-Validation:
LeaveOneOut: Splits data into n_samples folds (each sample is a test set once).train_test_split: Splits data into train/test sets.Metrics:
r2_score: Coefficient of determination ().confusion_matrix: TP, TN, FP, FN for classification.where = mean, = standard deviation.
(If interaction_only=True, excludes squares.)
Linear Models:
LinearRegression: Fits linear coefficients via OLS.LogisticRegression: Binary/multi-class classification (uses softmax for multi-class).SGDRegressor: Linear regression with stochastic gradient descent.
shuffle=True: Shuffles data each epoch.Perceptron: Linear classifier (converges if data is linearly separable).RidgeCV: Ridge regression with built-in cross-validation for alpha.Tree-Based Models:
DecisionTreeClassifier:
max_depth, min_samples_split, min_samples_leaf.n_features_in_: Number of features in training data.RandomForestClassifier: Ensemble of decision trees.Neural Networks:
MLPClassifier/MLPRegressor:
hidden_layer_sizes: Tuple specifying neurons per layer (e.g., (8, 12)).activation: 'logistic', 'relu', etc.out_activation_: Always 'softmax' for classification (even if activation='logistic').n_layers_: Total layers = input + hidden + output.Support Vector Machines (SVM):
SVC(kernel='linear'): Linear kernel.support_vectors_: Training samples defining the decision boundary.where = sigmoid function.
where = proportion of class .
Support vectors satisfy .
Clustering:
KMeans:
n_clusters: Number of clusters.inertia_: Sum of squared distances to nearest cluster center (WCSS).inertia_ vs. n_clusters to find optimal .Hierarchical Clustering:
sch.dendrogram: Visualizes cluster merges.method='ward': Minimizes variance when merging clusters.Dimensionality Reduction:
PCA:
n_components: Number of principal components.explained_variance_ratio_: Proportion of variance explained by each PC.[1., 0.] (all variance in 1st PC).where = eigenvectors of .
where = cluster centroids.
Cross-Validation:
GridSearchCV: Exhaustive search over hyperparameters.VotingClassifier: Combines multiple models (e.g., logistic regression + random forest).
voting='hard': Majority vote.voting='soft': Predicts class with highest average probability.Metrics:
strategy='mean' predicts the mean of y).Consistency:
fit(), predict(), transform(), or score() methods.model = SVC(C=1.0)).Composition:
Pipeline: Chains transformers and estimators.FeatureUnion: Applies multiple transformers in parallel.Inspection:
_ (e.g., coef_, feature_importances_).Scikit-Learn Syntax:
load_*/fetch_* return Bunch objects.make_blobs generates synthetic data with shape (n_samples, n_features).shape (e.g., data.data.shape, not data.data.shape()).Preprocessing:
StandardScaler centers and scales data.PolynomialFeatures(degree=2, interaction_only=True) generates .Models:
LogisticRegression uses softmax for multi-class.MLPClassifier’s out_activation_ is always softmax.DecisionTreeClassifier’s n_features_in_ = number of input features.Evaluation:
LeaveOneOut generates n_samples splits.explained_variance_ratio_ for PCA sums to 1.API Design:
Pipeline for chaining steps, FeatureUnion for parallel transformations.