Machine Learning 2marks R23
Machine Learning 2marks R23
K-Nearest Neighbor (KNN) is considered simple because it does not require any complex assumptions or explicit model building; it only requires a proximity measure to compare data points. However, KNN can be inefficient for large datasets as the entire training set must be stored in memory, and the classification/regression of a new data point requires computing its distance to all other points, which can be computationally intensive. Moreover, KNN is sensitive to the chosen distance metric and the presence of noise in the dataset, which can degrade its performance on larger scales .
The kernel trick enables Support Vector Machines (SVM) to effectively handle non-linearly separable data by implicitly mapping inputs into a higher-dimensional space. Instead of transforming data explicitly—which can be computationally expensive—the kernel trick computes inner products in the transformed space using a kernel function. This allows SVMs to create complex, non-linear decision boundaries in the original feature space, capturing intricate patterns without directly increasing the computational burden associated with transformations. This capability enhances SVM's flexibility and makes it powerful for a wide range of classification problems .
Random Forest offers several advantages over a single decision tree. It reduces overfitting by averaging the results of multiple trees, leading to improved generalization on unseen data. Each tree in a Random Forest is constructed with a random subset of features and data samples, which encourages diversity among trees and reduces the variance typically associated with decision trees. This ensemble approach enhances model robustness, leading to better accuracy and predictive power, particularly when dealing with complex datasets with high dimensionality and non-linear relationships .
Reinforcement learning differs primarily in its objective and methodology. In supervised learning, the system learns from a labeled dataset, where inputs and the corresponding outputs are known, focusing on minimizing error in predictions. Unsupervised learning, on the other hand, deals with unlabeled data and aims to find patterns or structures within the data without explicit output instructions. Reinforcement learning involves an agent interacting with an environment to maximize some notion of cumulative reward. The learning is based on the agent's actions and the feedback it receives, which differs fundamentally from the error-correction focus in supervised learning and the pattern-discovery focus in unsupervised learning .
Logistic regression is preferred over linear regression when the task is classification rather than predicting continuous values. Logistic regression is specifically designed for binary outcomes and estimates the probability of a given input belonging to a specific class. It applies a logistic function to model binary dependent variables, making it suitable for classification tasks such as spam detection or predicting whether a user will click on an advertisement. Linear regression, in contrast, predicts a continuous output, making it inappropriate for binary outcome predictions as it can produce values outside the (0,1) range .
The Expectation Maximization (EM) algorithm is particularly useful for clustering tasks due to its iterative refinement of cluster assignments based on probabilistic models. It works by alternating between the expectation step, which calculates the expected membership probabilities for each data point relative to existing cluster centers, and the maximization step, which recalculates the parameters of the probabilistic models to maximize the likelihood function. This iterative process continues until convergence, typically yielding cluster assignments that model the data distribution well. EM is particularly effective in scenarios with hidden variables and incomplete data sets, such as Gaussian Mixture Models, making it highly adaptable and powerful for complex clustering tasks .
Divisive and agglomerative clustering represent two contrasting approaches to cluster formation. Divisive clustering starts with the entire dataset as one cluster and recursively splits it into smaller clusters until each data point becomes its own cluster or a predefined number of clusters is reached. Agglomerative clustering follows a bottom-up approach, where each data point starts as its own cluster, and clusters are iteratively merged based on their similarity, until a single cluster or a desired number of clusters is achieved. Divisive is often considered computationally intensive for large datasets compared to agglomerative, which tends to be less efficient but is easier to implement due to its simple, intuitive merging process .
Soft clustering is a concept where data points can belong to multiple clusters with assigned probabilities rather than solely one cluster. This approach is beneficial in scenarios where boundaries between groups are not clear-cut, such as in image processing, topic modeling, and market segmentation. Soft clustering captures the degree of association for overlapping data points, providing richer insights into data structures where membership is not exclusive. Its application can lead to better understanding of how data is spread across multiple dimensions, facilitating superior qualitative assessments compared to hard clustering techniques .
Impurity measures like Gini Index and Entropy are used to determine the best split points in constructing decision trees. They quantify the disorder or heterogeneity of a dataset and are used to evaluate how well a feature separates the classes. A lower impurity indicates a more homogeneous split. During the decision tree building process, features that result in the maximum reduction in impurity are chosen for splits, thus creating more accurate and efficient models. By minimizing impurity, decision trees can effectively categorize data based on the most informative features .
Feature engineering is crucial as it directly influences the performance of machine learning models. It involves creating, transforming, or selecting relevant features that help models generalize better by capturing underlying patterns effectively. Proper feature engineering can reduce the dimensionality and noise of data, leading to improved model accuracy and efficiency. For example, transforming raw data into meaningful features can enhance the predictive power of algorithms and enable simpler models to achieve comparable performance to more complex ones without extensive parameter tuning .