from sklearn.datasets import load_iris
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score

# Load the iris dataset
iris = load_iris()

# Create a KNeighborsClassifier model
model = KNeighborsClassifier()

# Fit the model to the entire dataset,

# Use the model to predict on new, unseen data
y_pred = model.predict(

# Calculate the accuracy score on the test data
accuracy = accuracy_score(, y_pred)

print("Test accuracy:", accuracy)