Omelet science with robots

Training your ML model

Machines are great.

You tell it what to do and it’ll do it.

But it won’t do what you want it to.

You have to teach it.

Say you’re the best chef in town.

Your restaurant is PACKED with customers.

But you can’t fulfill the demand for omelets.

To combat this, you buy a robot and you want it to make omelets the way you would.

Just 1 problem…

Does the robot know what it’s doing?

It’s never cooked a day in its “life”.

So how do you train it?

The fit() method.

A crucial element of scikit-learn.

Imagine your robot as a machine learning model on a dataset.

Fit() allows your robot to learn relationships and patterns within the data.

The Recipe (choose a technique)

What recipe do you use?

There are countless recipes out there.

Think of the one recipe you choose to be a machine learning technique.

All the other recipes are just other ML techniques, for different types of omelets which are your problems.

Ingredients (data)

You’ve chosen your recipe.

Let’s say it calls for eggs and cheese.

In this case, the eggs and cheese are your dataset.

It has all the information your model will learn from, such as numerical variables.

Cooking Robot (model instance)

The robot needs to know how to cook the omelet.

Your robot is a blank canvas, which doesn’t know how to cook your recipe.

Once you give the robot your desired recipe, you now have to teach it!

Teaching The Robot (with fit())

Consider teaching the robot the same way you’d teach a new chef.

You would take the ingredients (data) and show the robot/chef how to prepare it, how to mix the eggs, how to fold it, etc.

This is how the fit() method works.

Your robot (model) learns from the ingredients you cook with (data) and uses it to make omelets.

Learning Stage

Your robot (model) will watch you cook and learn from your ingredients and your movements.

But it isn’t perfect.

It’ll make mistakes like a human,

And it gets better over time like a human.

Your robot (model) improves as it learns from your patterns and rules.

Cooking Omelets (predictions)

When your robot has learned how to cook, it’s now ready for the restaurant!

But suddenly, all of your customers want an omelet you’ve never cooked before.

And you’re on the phone all week, meaning you can’t cook.

Are you going to lose a bunch of customers?

No.

Your robot isn’t oblivious.

It knows how to cook an omelet.

Give it a new set of ingredients (new data) and it will make an omelet based on what it learned from your training.

The best part?

You never have to cook an omelet in your restaurant again.

Tweet of the week

Join the conversation

or to participate.