text_plain_output_2.png application_vnd.jupyter.stderr_output_1.png image_output_1.png
from sklearn.ensemble import RandomForestClassifier

from sklearn.metrics import accuracy_score, classification_report

from sklearn.model_selection import train_test_split

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

data = pd.read_csv('../input/iris/Iris.csv')

x = data.drop(['Species', 'Id'], axis=1)
y = data.Species

model = RandomForestClassifier()
x_train, x_val, y_train, y_val = train_test_split(x, y)

model.fit(x_train, y_train)

pred = model.predict(x_val)

accuracy_score(y_val, pred)