Week 5 & 6 - Practice Exercise - ML
Week 5 & 6 - Practice Exercise - ML
The marketing team wants to identify key patterns in customer behavior to create targeted
marketing strategies, but the large number of variables makes it difficult to visualize and
interpret the data directly. They want you to reduce the dimensionality of the data while
retaining as much variance (information) as possible.
You are trying to predict the weather based on past data, where the possible weather states are
Sunny, Cloudy, and Rainy.
Predicted weather sequence for the next 4 days: ['Sunny', 'Sunny', 'Cloudy', 'Cloudy']
3. Forward and Backward Algorithms for an HMM
Predicts the probability of carrying an umbrella based on the current weather. The
weather can be Sunny, Cloudy, or Rainy, but you can only observe whether a person
is carrying an umbrella or not. The goal is to calculate the probabilities of the hidden
states (the weather) given the observations using the Forward and Backward
algorithms.
This means the probability of starting in the Sunny state is 0.5, Cloudy state is 0.3,
and Rainy state is 0.2.
Observation Sequence:
4. Viterbi algorithm
a speech recognition system that attempts to recognize a spoken sentence. The system picks up
audio signals but often makes mistakes due to noise in the input. You want to use the Viterbi
algorithm to decode the most likely original sequence of words that were spoken based on the
noisy observed sequence.
1. States (hidden): Word 1, Word 2, Word 3, ... (the actual words that might have been
spoken).
3. Observation Sequence: A sequence of phonemes that the system has recognized, such as
Phoneme 1, Phoneme 2, Phoneme 3.
Your task is to find the most likely sequence of words that corresponds to the observed sequence
of phonemes.
Given:
Probabilities:
P(Word A) = 0.4
P(Word B) = 0.4
P(Word C) = 0.2
Task:
Assume the system recognized the following sequence of phonemes: Phoneme X, Phoneme Y,
Phoneme X. Find the probability of this most likely sequence of words that produced this
observation using the Viterbi algorithm.