Dive into machine learning with Python and Google Colab

Anirudh S
3 min readJul 24, 2019

Getting started

Many programmers who want to get into machine learning (ML) start their journey by getting into the math behind that later intimidates them. They try to make it through by first learning math in order to learn deep learning (which isn’t the only way). This scares away many forcing them to give up early.

I still remember the first day of our college machine learning guest lecture filled with hundreds of people. Most of them attended just because of the catchy title “Artificial Intelligence”. But a week later, the room was almost empty. Many left when they came to know that machine learning has a lot of math. Starting from bottom-up doesn’t have to be your way into machine learning. In this series, we’ll see how a top-down, coding-first approach helps us to overcome the intimidation of mathematics.

Where to start?

Photo by Emily Morter on Unsplash

Well, for starters, learning Python would be the easiest way to start playing with ML algorithms. It’s okay if you don’t know Python. One can learn the basic constructs of python language in under a month or even earlier too! It is intuitive, easy to code and it’s widely adopted by the machine learning community. It has got a huge number of libraries that aid in pretty much everything. If you already know C, C++ or Java, you can catch up with Python easily.

It has excellent documentation and a huge community to help you out in StackOverflow. And once you get familiar with the language, you can check out machine learning and other libraries that would come handy to train your own AI model. Scikit-learn is one of the most popular libraries for ML and it comes with out-of-the-box algorithms and is incredibly intuitive. We’ll glance more at the algorithms to start with ML.

Machine learning with Colab

Once people jump into ML, the question that usually pops up is “Do I have a laptop/PC that’s powerful enough for ML?”. Running some complex algorithms needs more compute resources but you don’t have to go laptop shopping when you’re just starting out. But, if you have bought your PC recently with decent specs (8 GB RAM, i5 or higher version processor with an optional dedicated VRAM), it should do.

Even if you don’t, worry not. Google’s Colab provides virtual instances of Jupyter notebook that can run in your browser with a GPU and 12 GB of RAM! For free! And that’s more than enough to get started. It provides sessions that you can run for 12 hours straight. All you need is to sign up with your Google account.

After you log into colab, a pop up will ask you to select the version of Python. You’ll get a CPU session of Jupyter Notebook by default. But if you want to use a hardware accelerator like a GPU or TPU (Tensor Processing Unit), click “Run time” tab and select “change run time” and select your desired hardware accelerator.

And that’s all for now!

There you go! You’ve taken your first step into machine learning. We’ll see more about how to implement our very first machine learning model and get rolling. Until then, explore more over here. Happy hacking!

Originally published at https://hackerstreak.com on July 24, 2019.

--

--