Shedding light on the Classification problem

Rohith KRohith K
2 min read

Table of contents

Classification. Categorization. Clustering. Do they sound related? They all belong to a more general problem of Pattern recognition. Where there’s patterns, there’s place for Machines. And if we start to talk about machines, the looming theme of Intelligence in Machines transpires. So, Intelligent machines huh? How? Machine learning! Where? Where there’s patterns. And where are these patterns? Everywhere? (ok. maybe not in the Quantum realm - but again, that’s contentious)

Patterns are omnipresent. So, before our “intelligent” machine overlords rule over us with an iron fist, lets try and understand what it takes to achieve this ability to classify. As humans this maybe trivial to us. But to be able to grant our spaghetti code this power to classify things… oh my, idk about you, but feels miraculous to me.

Classification in general sounds vague. What are we classifying? How are we classifying? Lets inject some structure into this thought. Firstly, classification means being able to determine (or predict) whether something is one thing or another. Broadly, we could classify a piece of data either into one of 2 catgories OR one of many categories OR many categories all at once (i.e., assigning multiple labels to a single piece of data).

The formal names of these are Binary classification, Multi-class classification, and Multi-label classification. Want an example for each? (I hope you hit the gym) Predicting whether your post-workout meal is protein-adequate or not could be a Binary classification problem because we have 2 classes. Protein-adequate & Protein-deficit. Predicting whether you’re gonna smash that chest or break that back or just feelin’ cross-fit or too lazy to move a muscle could be a Multi-class classification (We don’t do leg day here. jk, I love it :P). And finally, if you want to predict the different workouts you squeeze into a gym sesh on a particular day - voila thats a Multi-label classification problem.

My arsenal is strong with Pytorch - which is a cool Machine learning framework gifted by MetaAI to the world. A typical Pytorch workflow would look something like this:

Acquire your data → Structure it into tensors → Build a model or pick a pretrained one that suits your problem (this involves: picking a loss function and optimizer → building a training a loop) → Fit the model to the data (fitting is essentially finding patterns in the data) and make a bunch of predictions → Evaluate the model → Improve it by experimentation

Once you’re through the rite of passage, you can save/deploy your model.

p.s. I’m trying to thaw the ice off my keys so I can write. More. This was a prelude/warm-up article for what’s to come next. Stay tuned!

0
Subscribe to my newsletter

Read articles from Rohith K directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Rohith K
Rohith K

Currently pursuing masters in comp sci at the UIUC. Previously worked as a software engineer in Bengaluru. Experienced with building event driven systems at scale.