import pandas as pd import numpy as np import matplotlib.pyplot as plt %matplotlib inline from sklearn import tree banknot_df=pd.read_csv('data_banknote_authentication.txt', sep = ',', header = None, names = ["varyans","carpiklik", "basiklik", "entropi", "sinif" ]) banknot_df.head() banknot_df.info() X = banknot_df.drop('sinif', axis = 1) y = banknot_df['sinif'] from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.20, random_state = 60) from sklearn.tree import DecisionTreeClassifier classifier = DecisionTreeClassifier() classifier.fit(X_train, y_train) y_pred = classifier.predict(X_test) print (y_pred)