sepallength sepalwidth petallength petal-width class iris-setosa iris-setosa iris-setosa iris-setosa iris-setosa data preprocessing will be done with the help of following script linesx dataset iloc[::- values dataset iloc[: values nextwe will divide the data into train and test split the following code will split the dataset into training data and of testing datafrom sklearn model_selection import train_test_split x_trainx_testy_trainy_test train_test_split(xytest_size= nexttrain the model with the help of randomforestclassifier class of sklearn as followsfrom sklearn ensemble import randomforestclassifier classifier randomforestclassifier(n_estimators= classifier fit(x_trainy_trainat lastwe need to make prediction it can be done with the help of following scripty_pred classifier predict(x_testnextprint the results 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 result accuracy_score(y_test,y_predprint("accuracy:",result