We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
Enrollment No: 202203103510381
PRACTICAL-4 Aim : Write a python program to perform multiclass classification on iris dataset.
Code : # Import necessary libraries
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import classification_report, accuracy_score
# Load the Iris dataset
iris = load_iris() X, y = iris.data, iris.target
UTU/CGPIT/CE/SEM-6/MACHINE INTELLIGENCE [CE5008]
Enrollment No: 202203103510381
# Split the dataset into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42, stratify=y)