ML Assignment 2
ML Assignment 2
In [7]: df = pd.read_csv("Admission_Predict.csv")
In [8]: df
In [11]: dfd
Out[11]: Dask DataFrame Structure:
Serial GRE TOEFL University Chance
SOP LOR CGPA Research
No. Score Score Rating of Admit
npartitions=1
In [12]: df.head()
In [13]: df.isnull()
In [14]: df.isnull().sum()
In [17]: df
Out[17]: GRE Score TOEFL Score University Rating SOP LOR CGPA Research Chance of Admit
In [18]: df.shape()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[18], line 1
----> 1 df.shape()
In [19]: df.shape
Out[19]: (400, 8)
In [20]: df['Chance of Admit '] = [1 if each > 0.75 else 0 for each in df['Chance of Adm
In [21]: df.head()
Out[21]: GRE Score TOEFL Score University Rating SOP LOR CGPA Research Chance of Admit
In [22]: x = df[['GRE Score', 'TOEFL Score', 'University Rating', 'SOP', 'LOR ', 'CGPA',
'Research']] #input on the x-axix
In [29]: model_dt.fit(x_train,y_train)
Out[29]: DecisionTreeRegressor(random_state=1)
In a Jupyter environment, please rerun this cell to show the HTML representation or trust
the notebook.
On GitHub, the HTML representation is unable to render, please try loading this page with
nbviewer.org.
localhost:8888/notebooks/TEIT-10(1).ipynb 4/5
8/1/24, 12:35 PM TEIT-10(1) - Jupyter Notebook
In [33]: ConfusionMatrixDisplay.from_predictions(y_test,y_pred_dt)
mtp.title('Decision Tree')
mtp.show()
print(f" Accuracy is {accuracy_score(y_test,y_pred_dt)}")
print(classification_report(y_test,y_pred_dt))
Accuracy is 0.86
precision recall f1-score support
In [ ]:
localhost:8888/notebooks/TEIT-10(1).ipynb 5/5