Commit 587976fb authored by Petra's avatar Petra

how adding noisy examples changes the decision boundary of KNN

parent 06879e16
......@@ -24,9 +24,13 @@ print("Features: ", feature_cols, "\nTarget:", target_var)
print(""" --- Train-test split ---""") # 900 examples in test set, 100 examples in train set
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=900, random_state=2)
h = .001 # step size in the mesh
# adding one noisy example
#X_train = np.vstack((X_train, [0.25, 0.75]))
#y_train = np.append(y_train, y_train[0])
h = .001 # step size in the mesh
# Create color maps
cmap_light = ListedColormap(['orange', 'cyan', 'cornflowerblue'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment