MODULE 2 S2.1 Flashcards
kNN
Strengths / Advantages of k-NN
- Easy to understand
- Works well without any special adjustments
- Suitable as a first-time models
When considering more than one neighbor, we use _________ to assign a label.
voting
Building the model consists only of storing the training dataset.
k-Nearest Neighbors (k-NN)
We import the _____________ class for the k-NN regression variant.
KNeighborsRegressor
Weakness / Disadvantages of k-NN
- If the number of features or samples is large, the prediction is slow and data preprocessing is important.
- Does not work well with sparse datasets
In k-NN, to make a prediction for a new data point, the algorithm finds the closest data points in the training dataset—its ________________
nearest neighbors
T/F In its SIMPLEST version, the k-NN algorithm only considers exactly one nearest neighbor, which is the closest training data point to the point we want to make a prediction for.
TRUE
The Squared Score (R^2), also known as the _______________
Coefficient of Determination
It is the default distance used to choose the right measure.
Euclidean distance
It is arguably the simplest machine learning algorithm.
k-Nearest Neighbors (k-NN)
T/F In its SIMPLEST version, the k-NN algorithm can consider more than 1 nearest neighbors.
FALSE (exactly 1)
It is a measure of goodness of a prediction for a regression model, and yields a score between 0 and 1.
Squared Score (R^2)
T/F Instead of considering only the closest neighbor, we can also consider an arbitrary number, k, of neighbors.
TRUE
Parameters of the k-NN Classifier
- number of neighbors (k)
- how you measure distance between data points
T/F Predicting worse than the average can result in negative numbers
TRUE