0% found this document useful (0 votes)
4 views3 pages

Supervised & Unsupervised Learning Guide

The document covers key concepts in supervised and unsupervised machine learning, including regression techniques like linear and polynomial regression, and classification methods such as logistic regression and support vector machines. It also discusses the challenges of underfitting and overfitting, along with regularization techniques, and introduces ensemble methods like bagging and boosting. Overall, it provides a foundational understanding of various machine learning algorithms and their applications.

Uploaded by

anveshas2911
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Supervised & Unsupervised Learning Guide

The document covers key concepts in supervised and unsupervised machine learning, including regression techniques like linear and polynomial regression, and classification methods such as logistic regression and support vector machines. It also discusses the challenges of underfitting and overfitting, along with regularization techniques, and introduces ensemble methods like bagging and boosting. Overall, it provides a foundational understanding of various machine learning algorithms and their applications.

Uploaded by

anveshas2911
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Machine Learning Notes

Module II: Supervised Learning

1. Regression

a. Linear Regression:

- Used to predict continuous numerical values.

- Fits a line y = mx + c to the data by minimizing the mean squared error.

- Assumes a linear relationship between input variables and output.

b. Polynomial Regression:

- Extends linear regression by considering polynomial terms (x^2, x^3, etc.).

- Can model non-linear relationships.

- More flexible but risks overfitting if the degree is too high.

2. Classification

a. Logistic Regression:

- Used for binary classification.

- Uses the sigmoid function to predict probabilities.

- Decision boundary is determined by probability threshold (usually 0.5).

b. k-Nearest Neighbor (KNN):

- Lazy learning algorithm that stores training data.

- For a test sample, it finds the k closest training samples and predicts the majority class.

- Sensitive to the choice of k and distance metric.

c. Support Vector Machine (SVM):

- Finds the best hyperplane that maximally separates data points of different classes.

- Effective in high-dimensional spaces.

- Kernel trick allows it to perform well on non-linear data.

d. Decision Tree Classifier:


Machine Learning Notes
- Tree-like model where nodes represent tests on features and leaves represent outcomes.

- Uses criteria like Gini Index or Entropy to split nodes.

- Easy to interpret but prone to overfitting.

e. Naïve Bayes Classifier:

- Based on Bayes' Theorem: P(A|B) = [P(B|A) * P(A)] / P(B).

- Assumes features are conditionally independent.

- Very fast and works well for text classification problems.

Module III: Unsupervised Learning, Overfitting, and Ensemble Methods

1. Unsupervised Learning

a. K-Means Clustering:

- Partitions data into k clusters by minimizing intra-cluster variance.

- Algorithm steps: initialize centroids, assign points to nearest centroid, update centroids.

- Simple and efficient, but requires specifying k.

b. Hierarchical Clustering:

- Builds a hierarchy of clusters using agglomerative (bottom-up) or divisive (top-down) approaches.

- Result is visualized using a dendrogram.

- No need to specify number of clusters upfront.

2. Underfitting vs Overfitting

- Underfitting: Model is too simple, can't capture data patterns (high bias).

- Overfitting: Model is too complex, captures noise in data (high variance).

- Goal: Find a balance between bias and variance.

Regularization:

- Adds a penalty to model complexity to reduce overfitting.

- L1 Regularization (Lasso): Can shrink some coefficients to zero (feature selection).


Machine Learning Notes
- L2 Regularization (Ridge): Penalizes large coefficients but keeps all features.

3. Ensemble Methods

a. Bagging:

- Stands for Bootstrap Aggregating.

- Combines results of multiple models trained on random subsets of data.

- Example: Random Forest (ensemble of decision trees).

b. Boosting:

- Trains models sequentially, each new model focuses on correcting previous errors.

- Reduces bias and improves performance.

- Examples: AdaBoost, Gradient Boosting.

c. AdaBoost:

- Assigns weights to instances, emphasizing misclassified ones.

- Combines weak learners into a strong learner using weighted majority voting.

Common questions

