alexhwoods 的博客 scikit-learn
Random Forest in scikit-learn
Random Forest is used for classification, regression, and feature selection. It is an ensemble technique, meaning it combines the output of one weaker technique in order to get a stronger result.
k-Nearest Neighbors in scikit-learn
The k-Nearest Neighbor (KNN) algorithm can be used for classification or regression. It’s one of the simpler machine learning algorithms, but it’s usually pretty effective.
It is non-parametric, meaning it doesn’t have a fixed number of parameters.
When you train KNN, it finds the k “nearest” points to a given point, and returns the class with the highest proportion. If K = 1, then you only look for the closest point and return it’s class. This is not ideal. The optimal K value for KNN is usually between 3-10.