nextdownload the iris dataset from its weblink as followscol_names ['pregnant''glucose''bp''skin''insulin''bmi''pedigree''age''label'pima pd read_csv( " :\pima-indians-diabetes csv"header=nonenames=col_namespima head( pregnant glucose bp skin insulin bmi pedigree age label nowsplit the dataset into features and target variable as followsfeature_cols ['pregnant''insulin''bmi''age','glucose','bp','pedigree' pima[feature_colsfeatures pima label target variable nextwe will divide the data into train and test split the following code will split the dataset into training data and of testing datax_trainx_testy_trainy_test train_test_split(xytest_size= random_state= nexttrain the model with the help of decisiontreeclassifier class of sklearn as followsclf decisiontreeclassifier(clf clf fit(x_train,y_trainat last we need to make prediction it can be done with the help of following scripty_pred clf predict(x_testnextwe can get the accuracy scoreconfusion matrix and classification report as followsfrom sklearn metrics import classification_reportconfusion_matrixaccuracy_score result confusion_matrix(y_testy_predprint("confusion matrix:"print(resultresult classification_report(y_testy_predprint("classification report:",print (result