Classification with Neural Networks: Is it the Right Choice?
There are many effective ways to automatically classify entities. In this article, we cover 6 common classification algorithms, of which neural networks are just one choice. Which algorithm is the best choice for your classification problem, and are neural networks worth the effort? In part 1 of this article you will learn:
- What is classification in machine and deep learning?
- Types of Classification Algorithms and their strengths and weaknesses—logistic regression, random forest, KNN vs neural networks
- Running neural networks and regular machine learning classifiers in the real world
In part 2 of this article, coming soon:
- Coding up a neural network classifier
- Text classification using deep learning
- Image classification with Convolutional Neural Networks (CNN)
What Is Classification in Machine and Deep Learning?
Classification involves predicting which class an item belongs to. Some classifiers are binary, resulting in a yes/no decision. Others are multi-class, able to categorize an item into one of several categories. Classification is a very common use case of machine learning—classification algorithms are used to solve problems like email spam filtering, document categorization, speech recognition, image recognition, and handwriting recognition. In this context, a neural network is one of several machine learning algorithms that can help solve classification problems. Its unique strength is its ability to dynamically create complex prediction functions, and emulate human thinking, in a way that no other algorithm can. There are many classification problems for which neural networks have yielded the best results.
Types of Classification Algorithms: Which Is Right for Your Problem?
To understand classification with neural networks, it’s essential to learn how other classification algorithms work, and their unique strengths. For many problems, a neural network may be unsuitable or “overkill”. For others, it might be the only solution.
Decision Tree Algorithm
Random Forest Algorithm
Naive Bayes Classifier
k-Nearest Neighbor (KNN)
Artificial Neural Networks and Deep Neural Networks
Neural Networks and Regular Machine Learning Classifiers in the Real World
In real-world machine learning projects, you will find yourself iterating on the same classification problem, using different classifiers, and different parameters or structures of the same classifier. If you restrict yourself to “regular” classifiers besides neural networks, you can use great open source libraries like scikit-learn, which provide built-in implementations of all popular classifiers, and are relatively easy to get started with. Visualizations of classifiers available in the scikit-learn package (source: scikit-learn) If you go down the neural network path, you will need to use the “heavier” deep learning frameworks such as Google’s TensorFlow, Keras and PyTorch. These frameworks support both ordinary classifiers like Naive Bayes or KNN, and are able to set up neural networks of amazing complexity with only a few lines of code. While these frameworks are very powerful, each of them has operating concepts you’ll need to learn, and each has its learning curve. There are additional challenges when running any machine learning project at scale:
Tracking progress across multiple experiments and storing source code, metrics and parameters. Machine learning experiments, especially neural networks, require constant trial and error to get the model right and it’s easy to get lost as you create more and more experiments with multiple variations of each.
Running experiments across multiple machines—some classification algorithms, such as KNN and neural networks, are computationally intensive. As you scale up to real projects you’ll have to run experiments on multiple machines. Managing those machines can be difficult.
Manage training data—if you’re classifying images, video or large quantities of unstructured data, the training data itself can get big and storage and data transfer will become an issue.