File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -476,9 +476,25 @@ words in documents
476476~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
477477K-nearest Neighbor
478478~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
479+ R
480+ In machine learning, the k-nearest neighbors algorithm (kNN)
481+ is a non-parametric technique used for classification.
482+ This method is used in Natural-language processing (NLP)
483+ as text classification in many researches in past
484+ decad
479485
480486.. image :: docs/pic/KNN.png
481487
488+ .. code :: python
489+
490+ # load data
491+ from sklearn.neighbors import KNeighborsClassifier
492+ neigh = KNeighborsClassifier(n_neighbors = number_of_classes)
493+ neigh.fit(Xtrain, ytrain)
494+ new_y = neigh.predict(Xtext)
495+
496+
497+
482498~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
483499Support Vector Machine~(SVM)
484500~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments