Sitemap
TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Follow publication

Generating Drug Names with a Markov Chain

6 min readFeb 14, 2021

--

How do Markov Chains Work?

A Simple Example

Figure 1.1: Markov chain trained with one occurance of “BIT” and “BAT”. The numbers near the arrows show the probability of that transition. Notice that at each state, transition probabilities sum to 1.

A More Complex Example

Figure 1.2: Markov chain trained with one occurrence of “BIT”, “BAT”, and “BIITAT”.

Generating Fantasy Names

The Data

Implementing the Markov Chains

chain['T'] = {
'A' : 1, # T -> A transition in BIITAT
'.': 3 # T -> '.' transition in BIT, BAT, BIITAT
}

Building the Chain

Random Walk

Putting It All Together…

flurimbin
kenzaidel
uvinaze
colmix
iluprarax
zelare
irevene
enxophir
trexin
hysesox

Conclusion

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Alex Kalinins
Alex Kalinins

Written by Alex Kalinins

A brain and computer enthusiast studying what I love at the University of Toronto. Connect with me on LinkedIn: https://www.linkedin.com/in/alex-kalinins/

No responses yet