• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 40 páginas
Notas de lectura

CS-7641-Machine-Learning-Notes-Midterm

Document preview thumbnail
Vista previa 4 fuera de 40 páginas

CS-7641-Machine-Learning-Notes-Midterm

Vista previa del contenido

CS7641 SL01: Decision Trees Mohamed Ameen Amer




SL00: Supervised Learning
• Supervised learning → Function approximation.
• Unsupervised learning → Function description.
• Reinforcement learning → Learning from delayed reward.
• Algorithms and data are co-equal.
In a supervised learning setting, the learning algorithm will be provided with instances and labels as
training data.
• Induction: Going from specifics to generalities.
• Classification: The classification task can be summarized as taking input 𝑥 (e.g. images of traffic
signs) and assign it to a label 𝑦 that belongs to a discrete number of labels 𝑌 (e.g. STOP, Speed Limit,
Keep Right, etc.).
• Regression: The regression task can be summarized as taking input 𝑥 (e.g. employee’s years of
experience) and mapping it to a real continuous value (e.g. expected salary).


Terminology:
• Instances: Inputs (Features).
• Concept: A set of functions that make good candidates to map inputs to outputs.
• Target concept: The actual function that can map inputs to outputs. In other words, the concept that
we’re willing to model.
• Hypothesis class: A subset of the concept set of functions that is easier to search through for the
target concept.
• Sample (Training set): A set of instances with correct labels.
• Candidate: The best approximation of the target concept.
• Testing set: A set of instances with correct labels that was not visible to the learning algorithm
during the training phase. It’s used to determine the algorithm performance on novel data.




SL01: Decision Trees:
A sequence of decision making points (nodes) applied to every instance to assign it to a specific class.
Example: Classifying vehicles into Sedans and Trucks.


Representation vs Algorithm:
• A decision tree is a structure of nodes, edges and leaves that can be used to represent the data.
1. Nodes represent attributes (vehicle length, vehicle height, number of doors, etc.).
2. Edges represent values. (A specific value for each attribute)
3. Leaves represent the output (vehicle’s type).

Page | 1

,CS7641 SL01: Decision Trees Mohamed Ameen Amer


• A decision tree algorithm is a sequence of steps that will lead you to the desired output.
1. Pick the best attribute (the one that can split the data roughly in half).
- If this attribute added no valuable information (not a good split), it might cause overfitting.
2. Ask a question about this attribute.
3. Follow the correct answer path.
4. Loop back to (1) till you narrow down the possibilities to one answer (the output).
Note that the usefulness of a question depends upon the answers we got to previous questions.


Appropriate Problems for Decision Trees:
• Instances are represented by attribute-value pairs.
• The target function has discrete output values.
• Disjunctive descriptions maybe required.
• The training data may contain errors.
• The training data may contain missing attribute values.


Expressiveness:
• Decision trees can basically express any function using the input attributes.
• For Boolean functions (AND, OR, etc.), the truth table row will be translated into a path to a leaf.
𝑛
• Decision tree hypothesis space is very huge (2(2 ) ), this why we need to design algorithms to
efficiently search the hypothesis space for the best decision tree.


ID3 Algorithm:
• ID3 builds decision trees using a top-down, greedy approach.
• Pseudocode:
1. Pick the best attribute 𝐴.
- To select this attribute, a statistical test is used to determine for each attribute how well it
alone classifies the training examples.
2. Split the data into subsets that correspond to the possible values of the best attribute.
3. Assign 𝐴 as a decision attribute for a node.
4. For each value of 𝐴, create a descendent node.
5. Sort training examples to leaves.
6. If (examples perfectly classified) {
Stop
} else {
Iterate over leaves
}




Page | 2

,CS7641 SL01: Decision Trees Mohamed Ameen Amer


