Assignment - 4 - Decision Tree - 014319
Assignment - 4 - Decision Tree - 014319
[7]:
[7]: Serial No. GRE Score TOEFL Score University Rating SOP LOR CGPA \
0 1 337 118 4 4.5 4.5 9.65
1 2 324 107 4 4.0 4.5 8.87
2 3 316 104 3 3.0 3.5 8.00
3 4 322 110 3 3.5 2.5 8.67
4 5 314 103 2 2.0 3.0 8.21
[8]:
[9] : dataset.columns
1
[9] : Index(['Serial No.', 'GRE Score', 'TOEFL Score', 'University Rating', 'SOP',
'LOR ', 'CGPA', 'Research', 'Chance of Admit '],
dtype='object')
[11] : X = Admit =
y= Admit
dtc = DecisionTreeClassifier()
y_pred = dtc.predict(X_test)
Confusion Matrix:
[[79 3]
[ 4 39]]
[19]:
plot_tree(dtc, feature_names=X.columns, class_names=['0', '1'], filled=True)
2
3