Supervised Learning - Classification Week 8 Challenge
# Question 1
Applying KNN to surface defects in stainless steel plates "dataset
KNN: K-Nearest Neighbors is a supervised machine learning algorithm that classifies a data point based on how its neighbors are classified. It classifies new cases based on feature similarity measures.
KNN algorithm
K in the KNN algorithm is a parameter that refers to the number of nearest neighbors to include in the majority voting process. It is important to choose the right value of k in order to attain high model accuracy and this is achieved by parameter tuning.
KNN is used for data that is that labeled, small in size, and noise-free.
KNN algorithms calculates the distance between two points using the Euclidean formula.

It'll calculate the distance between the unknown data point and all the points in the dataset, and based on the distance value, it'll classify the datapoint.

# Question 2
Pros:
It is a simple machine learning algorithm and easy to understand.
KNN can be used for classification and regression.
It can be used for multi-class problem.
It Provides a variety of distance criteria to choose from: Eucildean Distance Hamming Distance Manhattan Distance Minkowski Distance.
Cons:
It is different to choose the optimal number of neighbors to be consider while classifying the new data entry.
K-NN inherently has no capability of dealing with missing value problem.
K Nearest Neighbor has calculate the proximity between each neightbors for every single value in the dataset. For large datasets its computation cost increases.
Aim: The aim of this challenge is to apply KNN to the surface defects in stainless steel plates dataset and evaluate it.
Surface defects in stainless steel plates dataset:
There are 34 fields. The first 27 fields describe some kind of steel plate faults seen.
X_Maximum
X_Maximum
Y_Minimum
Y_Maximum
Pixels_Areas
X_Perimeter
Y_Perimeter
Sum of Luminosity
Minimum of Luminosity
Maximum of Luminosity
Length of conveyer
Type of steel_A300
Type of steel_A400
Steel plates Thickness
Edges_Index
Empty_Index
Square_Index
Outside X Index
Log X Index
Log Y Index
Orientation_Index
Luminosity_Index
Sigmoid of Areas
The last seven columns are one hot encoded classes, i.e., if the plate fault is classified as stains there will be a 1 in that column and 0's in the other columns. If you are unfamiliar with one- hot encoding, justs know that the seven columns are your class labels.
Pastry
Z_Scratch
K_Scratch
stains
Dirtiness
Bumps
Other_faults