Created
May 3, 2026 13:22
-
-
Save jaiswalakshay508-maker/6b4dba4435518a57dabb71fb831764a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import seaborn as sns | |
| import matplotlib.pyplot as plt | |
| from sklearn.model_selection import train_test_split | |
| from sklearn.linear_model import LinearRegression | |
| from sklearn.metrics import mean_absolute_error | |
| df=pd.read_csv(r"C:\Users\hp\PycharmProjects\PythonProject5\Admission.csv") | |
| print(df) | |
| sns.heatmap(data=df.corr(),annot=True) | |
| plt.show() | |
| #df=df.drop(["Research"],axis=1) | |
| X=df.drop(["Admission Chance"],axis=1) | |
| y=df["Admission Chance"] | |
| X_train, X_test, y_train, y_test = train_test_split(X,y,test_size=0.2,random_state=1) | |
| model=LinearRegression() | |
| model.fit(X_train,y_train) | |
| y_predict=model.predict(X_test) | |
| err=mean_absolute_error(y_test,y_predict) | |
| print(err) | |
| print(model.predict([[340,120,5,4,4,9.7,1]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment