Question 11
The following code snippet shows the use of two models built on the data and label :
import numpy as npfrom sklearn.preprocessing import MinMaxScalerfrom sklearn.neighbors import KNeighborsClassifierfrom sklearn.pipeline import Pipeline
X = np.array([[0, 0], [0.25, 0.25], [0.5, 0.5], [0.75, 0.75], [1, 1]])y = np.array([0, 0, 1, 1, 0])
model_1 = Pipeline([ ('knn', KNeighborsClassifier(n_neighbors=3))])
model_2 = Pipeline([ ('scaler', MinMaxScaler()), ('knn', KNeighborsClassifier(n_neighbors=3))])
model_1.fit(X, y)model_2.fit(X, y)For the given data, which of the following options is correct?