With Use Cases and Real-World Examples
Artificial intelligence is everywhere. Everyone has seen Generative AI tools, whether it is ChatGPT, your best friend on Snapchat, or even when coding or debugging with GitHub CoPilot. Despite the surge in the use of ChatGPT for application development, the question still remains, how can you transform your application to become intelligent?
AI generated image created with Bing's Image Creator
Machine learning is a powerful tool of artificial intelligence that can enhance your application through user experience, data accuracy, and more! However, if you look further, there are many techniques that tailor best to specific use cases. Choosing the right machine learning technique influences the accuracy or quality of your results, so read on to find the right one through a detailed lens. ⬇️
Branches of Machine Learning
To categorize the different techniques, machine learning can be broadly categorized into three branches:
- The first branch is supervised learning. Supervised learning is where we give an input, and the model predicts the correct output. We take data, label each data correctly, train, and test our model to close the gap in accuracy rate.
- The second branch is unsupervised learning. This is where there are no inputs or labels. It must discover a pattern or structure of data to cluster the data points. There is no former knowledge of classification in unsupervised learning.
- Lastly, there is reinforcement learning. This branch is where the AI agent interacts with the environment and continuously learns and makes decisions via training algorithms.
Given this preview, find your use case below and choose the following technique that fits best!
Want to predict the future with numbers? For example, if you want to forecast real estate prices, stock price fluctuations, and sales, you would use Linear Regression and Random Forest techniques.
Linear Regression is a supervised learning model. When one thinks of linear, they think of a line. It is exactly that. It models the best-fit line to predict future data. The more data there is, the more accurate your prediction will be. Walmart uses linear regression to forecast sales and optimize inventory. Zillow uses it to estimate property values based on location, size, and recent sales data. The Weather app uses it to predict temperature, humidity, or precipitation levels. Robinhood uses linear regression to predict stock prices and analyze financial trends.
Random Forest is a supervised learning model that is primarily used for complex data or where high accuracy is needed. It uses decision trees on random samples of prior data and classifies them. Uber uses a random forest model for demand forecasting. Airbnb uses the model for price prediction. That being said, there are many more techniques/models out there like Time Series Models (designed specifically for time-dependent data) and specific Neural Networks, for example.
Detecting Data (Groups & Outliers)
Want to detect cancer, fraud, spam, etc.? You would want to use Logistic Regression, Support Vector Machines (SVM), Random Forest, and K-Means Clustering.
Logistic Regression is similar to Linear Regression, but it uses categorical data or data that can not be quantified. It predicts the possibility of something belonging to a category. Compared to linear regression, it uses a logarithmic or “S” curve. Netflix uses logistic regression to classify the genre of media, for example. Google Maps uses it to predict when and where parking locations are and the difficulty of securing a spot. Gmail uses it to classify if a mail is spam based on the content or history of sender and receiver interactions.
Support Vector Machines (SVM) is a supervised learning model that provides high accuracy. The model involves classifying certain data points based on their location on a hyperplane. Amazon uses SVM to segment its customers into specific groups. X (formerly Twitter) uses SVMs for content moderation.
K-Means Clustering is an unsupervised learning technique. It is one of the most popular clustering models. K represents the number of clusters that are made from surrounding data points. In healthcare devices, K-means clustering is used for drug discovery and disease classification. Cybersecurity firms like Palo Alto Networks and Symantec use K-means or other clustering techniques to identify unusual patterns in network traffic or cyber threats. Other cybersecurity firms like McAfee and Cisco use Random Forest instead.
Recommend a Friend
Want to give recommendations that could help someone when shopping, financial decisions, food, etc? Use Neural Networks and Collaborative Filtering models.
Neural Networks is a supervised learning model that is widely used. There are subsets of neural networks that are tailored for specific use cases. The model learns complex patterns from data, which essentially makes the recommendations. It is inspired by the makeup of adaptive human behavior by creating nodes that link to each other and hidden layers to process the information. Because of the amount of processing, the model outputs high accuracy! Spotify is known for its recommendations. For example, the Discover Weekly playlist is filled with handpicked songs based on your past week’s activity. TikTok, the infamous and addictive social media platform, uses deep neural networks to curate the most personal feed that updates frequently from your engagement history. And, the list goes on and on.
Collaborative Filtering is considered an unsupervised learning technique. The technique identifies patterns and similarities between user-item interactions and filters items out. Youtube uses collaborative filtering to suggest videos to users based on viewing history. Twitch suggests streams and channels via collaborative filtering.
Classify and Recognize
Want to know how face, speech, and handwriting recognition work? SVM, Neural Networks, Random Forest, and Principal Component Analysis (PCA) are what you are looking for.
SVM is great for image classification, as well as Random Forest, and text recognition. Neural networks are well-suited for image, speech, text, and handwriting recognition. It is widely believed that Apple used neural networks for Face ID which is integrated in many other applications like accessing bank/credit information. Principal Component Analysis (PCA) is an unsupervised learning technique that removes irrelevant information. This is helpful for facial recognition! It also is used for image compression.
Create an Assistant
Want to create something that can make life easier? Create a personal therapist, search engine, game opponent, or chauffeur using the Q-Learning algorithm. Q-Learning is a reinforcement learning technique that is model-free. Tesla uses it for autonomous driving. Google DeepMind uses it for video game development such as AlphaGo AI. Your go-to help desk and breakthrough product, ChatGPT, also follows this model.
Conclusion and Resources
Here, we have outlined some machine learning models but not all. There are many out there, but they are also similar in functionality to the ones listed here. In fact, some listed companies may use hybrid models, using more than one technique to achieve the same goal.
Before jumping straight into implementing the selected machine learning model, it is important to ensure the quality of the data you will use (unbiased and generalizable). The training and testing data are what shape your model and make it intelligent since it predicts the future accurately. If it is biased or insufficient, the success of the model is poor and will worsen your application. Prioritize collecting quality data before deploying the model to your application.
If you check out the resources for implementing the models below, most, if not all, use Python and other libraries. It is best to be familiar with Python beforehand. I would also recommend looking into TensorFlow, PyTorch, OpenCV, and other platforms/libraries to visualize the data based on your model/algorithm. Hopefully, with a breakdown of which options are available for general use cases, you can make your application intelligent. Produce the next groundbreaking innovation using the latest technology to make a lasting impact.
Support Vector Machines (SVM):
- Support Vector Machine
- Guide on Support Vector Machines
- Support Vector Machine Algorithm
- SVM Implementation in Python from Scratch
- An Introduction to Neural Networks with Implementation from Scratch using Python
- Implementing Artificial Neural Networks in Python from Scratch
- How to Implement a (Simple) Neural Network with TensorFlow2
- Convolutional Neural Networks
- Various Implementations of Collaborative Filtering
- Item-based collaborative filtering in Python|Collaborative filtering in Python
Principal Component Analysis (PCA):
- Step-By-Step Implementation of PCA
- Implementing PCA in Python with scikit-learn
- Implementing PCA Step-By-Step
- Q-Learning: Complete Example in Python
- Detailed Explanation and Python Implementation of Q-Learning Algorithm
- Q-Learning Algorithm from Explanation to Implementation
Ria Patel is an Agile Software Engineer at TribalScale with a passion for crafting technical solutions with a driven and supportive team, learning the latest technology. After work, you can find her cooking, working out, or binging a show with her friends.