Last active
December 18, 2016 14:27
-
-
Save aswinmohanme/bed667b90bb36edc9928e977522f8b63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Import the Algorythm | |
| from sklearn.neighbors import KNeighborsClassifier | |
| # Instantiate the Classifier | |
| knn = KNeighborsClassifier() | |
| # Train the Model | |
| knn.fit(X,y) | |
| # Create some test data , this corresponds with 0 species | |
| test_data = [5.0 , 3.1,1.4,0.2] | |
| # Predict using the trained Model | |
| prediction = knn.predict([test_data]) | |
| print(prediction) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment