DM Chapter 0
DM Chapter 0
- Chapter 0: Introduction to ML
- Chapter 1: K nearest neighbors
- Chapter 2: Association Rule Mining
- Chapter 3: Naive Bayes classifier
- Chapter 4: Decision tree for classification and Regression
- Chapter 5: Random Forest
- Chapter 6: Model Performance
- Chapter 7: Artificial Neural Network
- Chapter 8: Introduction to XAI ( Explainable AI—Machine Learning)
- Chapter 9: Convolutional neural network (CNN)
Introduction to ML
Machine learning is a subset of artificial intelligence (AI) that enables computers to learn from data and make
predictions without being explicitly programmed.
Machine learning teaches computers to recognize patterns and make decisions automatically using data and
algorithms.
It can be broadly categorized into three types:
● Supervised Learning: Trains models on labeled data to predict or classify data.Over time, it adjusts itself to
minimize errors and improve accuracy.
● Unsupervised Learning: Finds patterns or groups in unlabeled data, like clustering or dimensionality
reduction.
● Reinforcement Learning: Learns through trial and error to maximize rewards, ideal for decision-making
tasks.
Supervised Learning
Key word: predictions
Logic:
- You take a cleaned dataset/labeled data
- You split it into 2 subsets
- The first subset will be used to train the model
- The second subset will be used to test the model
- Data is usually split in the ratio of 80:20
- Pick a model
- Then, there are 2 phases:
- Phase 1: training the model, using the first subset
The algorithm learns to identify patterns and relationships between the input and output data.
- Phase 2: testing the model, using the second subset
We evaluate the accuracy of the model
- If we are satisfied with the accuracy of our model (%), we deploy it
Types:
The type of supervised ML depends on the type of target variable.
Linear Regression Regression Predict continuous output values Linear equation minimizing sum of squares of residuals Predicting continuous values
Logistic Regression Classification Predict binary output variable Logistic function transforming linear relationship Binary classification tasks
Model decisions and their Tree-like structure with decisions and outcomes (decision Classification and Regression
Decision Trees Both
possible outcomes theory) tasks
Predict class or value based on k Finding k closest neighbors and predicting based on Classification and Regression
KNN Both
closest neighbors majority or average tasks, sensitive to noisy data
Types:
There are mainly 3 types of algorithms that are used for unsupervised datasets.
● Clustering
○ Kmeans
○ Hierarchical
○ DBSCAN
○ Spectral
● Association Rule Learning
● Dimensionality Reduction
○ PCA
○ …
Deep learning
Deep learning is a type of machine learning that teaches computers to perform tasks by learning from examples,
much like humans do. Imagine teaching a computer to recognize cats: instead of telling it to look for whiskers, ears,
and a tail, you show it thousands of pictures of cats. The computer finds the common patterns all by itself and
learns how to identify a cat. This is the essence of deep learning.
In technical terms, deep learning uses neural networks, which are inspired by the human brain. These networks
consist of layers of interconnected nodes that process information. The more layers, the "deeper" the network,
allowing it to learn more complex features and perform more sophisticated tasks.
Lazy Learning
Lazy learning is a type of machine learning that doesn't process training data until it needs to make a
prediction. Instead of building models during training, lazy learning algorithms wait until they encounter
a new query. This method stores and compares training examples when making predictions. It's also
called instance-based or memory-based learning.
One of the most popular lazy learning algorithms is the k-nearest neighbors (k-NN) algorithm. In k-NN,
the k closest training instances to the query point are considered, and their class labels are used to
determine the class of the query. Lazy learning methods excel in situations where the underlying data
distribution is complex or where the training data is noisy.