KNN implemenation for Iris dataset
download rewuired packages from requirement file using below command: pip install -r requirements.txt
Steps:
- import libraries and useful tools
- load iris dataset from sklearn and convert to a DataFrame
- Decide training and testing features
- transform species values in numbers
- divide dataset into training and testing set based on the test_size
- Scale your dataset in standand units
- for values of K from 1 to 20 find the mean square root errors and append in a list
- plot error values, from previous plot , choose the value of K such that sqaure root mean error is minimum
- fit the KNN Classifier with this valus of K and predict values
- Test your results