Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
319 B
3
Indexable
Never
x = df.iloc[:,:-1].values
y = df.iloc[:,-1].values
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=42)

classifier = DecisionTreeClassifier()
baseline = classifier.fit(x_train, y_train)

prediction = baseline.predict(x_test)
prediction

accuracy_score(y_test, prediction)