Answered step by step
Verified Expert Solution
Question
1 Approved Answer
mport the iris data using: [WITH PYTHON] import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd from sklearn.neighbors
mport the iris data using: [WITH PYTHON]
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd
from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import accuracy_score from sklearn.cross_validation import train_test_split from sklearn import datasets
iris = datasets.load_iris() X = pd.DataFrame(iris['data'], columns = iris['feature_names']) Y=iris['target']
Task:
Problem 4: Apply a k-Nearest Neighbors classifier (30 points) Train a three-class k-NN classifier (sklearn.neighbors.KNeighborsClassifierD on the Iris data with 9 neigh- bors. Report the numerical error rate. Visualize the separation plane in 2-dimensional PCA space. (Hint: The point on the hyperplane has similar probability estimates to two classes.)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started