A Guide for Biologists on Quickly Mastering Machine Learning and AI Concepts - (i)
These days, many biologists are trying to learn machine learning and artificial intelligence. That is not surprising. Recent research papers in genomics, molecular biology, drug discovery, ecology, or bioinformatics are increasingly using terms and concepts from those fields. Here is a short roadmap on how to start, and moreover, how to proceed rapidly through the maze.
As a biologist, you have a huge advantage over computer scientists, engineers, physicists and mathematicians. You have seen the terms like clustering, classification, regression, PCA, tSNE for a long time and even have an intuitive feel for them. This is because biologists needed these kinds of statistical algorithms to make sense of complex, noisy and high-dimensional data. In contrast, most computer science and engineering curricula traditionally placed greater emphasis on deterministic algorithms, data structures, and computational problem-solving.
Let me also mention two disadvantages although they are easy to overcome with this guide. First, as a biologist, you have probably encountered machine-learning concepts integrated into various tools. Now, you need to learn these concepts more formally. Second, as a biologist, you rarely learned the mathematics behind the algorithms. I am not asking you to derive calculus equations, but it is important to have a conceptual understanding of what is going on especially to appreciate finer distinction between different algorithms. Fortunately, many excellent YouTube videos can help with this, and I will list them in the relevant sections.
Prerequisites - Start with basic Python, NumPy, Pandas and Matplotlib
Before jumping into machine learning, you should be reasonably comfortable working with data in Python.
You do not need to be an expert programmer.
You should be able to:
- write basic Python code
- work with functions and loops
- read and manipulate files
- use NumPy for processing vectors
- use Pandas for tables and data manipulation
- make basic plots using Matplotlib
- understand arrays, matrices, rows, and columns
These skills will pay off far beyond machine learning.
Once you have these foundations, you can start learning machine learning through this three-step approach.
Step 1 — Learn to run exactly four algorithms
Pick one algorithm each on classification, regression, clustering and dimensionality reduction and try to learn the code using the Python library scikit-learn (guide.
In fact, I will be more specific and suggest these four algorithms - nearest-neighbor classification, linear least-square regression, K-means Clustering and PCA for dimensionality reduction.
Here is how you can learn their scikit-learn implementation quickly. Google collab allows you to run Python programs. So, open a new collab document, and copy/paste code from the four Scikit-learn sections (I linked them above) to see how they run. This should not take more than one hour.
Step 2 — Learn the concepts behind the algorithms
Once you made your code to work, you can broaden your understanding in two ways. First, check these youtube videos to learn the concepts -
(i) K-means Clustering
(ii) Nearest-neighbor Classification
(iii) Linear Regression
(iv) PCA
Second, see whether you can run the algorithms on any of your own datasets. Maybe you have a gene expression data sitting in your folder, and you can use clustering. Remember, the main objectives here is to be familiar with scikit-learn ways of doing things and also have an intuitive understanding on what went on inside to give you the results.
Final task of this step is to understand what the following terms mean -
- supervised learning
- unsupervised learning
- semi-supervised learning
You can check only about the definitions. Connect them to the four algorithms you just learned.
Step 3 — Add more algorithms to your toolbox
Now is the time to get familiar with other scikit-learn algorithms in various categories. Scikit-learn website has detailed codes, and you can follow step 1 and 2 on as many of them as you like. Of course, step 2 is the rate-limiting step, because you need to understand the concept of what you did with one algorithm before moving on to the next.
In the next tutorial, I will cover artificial intelligence algorithms and a new Python library - Pytorch. Then we will revisit scikit-learn for model selection, grid search and preprocessing.