Calculate probabilities for Markov Chain - Python

0 votes

I am trying to figure out the concepts behind Markov Chain.

print zip(s,s[1:])
[('D', 'E'), ('E', 'F'), ('F', 'E'), ('E', 'E'), ('E', 'F'), ('F', 'H'), ('H', 'F')]

How do I find the probability of the above data?

Aug 2, 2019 in Machine Learning by Viky
801 views

1 answer to this question.

0 votes

You have to use the tuples from the zip to index the dictionary and then multiply all the numbers.

from operator import mul
print reduce(mul, (dict_m[t] for t in zip(s, s[1:])))
answered Aug 2, 2019 by Ishaan

Related Questions In Machine Learning

0 votes
1 answer

Markov chain using processing - Python

Try something like this @Gujjar HashMap<String, int> wordCount; int ...READ MORE

answered Aug 2, 2019 in Machine Learning by Ashish
608 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,023 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Python script for linear regression on panda dataframe

Use the following code: from scipy import stats slope, ...READ MORE

answered May 23, 2019 in Machine Learning by Imran
1,698 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP