Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""# **Upload and Read file**"""

from google.colab import files

files.upload()

df = pd.read_csv("Admission_Predict_Ver1.1.csv")
Expand All @@ -22,7 +23,7 @@

df.columns

df.drop('Serial No.',axis=1,inplace=True)
df.drop("Serial No.", axis=1, inplace=True)

df.head()

Expand All @@ -37,39 +38,48 @@

sns.distplot(df.CGPA)

sns.pairplot(df,x_vars=['SOP','GRE Score','TOEFL Score','CGPA'],y_vars=['Chance of Admit '],height=5, aspect=0.8, kind='reg')
sns.pairplot(
df,
x_vars=["SOP", "GRE Score", "TOEFL Score", "CGPA"],
y_vars=["Chance of Admit "],
height=5,
aspect=0.8,
kind="reg",
)


"""# **Creating Model**"""

df.columns

x=df[['GRE Score', 'TOEFL Score', 'CGPA']]
x = df[["GRE Score", "TOEFL Score", "CGPA"]]

y=df[['Chance of Admit ']]
y = df[["Chance of Admit "]]

from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
import random

x_train, x_test, y_train, y_test =train_test_split(x,y,test_size=0.20,random_state=0)
x_train, x_test, y_train, y_test = train_test_split(
x, y, test_size=0.20, random_state=0
)

x_train.shape

y_train.shape

linreg = LinearRegression()
linreg.fit(x_train,y_train)
linreg.fit(x_train, y_train)


"""# **Testing and Evaluating the Model**"""

y_pred=linreg.predict(x_test)
y_pred = linreg.predict(x_test)

y_pred[:7]

y_test.head(7)

from sklearn import metrics
print(metrics.mean_absolute_error(y_test,y_pred)) #96% prediction

print(metrics.mean_absolute_error(y_test, y_pred)) # 96% prediction