Looking for Machine Learning: Theory and Practice-Lecture,Section-1-Fall 2025 test answers and solutions? Browse our comprehensive collection of verified answers for Machine Learning: Theory and Practice-Lecture,Section-1-Fall 2025 at moodle.nu.edu.kz.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Consider the following code snippet for a nearest centroid classifier:
from sklearn.datasets import load_digitsfrom sklearn.model_selection import train_test_splitfrom sklearn.metrics import accuracy_scoreimport numpy as np
digits = load_digits()X, y = digits.data, digits.targetX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
centroids, classes = compute_centroids(________) # Fill the missing termy_pred = predict_centroids(centroids, classes, X_test)
print("Accuracy:", accuracy_score(y_test, y_pred))
What should replace the blank ________ to correctly compute the centroids?
Which of the following expressions correctly represents the L2 regularization (Ridge) term added to a linear regression cost function?
Which of the following is the correct form of the logistic regression cost function for a single training example?
Which of the following is the correct Gradient Descent update approach?
Which scikit-learn command correctly trains a Nearest Centroid Classifier on training data X_train and y_train and makes predictions on X_test?
Which of the following best describes Batch Gradient Descent?
A model has 98% training accuracy but only 65% test accuracy. Which fitting type is this most likely?