U1 - ML
U1 - ML
U1 - ML
- Machine Learning is a branch of Artificial Intelligence (AI), which focuses on development of algorithms and
statistical models that enable computers to learn and make precise decisions or predictions, about the given
input data.
- These algorithms/statistical models are initially trained with the training data sets and feedback from humans.
- Hence, these learning models are completely feedback driven models.
- It follows the below steps, iteratively, to train the model and make it efficient and fully optimized.
+ Consider a human written algorithm which takes an input, processes it, and produces an output.
1. A machine learning model takes an input, processes it with the algorithm and produces an output.
2. The human/automated-process gives feedback on the accuracy of the produced output, with the
expected output.
3. Based on that feedback, the model adjusts the algorithm (code) by itself without any human
interventions, to meet the expected output criteria.
- Hence, ML models are feedback-driven / experience-based models which iteratively adjusts an algorithm
based on the provided feedback, to meet the expected output results from the algorithm.
- Concept Learning is the process of inferring (concluding based on some evidence) the general rules from the
given instances (evidence).
- These inferred general rules are then used for classifying the new/unseen instances.
- Hence, Concept Learning is based on Supervised Learning.
- A Concept can be considered as a Boolean-valued function.
- Hence, Concept Learning Task is the process of learning the concept or pattern from a set of labeled data
(instances with classes) and generalizing it to classify new/unseen instances.
- For Example: Consider a classification task where the goal is to distinguish b/w images of cats and dogs.
(Image-classifier for cats and dogs images)
- Here, “cats” and “dogs” are the concepts.
- Features/Attributes for “cats” concept are => { pointy ears, whiskers, fur texture }
- Features/Attributes for “dogs” concept are => { floppy ears, snout shape, tail length }
- Hence the Concept Learning Task would be to generalize the provided labeled cats and dogs pictures to use
the generalized function to classify the new and unclassified image of a cat / dog.
- Consider a hypothesis:
< ?, Cold, High, ?, ?, ? >
This Hypothesis means that “a new instance is said to be positive(yes) only if the (AirTemp = Cold) and
(Humidity = High). That is, it is a good day for water sports if the air temperature is “cold” and humidity
is “high”.
Comparing two hypothesis and determining the most general one among them:
(General to Specific Ordering)
1. Initial Tree Construction: The process usually starts with a root node representing the entire dataset.
The algorithm recursively splits the data based on features to create child nodes, aiming to partition the
data into subsets with more homogeneous labels.
2. Splitting Criteria: At each node, the algorithm chooses the best feature and threshold to split the data.
This decision is typically based on measures such as information gain, Gini impurity, or variance
reduction. The goal is to create child nodes that are as pure as possible, meaning they contain
instances of a single class or are close to it.
3. Recursive Search: The algorithm continues to split the data recursively, creating branches and
sub-branches, until it meets stopping criteria (e.g., maximum depth, minimum number of samples per
leaf, or no further information gain). This results in a complete decision tree or a pruned version of it.
4. Pruning: To prevent overfitting, decision trees might be pruned. This involves removing nodes or
branches that provide little predictive power, thereby simplifying the tree while retaining its
generalization ability.
Inductive bias refers to the set of assumptions a learning algorithm makes to generalize from specific training
examples to unseen data. In decision tree learning, the inductive bias is influenced by several factors:
1. Preference for Simple Trees: Decision tree algorithms often prefer simpler trees with fewer nodes or
lower depth. This bias towards simpler models helps in generalizing better and avoiding overfitting to
the training data.
2. Greedy Splitting: The greedy approach used in decision trees (e.g., choosing the best split at each
node based on criteria like information gain) is a form of inductive bias. It assumes that making locally
optimal decisions will lead to a globally good tree.
3. Axis-Parallel Decision Boundaries: Decision trees create decision boundaries that are parallel to the
axes of the feature space. This inductive bias means that decision trees might struggle with problems
where optimal decision boundaries are diagonal or more complex.
4. Categorical and Numerical Features: Decision trees handle categorical and numerical features
differently. The bias towards using categorical splits (in some algorithms) or choosing numerical
thresholds for splitting can affect how well the tree generalizes.
5. Overfitting Prevention: Techniques like pruning and setting maximum depth are applied to balance
between fitting the training data well and generalizing to new data, reflecting an inductive bias towards
models that generalize better.
[ Pruning in decision tree learning is a technique used to reduce the size of a decision tree by removing parts
of the tree that provide little predictive power. The primary goals of pruning are to enhance the model's
generalization ability, avoid overfitting, and improve computational efficiency. ]