With the evolution of AI, computer science researchers are constantly suggesting new approaches (i.e. machine learning algorithms) to make computers even more autonomous and capable of performing various tasks with precision. Traditionally, programmers have always developed systems by clearly specifying each step in code. In that case, software engineers needed to know the problems they were trying to solve and have a good idea of all the variables and possibilities involved. Machine Learning (ML) is a subfield of artificial intelligence that aims to solve more complex problems, of which programmers still do not have such a wide knowledge. Learn what is machine learning from my previous article.
There are lots of algorithms used in machine learning, each with a specific purpose. Therefore, the algorithm you choose depends on the problem you want to solve. This table contains the most commonly used Machine Learning algorithms and their use cases. You can use this table as a cheatsheet to find the ideal machine learning algorithm for your specific problem.
Machine Learning Algorithm Cheatsheet
Following is a quick reference table of machine learning algorithms.
| Algorithm Name | Type | Description | Practical Use Cases |
|---|---|---|---|
| Linear Regression | Supervised | Models the relationship between a dependent variable and one or more independent variables. | Predicting house prices, stock prices, sales forecasts |
| Logistic Regression | Supervised | Used for classification tasks, predicting the probability of a binary outcome. | Email spam detection, medical diagnosis, credit scoring |
| Decision Tree | Supervised | Creates a tree-like model of decisions and their possible consequences. | Customer segmentation, fraud detection, medical diagnosis |
| Random Forest | Supervised | Ensemble method that combines multiple decision trees to improve accuracy. | Customer churn prediction, loan approval, recommendation systems |
| Support Vector Machine (SVM) | Supervised | Finds the optimal hyperplane to separate data points into different classes. | Image classification, text classification, bioinformatics |
| Naive Bayes | Supervised | Based on Bayes’ theorem, assumes independence between features. | Spam filtering, text classification, sentiment analysis |
| K-Nearest Neighbors (KNN) | Supervised/Unsupervised | Classifies data points based on the majority class of their nearest neighbors. | Recommendation systems, anomaly detection, image recognition |
| Polynomial Regression | Supervised | Used for fitting non-linear relationships between independent and dependent variables. | Modeling growth curves, predicting sales figures |
| Ridge Regression | Supervised | L2 Regularized linear regression model that reduces the variance of the model. | Used when we have a high number of features and want to avoid overfitting |
| Lasso Regression | Supervised | L1 Regularized linear regression model that performs both variable selection and regularization. | Used when we have a high number of features and want to select a sparse set of features |
| K-Means Clustering | Unsupervised | Groups data points into clusters based on similarity. | Customer segmentation, image compression, document clustering |
| Hierarchical Clustering | Unsupervised | Creates a hierarchy of clusters, starting from individual data points. | Biological taxonomy, social network analysis, market research |
| Principal Component Analysis (PCA) | Unsupervised | Reduces the dimensionality of data while preserving most of the information. | Data visualization, feature extraction, noise reduction |
| Independent Component Analysis (ICA) | Unsupervised | Extracts independent underlying components from mixed signals. | Used for signal separation, medical imaging, and finance |
| Apriori Algorithm | Unsupervised | Discovers frequent itemsets and association rules. | Market basket analysis, recommendation systems |
| Eclat | Unsupervised | Efficient algorithm for mining frequent itemsets. | Market basket analysis, recommendation systems |
| FP-growth Algorithm | Unsupervised | Efficient algorithm for mining frequent itemsets and association rules. | Market basket analysis, recommendation systems |
| Label Propagation | Semi-Supervised | Propagates labels from labeled to unlabeled data points. | Image classification, text classification |
| Graph-based semi-supervised learning | Semi-Supervised | Uses graph-based methods to propagate labels from labeled to unlabeled data points. | Image classification, text classification |
| Co-training | Semi-Supervised | Trains two models on different views of the data and iteratively labels unlabeled data. | Text classification, document classification |
| Self-training | Semi-Supervised | Trains a model on labeled data and uses it to label unlabeled data, which is then added to the training set. | Text classification, sentiment analysis |
| Generative adversarial networks (GANs) | Semi-Supervised | Generates synthetic data to augment the training set. | Image generation, data augmentation |
| Q-Learning | Reinforcement Learning | Learns an optimal action-value function. | Game playing, robotics |
| SARSA | Reinforcement Learning | Learns an optimal policy. | Game playing, robotics |
| Deep Q-Networks (DQN) | Reinforcement Learning | Combines deep learning with Q-learning. | Game playing, robotics |
| Policy Gradient Methods | Reinforcement Learning | Optimize a policy function to maximize rewards. | Robotics, autonomous vehicles |
How to choose the ideal Machine Learning algorithm?
As there are several ways to reach a result with ML, and because there are several approaches, it is necessary to know how to choose the most appropriate algorithm for the proposed problem. We’ll look at some tips below.
1. Purpose of the problem
It is important to know well the purpose and context of the case that must be processed by the machine or computer, with specific details. If you know the purpose of the problem, you can use that knowledge to select the best way to handle the data. For example, if there is a well-defined goal, with known outputs, the ideal algorithm could be a supervised learning method.
2. Amount of data
Another relevant aspect is the amount of data that will be used to feed the ML model. Neural networks, for example, usually need large sets of data. In addition, if the dataset is very large and the algorithm is too complex, you may have to make an assessment regarding the computational capacity necessary for the execution of the algorithm.
3. Problem complexity and accuracy
The complexity of the problem is also an important aspect, as this determines the degree of accuracy desired. Thus, it is possible to select which algorithm best fits this degree of accuracy by analyzing factors such as what are the consequences that can bring if the model output an incorrect prediction.
4. Time
Last but not least, time must be considered when choosing the type of Machine Learning algorithm that best solves the case. You may observe, depending on the complexity of the problem, the time consumed to train a model may defer. Also, some models may take some time to generate an output. This will be problematic if you are dealing with a problem that requires fast output and real time predictions. So, either it is for training or inference, time plays an important role.
Summary
In this article, we discussed how what are commonly used ML algorithms and how to chose an algorithm based on your problem. Also, I included a small cheatsheet for you to refer, so that you can determine which algorithm to use for your specific problem.

