How to fetch the details of the accuracy matrix of the model in python
I am new to python and AI models. I had created my first KNN regression model using the code snippet below. Now i need help to fetch the parameters or the values using which I can check the efficacy of the model developed. How can this be done ?
from sklearn.model_selection import train_test_split from sklearn.neighbors import KNeighborsClassifier # load data df_bridge = pd.read_csv ("bridge_data.csv") # categorize data X = df_bridge.drop("8 - Structure Number", axis=1).drop("43A - Main Span Material", axis=1) X = X.values y = df_bridge["8 - Structure Number"] y = y.values # Split into training and test set X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state=42) # Apply the Prediction KNN model knn = KNeighborsClassifier(n_neighbors=7) knn.fit(X_train, y_train)