## home machine learning project : identifying cutlery items

machine learning is becoming crucial to add to your backpack. this post attempts to show a basic application of machine learning. we need to determine whether some cutlery items are bowls or mugs or plates. this is a practical demonstration of applied theory

# machine learning is just applied maths

from start to finish, machine learning is just statistics, equations, calculations and repetitions. you just code an algorithm. tensors are just big words for matrices.

# the project

we are identifying items from my kitchen so that when presented with an unidentified cutlery, we can attempt to classify it

## characteristics of our target

we will be identifying plates, mugs and bowls. here is an overview of their common characteristics

## our collected data

here is our measurement sheet, it could have been a spreadsheet. heights in cm

we reformat it into cutlery.csv as follows :

## reformatting for calculations : plotting

let us plot our data :

now to select the entire D column we do :

outputs :

same for df[‘h’]

# viewing our data

code :

output :

## our sample

now let us say that we have this :

width D : 8 and h : 7.5

without seeing the image, having D:9 and h:14, how do we guess what type of cutlery it is?

## guess by distance

since this is but points on graph, we’ll measure the distance between D:9 and h:14 i.e. (9,14) to each point

we’ll use the simple distance formula :

distance = square_root(  ( X2-X1)^2  +  (Y2-Y1)^2 )

code :

output :

we’ll see that the distance is nearest to all mug samples i.e. from 1.5 to 4 than it is to the nearest bowl (dist:6.02) or plate (dist:15.89)

so we can say that it is a mug / cup

of course, since we are only calculating dist, we can tweak our code to do everything without graphs

## another sample

consider the following cup with D:9 and h:14

we set our target to

and our output is :

# machine learning concept applied

this is a k-nearest neighbour application which is labelled under classification aka the basic of machine learning.

learning type: supervised learning

this was a demo project normally much more data has to be collected !