• Finding the best attribute:
We can find the best attribute by calculating the information gain of each particular attribute, which
is the amount of information gained by picking this attribute.
Mathematically, the information gain expresses how well an attribute splits the data into groups
based on classification. It quantifies the reduction in randomness (Entropy) over the labels we have
with a set of data, based upon knowing the value of a particular attribute.
|𝑆𝑣 |
𝐺𝑎𝑖𝑛(𝑆, 𝐴) = 𝐸𝑛𝑡𝑟𝑜𝑝𝑦(𝑆) − ∑ 𝐸𝑛𝑡𝑟𝑜𝑝𝑦(𝑆𝑣 )
|𝑆|
𝑣
- 𝑆 is the set of training examples.
- 𝐴 is an attribute.
- 𝑣 is possible values for the attribute.
- 𝐸𝑛𝑡𝑟𝑜𝑝𝑦(𝑆) quantifies the impurity in 𝑆:
𝐸𝑛𝑡𝑟𝑜𝑝𝑦(𝑆) = − ∑ 𝑃𝑟 (𝑣) log 𝑃𝑟 (𝑣)
𝑣
The Entropy can be as large as log 𝑣
- 𝑃𝑟 (𝑣) is the probability of seeing the value 𝑣.
So ID3 is an algorithm of maximizing over the information gain (minimizing Entropy).
• ID3 hypothesis space:
- Hypothesis space is complete: The target function is surely in this hypothesis space.
- ID3 always maintains (outputs) a single hypothesis: As a result, it cannot determine how many
alternative decision trees are consistent with the training data.
- No backtracking: Once ID3 selects an attribute to test at a particular level in the tree, it never
backtracks to reconsider this choice. This puts ID3 under the risk of converging to a local minima
(A solution that is not globally optimum).
- ID3 considers all the training data at each step (when calculating the Information Gain), this
makes it robust to individual noisy examples.
• ID3 Bias:
We have two kind of biases:
1. Restriction Bias: Describes the hypothesis set space 𝐻 that we will consider for learning.
- Complete hypothesis space (low Restriction Bias).
2. Preference Bias: Describes the subset of hypothesis 𝑛, from the hypothesis set space 𝐻 (𝑛 ∈ 𝐻),
that we prefer.
→ Good splits near the top of the tree (attributes with the highest Information Gain are closer
to the root).
→ Trees that gives the correct answers.
→ Prefers shorter trees vs. longer trees, which is a natural result of preferring good splits near
the top.




Page | 3

, CS7641 SL01: Decision Trees Mohamed Ameen Amer


• We say that ID3 uses a greedy approach because it will decide which attribute should be at the root
of the tree by looking just one move ahead. It compares all available attributes to find which one
classifies the data the best, but it doesn’t look ahead (or behind) at other attributes to see which
combinations of them classify the data the best. This means that while the algorithm will, in most
cases, come up with a good decision tree, a better one may exist.
• ID3 algorithm returns an optimal decision tree, but as the size of the training data and the number
of attributes increase, it becomes more likely that running ID3 on it will return a suboptimal decision
tree.


Other considerations:
• What if we have continuous attributes?
- Information gain for a continuous attribute would be the full entropy of 𝑆. This is because there
is only one observation per attribute value. For each value of the attribute, the training data
agrees unanimously on a classification and the entropy for each attribute value is 0.
- To solve this issue, we split the attribute range into equal intervals.
- A modified ID3 can be used to find the best split.
• Does it make sense to repeat an attribute along a path in the tree?
- No if this attribute has a finite value.
- Continuous attributes can be tested with different questions.
• When do we stop?
- When everything is classified correctly.
- No more attributes.
- When you have noise, don’t overfit:
→ Not too big tree.
→ We can use cross-validation to prevent overfitting.
→ Use a validation set and stop when the error is low enough.
→ Build the whole tree, the prune it. Pruning means removing sections of the tree that provide
little power in classifying instances.
• What if it’s a regression problem?
- Information Gain won’t be efficient because it’s not clear how to measure information over
continuous values.
- We can measure variance, which is the deviation of a variable from its mean value.
- We need to decide what to report on the leaves (output). Average might be an option.




Page | 4

Información del documento

Subido en
9 de noviembre de 2026
Número de páginas
40
Escrito en
2026/2027
Tipo
Notas de lectura
Profesor(es)
Cs-7641-machine-learning-notes-midterm
Contiene
Todas las clases
$36.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
ScholarDocsUS
4.4
(311)
Vendido
283
Seguidores
1
Artículos
1279
Última venta
3 semanas hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes