Untitled
unknown
python
3 years ago
319 B
5
Indexable
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)
Editor is loading...