directory prior probability and posterior probability what is the three basic elements of naive Bayesian model construction of KD tree kd tree nearest neighbor search kd Tree k nearest Neighbor Search Python code (Sklearn Library)
prior probability and posteriori probability |
what K-nearest neighbor algorithm (k-nearest neighbor,knn) |
Cited examples
There is a training set that contains 100 instances, the properties are skin color (black, white, yellow), marker is region (Asian, African, North American). In the training set there were 30 Africans (28 blacks), 50 Asians (1 blacks), 20 North American (5 blacks). Please train a Bayesian model.
When a negro outside the training set reports, how do we judge his region? The naïve Bayesian classifier predicts that his hometown is African, with the principle that "blacks in Africa are higher in proportion than in other states". The naïve Bayesian model will divide the instance into the class with the greatest posteriori probability.
Baidu Encyclopedia definition
The proximity algorithm, or K nearest neighbor (Knn,k-nearestneighbor) classification algorithm, is one of the simplest methods in data mining classification technology. The so-called K nearest neighbor is the meaning of K's closest neighbour, saying that each sample can be represented by its nearest K-neighbor.
The core idea of the KNN algorithm is that if the majority of the k nearest samples in a feature space belong to a category, the sample also falls into this category and has the characteristics of the sample on this category. This method determines the category to which the sample is to be divided, depending on the category of one or more adjacent samples in determining the classification decision. The KNN method is only associated with a very small number of adjacent samples when deciding on a class. The KNN method is more suitable than other methods because the KNN method mainly relies on the surrounding finite sample, rather than the Discriminant class domain method to determine the category of the class.
"Dawn Pass number ==> machine learning Express" model article 05--naive Bayesian "Naive Bayes" (with Python code)