<jupyter_start><jupyter_text>Importing Libraries<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns<jupyter_output><empty_output><jupyter_text>Reading the Dataset :-<jupyter_code>dataset=pd.read_csv(r"C:\gctc\Admission_Predict.csv")
dataset.head()<jupyter_output><empty_output><jupyter_text>Checking whether any null values are present in the dataset<jupyter_code>dataset.isnull().any()
dataset.drop('Serial No.',axis=1,inplace=True)    #removing serial column
dataset.head()
dataset.describe()  #to view some static details
dataset.info()  #concise summary of dataset
x=dataset.iloc[:,0:7].values   #select perticular cell of dataset
y=dataset.iloc[:,7:].values
x
y
x.shape  #
y.shape<jupyter_output><empty_output><jupyter_text>Data Vizualization<jupyter_code>sns.pairplot(dataset)   #seaborn data vizualization
corr_matrix=dataset.corr()
plt.figure(figsize=(12,12))
sns.heatmap(corr_matrix,annot = True)
plt.show()<jupyter_output><empty_output><jupyter_text>spliting data into train and test<jupyter_code>dataset.columns
x= dataset.drop(columns=['Chance of Admit '])
y=dataset['Chance of Admit ']
x.shape
y.shape
x=np.array(x)
y=np.array(y)
y=y.reshape(-1,1)
y.shape
from sklearn.preprocessing import StandardScaler
x_ss=StandardScaler()
X=x_ss.fit_transform(x)
y_ss=StandardScaler()
y=y_ss.fit_transform(y)
from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2,random_state=10)
y_train=(y_train>0.5)
y_test=(y_test>0.5)
from sklearn.linear_model.logistic import LogisticRegression
cls=LogisticRegression(random_state=0)
lr=cls.fit(X_train,y_train)
ypred=lr.predict(X_test)
ypred<jupyter_output><empty_output><jupyter_text>Model Evaluation<jupyter_code>from sklearn.metrics import accuracy_score,recall_score,roc_auc_score,confusion_matrix
print("\nAccuracy score : %f" %(accuracy_score(y_test,ypred)*100))
print("Recall score : %f" %(recall_score(y_test,ypred)*100))
print("ROC score : %f\n" %(roc_auc_score(y_test,ypred)*100))
print(confusion_matrix(y_test,ypred))<jupyter_output>Accuracy score : 87.500000
Recall score : 92.000000
ROC score : 88.727273

[[47  8]
 [ 2 23]]<jupyter_text>Saving the Model<jupyter_code>import pickle
pickle.dump(lr,open('university.pkl','wb'))
model=pickle.load(open('university.pkl','rb'))
model<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1319327731092437, 'fraction_numerical': 0.024369747899159664, 'mean_word_length': 9.725225225225225, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '473654', 'license': 'Apache-2.0', 'n_tokens_mistral': 969, 'n_tokens_neox': 924, 'n_words': 143, 'path': 'University Admit Eligibility Predictor (ECE-- 006).ipynb', 'repo_name': 'smartinternz02/SI-GuidedProject-2230-1622040755', 'size': '2380'}