accuracy knn as regressor firststart with importing necessary python packagesimport numpy as np import pandas as pd nextdownload the iris dataset from its weblink as followspath "nextwe need to assign column names to the dataset as followsheadernames ['sepal-length''sepal-width''petal-length''petal-width''class'nowwe need to read dataset to pandas dataframe as followsdata pd read_csv(urlnames=headernamesarray data values array[:,: array[:, data shape output:( nextimport kneighborsregressor from sklearn to fit the modelfrom sklearn neighbors import kneighborsregressor knnr kneighborsregressor(n_neighbors= knnr fit(xyat lastwe can find the mse as followsprint ("the mse is:",format(np power( -knnr predict( ), mean())output the mse is