avatarAhmed Hashesh

Summary

This article discusses the benefits and considerations of learning machine learning using C++, and provides resources for further learning.

Abstract

The article begins by acknowledging the lack of online resources for learning machine learning using C++, as most tutorials focus on Python, R, or Matlab. The author then provides a series of articles that address the implementation of machine learning algorithms in C++. The article also discusses the reasons why most people recommend using Python for machine learning, such as its flexibility and ease of use, but also highlights the benefits of using C++, such as its efficiency and control over resources. The article concludes by recommending the use of C++ for machine learning when speed and memory usage are critical, and the use of Python when speed is not critical and library functions make the task simple.

Bullet points

  • The article is part of a series that addresses the implementation of machine learning algorithms in C++.
  • The author acknowledges the lack of online resources for learning machine learning using C++.
  • The article discusses the reasons why most people recommend using Python for machine learning.
  • The article highlights the benefits of using C++ for machine learning, such as its efficiency and control over resources.
  • The article recommends the use of C++ for machine learning when speed and memory usage are critical, and the use of Python when speed is not critical and library functions make the task simple.
  • The article provides resources for further learning, such as books and articles.

C++/TIPS

When Should You Learn Machine Learning using C++?

A guide for the Scientist, Developer, and User of Machine Learning.

A while ago, I decided to start implementing Machine learning using C++ to enhance my skills in both Machine learning and C++. I searched for a good online tutorial to guide me through the implementation, but the fact is there are not so many tutorials that can help you learn these two together. In fact, I found 99% of online Machine learning tutorials using Python, R or Matlab.

Photo by Kelly Sikkema on Unsplash

This article is part of a series that address the implementation of Machine learning algorithms in C++, throughout this series, We will be implementing basic Machine learning algorithms using C++ features.

I agree that learning C++ and Machine learning is a very difficult mission, but as I said before, the target here was to learn both together.

I looked for a reason why most people recommend using python while learning ML, not C++, and here is the summary:

  • Python is a more flexible language than C++.
  • The library functions make the task trivially simple.
  • Work interactively with data by running the Python interpreter in the command line.
  • The main purpose is to learn about ML, not to practice programming.
  • Debugging C++ code for ML algorithms is very difficult.

On the other hand, reasons support learning how to Implement ML in C++ are:

  • C++ is more efficient than most other languages.
  • You can control every single resource starting from memory, CPU, and many other things.
  • Most frameworks are implemented in C++under the hood, like TensorFlow, Caffe, Vowpal, wabbit and libsvm.
  • Learning machine learning in C++ makes you a very desirable hire target.

Most of the answers were directed toward people who are new to Machine learning, on the other hand, I was searching for a more detailed answer.

People working on machine learning can be divided into three categories:

  • Scientists: they work with theoretical principles and work on advancing them.
  • Developers: work on the implementation and development of technologies for high-tech companies.
  • Users: use the technologies developed by other companies to achieve the goal of their application.
Photo by Stephen Leonardi on Unsplash

So it depends on where is your location in that pyramid and what technology you use. If you are a scientist, maybe then you don’t need to learn with C++; however, if you are a developer who works with C++ to implement Machine learning applications, it’s highly recommended that you implement these algorithms from scratch using C++.

In general, use C++ when:

  • You need the speed, and there isn’t a Python library for what you need to do, or that library is still slower.
  • You need to be able to control the memory usage because you’ll be pushing your system's limit.

Read the following article if you want to learn C++

The 8 Books Each C++ Developer Must Read.

Use Python when:

  • Speed isn’t critical, or there is a library function that is fast enough.
  • The library functions make the task trivially simple, and again, the task is not performance-critical.
  • Work interactively with data by running the Python interpreter on the command line.

Recommended Books:

References:

Hope you find this article useful. Please follow to get notified when a new article in this series is released.

Check my latest articles:

Machine Learning
Programming
Learning
Self Improvement
Recommended from ReadMedium