Home / Past papers / MLP End Term / this paper

Consider the following code snippet:






The following code attempts to implement Ridge regression on the Boston housing dataset but contains an error. The missing part should be correctly filled in to avoid issues during training.
Which of the following correctly fills the missing part while ensuring proper preprocessing?








































































What is the given code below trying to accomplish for the given titanic dataset ?






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.
Scaling/Normalization:
[0, 1] range.Encoding Categorical Data:
Handling Missing Data:
df.isnull().sum(): Counts NULL values.df.fillna(): Imputes missing values.Polynomial Features:
d and n original features:PCA (Principal Component Analysis):
n_components: Number of principal components to retain.| Technique | Equation |
|---|---|
| MinMax Scaling | |
| Standard Scaling | |
| Polynomial Features | (for degree d and n features) |
Linear Models:
SGDRegressor:
penalty='l1' or 'l2'.constant, invscaling, adaptive.invscaling learning rate:Logistic Regression:
C (inverse of regularization strength).liblinear, lbfgs, saga (for small/large datasets).Naïve Bayes:
Types:
Support Vector Machines (SVM):
linear, poly, rbf, sigmoid).C controls trade-off between margin width and classification error.k-Nearest Neighbors (k-NN):
p=1), Minkowski.Ensemble Methods:
learning_rate controls contribution of each tree.Random Forest:
max_features: Number of features considered for splits.bootstrap: Whether to sample with replacement.oob_score: Out-of-bag error for generalization estimate.weights control influence.| Algorithm | Key Equation/Parameter |
|---|---|
| Ridge Regression | |
| Lasso Regression | |
| SGD Learning Rate | (invscaling) |
| SVM Margin | (margin width) |
| k-NN Distance | (Minkowski) |
k-Means Clustering:
k-means++ spreads initial centroids to avoid poor clusters.k to find optimal k.Hierarchical Clustering:
| Technique | Equation |
|---|---|
| k-Means Objective | |
| Silhouette Score | (where = intra-cluster distance, = inter-cluster distance) |
Classification:
Regression:
Imbalanced Data:
| Metric | Equation |
|---|---|
| Accuracy | |
| Precision | |
| Recall | |
| F1-Score | |
| MSE |
k folds for robust evaluation.hidden_layer_sizes (e.g., (100, 50)).relu, logistic, tanh.adam, sgd, lbfgs.PCA:
n_components: Number of principal components.Feature Selection:
SelectKBest: Selects top k features based on statistical tests.Data Preprocessing:
MinMaxScaler vs. StandardScaler.OneHotEncoder and PolynomialFeatures.PCA reduces dimensions but loses interpretability.Supervised Learning:
invscaling, adaptive).p=1) vs. Euclidean (p=2) distance.RandomForest uses max_features and bootstrap.Model Evaluation:
Unsupervised Learning:
k-means++ for better initialization.k.Hyperparameter Tuning:
GridSearchCV vs. RandomizedSearchCV.Neural Networks:
MLPRegressor requires hidden_layer_sizes and solver.early_stopping prevents overfitting.Common Pitfalls:
learning_rate in AdaBoost or increase regularization.