Powered by AI

Hierarchical clustering offers the advantage of not requiring the number of clusters to be specified a priori, unlike k-means clustering which requires specifying 'k' in advance . Hierarchical clustering builds a hierarchy of clusters through a bottom-up or top-down approach and visualizes the cluster arrangement using a dendrogram, which can help identify the optimal number of clusters naturally . This flexibility is particularly beneficial when the number of clusters is unknown beforehand.

The k-nearest neighbor (KNN) algorithm is inherently sensitive to variations in data distributions as it relies on distance metrics to classify data points based on the majority class of the k closest neighbors . This sensitivity depends heavily on the chosen distance metric, such as Euclidean or Manhattan distance, which can significantly affect classification accuracy, especially in non-uniformly distributed data . The effectiveness of KNN also hinges on the appropriate selection of 'k', as too small a 'k' might capture noise while too large a 'k' could oversimplify the model.

Linear regression assumes a linear relationship between input and output variables, fitting a line y = mx + c to minimize mean squared error . Polynomial regression, while extending linear regression, introduces polynomial terms like x^2, x^3, etc., allowing for modeling of non-linear relationships . This flexibility can capture more complex data patterns but also risks overfitting if the polynomial degree is too high .

A naive Bayes classifier would be preferred over a decision tree classifier in text classification tasks due to its speed and efficiency, particularly in handling large vocabularies and datasets . Naive Bayes assumes conditional independence among features, making it well-suited for the bag-of-words model used in text classification, while decision trees can become overcomplicated as they split nodes based on features, potentially leading to overfitting and less efficient processing .

Regularization addresses overfitting by adding a penalty for model complexity, thereby discouraging overly complex models that capture noise . L1 regularization (Lasso) can shrink some coefficients to zero, effectively performing feature selection . L2 regularization (Ridge) penalizes large coefficients to prevent complexity but retains all input features . This helps in achieving an optimal balance between bias and variance in the model, reducing overfitting.

Polynomial regression increases the risk of overfitting by fitting a model with high-degree polynomial terms that can capture noise in the data . The increased flexibility provided by these terms allows the model to fit the training data very closely, including its noise, leading to poor generalization on unseen data. To mitigate this risk, regularization techniques like L1 (Lasso) or L2 (Ridge) can be applied to penalize the complexity of the model, or alternatively, cross-validation can be used to tune the degree of the polynomial effectively .

A support vector machine (SVM) is more advantageous in high-dimensional spaces and non-linear classification tasks due to its ability to find the best hyperplane that maximally separates data points with the kernel trick . In contrast, k-nearest neighbors (KNN) is sensitive to the choice of k and the distance metric, and it can become computationally expensive as the feature space dimensionality increases . Therefore, in scenarios with high dimensionality or when a clear separation is needed in non-linear data, SVM would be preferable.

In logistic regression, the decision boundary is determined by the sigmoid function, predicting probabilities and using a probability threshold (usually 0.5) as the cutoff for binary classification . Support vector machines (SVM), conversely, determine the decision boundary by identifying the hyperplane that maximally separates data points of different classes, focusing on maximizing the margin between them . SVM's boundary is sensitive to the choice of kernel, which allows it to handle non-linear separations effectively.

Boosting, and specifically AdaBoost, reduces bias by sequentially training models such that each new model focuses on correcting the errors made by the previous models . In AdaBoost, this is achieved by assigning weights to instances, emphasizing misclassified ones, and combining weak learners into a strong ensemble through weighted majority voting . This iterative correction of errors allows AdaBoost to decrease bias significantly while enhancing the overall prediction accuracy of the model.

Decision trees are prone to overfitting, especially when the tree is too deep or complex, and can be highly sensitive to variations in data (high variance). Random forest addresses these challenges by employing bagging, where multiple decision trees are trained on random subsets of the data, and their predictions are aggregated . This approach reduces overfitting and variance by leveraging the ensemble of decision trees instead of relying on a single model, leading to more stable and accurate predictions.

You might also like