Machine Learning Exam Questions 2024
Machine Learning Exam Questions 2024
Challenges in machine learning implementation include overfitting, lack of interpretability, computational cost, and reliance on large volumes of quality data. Empirical risk minimization helps address overfitting by providing a framework to select hypotheses based on their performance on a training set while controlling error rates. It attempts to reduce the discrepancy between predicted and true outcomes by minimizing the empirical loss, though it must be balanced with model complexity to avoid overfitting .
Statistical foundations are crucial as they provide the theoretical basis for analyzing and understanding data, enabling the development of models that can make predictions or decisions. The trade-offs in statistical learning often involve the balance between bias and variance. A model with high bias may oversimplify the data, missing relevant relations between inputs and outputs, whereas a model with high variance can model the noise instead of the underlying data. Therefore, achieving a balance between bias and variance is essential for building robust models .
Random Forest determines feature importance often by looking at how much each feature, when split upon, reduces impurity across all trees in the forest. Features that result in significant splits are considered important. This can also be evaluated by the mean decrease in Gini impurity or by observing the frequency at which various features are selected across different decision trees. This internal mechanism helps prioritize which features to consider for better model efficiency and accuracy .
Boosting algorithms such as AdaBoost differ from other ensemble methods by focusing sequentially on building models that correct the errors of previous ones, emphasizing on instances that are hard to classify. Unlike bagging methods that train models independently and aggregate their votes, boosting aims to create a strong classifier from a series of weak classifiers by adjusting weights on misclassified points and incrementally improving model accuracy with each iteration .
Ensemble methods are considered effective because they combine predictions from multiple models to improve generalization compared to individual algorithms. Methods like bagging, boosting, and stacking enhance predictive performance by reducing variance, bias, or improving model accuracy. They effectively mitigate the risks of overfitting associated with using a single predictive model, leading to better balanced and more robust model predictions .
Classification problems involve predicting a discrete label, such as spam vs. not-spam in email filtering. Regression problems predict continuous values, for instance, forecasting the temperature for the next day. Classification is used for categorizing data, while regression deals with predicting quantities. The approaches also differ in that classification uses metrics like accuracy and precision, whereas regression relies on mean squared error or similar metrics to evaluate model performance .
Supervised learning algorithms involve a learning process with labeled data, where the model gets trained with input-output pairs, such as classification and regression problems. In contrast, unsupervised learning algorithms work with data that is not labeled, exploring how the data is organized or clustered. Key characteristics include the fact that supervised learning aims to predict an outcome based on input data, while unsupervised learning is more about finding hidden patterns or intrinsic structures within the input data alone .
A support vector is a data point that lies closest to the decision boundary; the position and values of support vectors establish the optimal separating line or hyperplane in Support Vector Machines (SVM). The maximal margin is important as it corresponds to the greatest possible distance between the separating hyperplane and the nearest data points of any class. Maximizing the margin enhances SVM's ability to generalize well to unseen data, making the classification more robust and less prone to overfitting .
In SVM classification, linear datasets are those that can be separated by a straight line or flat hyperplane. Non-linear datasets require a more complex model to create a decision boundary, using kernel tricks such as polynomial or radial basis function kernels to map data into higher dimensions in which a linear separator may be found. The choice of kernel transforms makes it possible to handle complex relationships within the data better, permitting SVMs to classify more complex patterns .
To implement the K-Means clustering algorithm: 1) Choose the number of clusters, k, and initialize the cluster centroids randomly. 2) Assign each data point to the nearest centroid based on the Euclidean distance. 3) Recompute the centroids as the mean of the points assigned to each cluster. 4) Repeat the assignment and update steps until convergence, indicated by minimal changes in cluster centroids. This iterative process helps in identifying natural groupings in data .