GithubHelp home page GithubHelp logo

jananisoundararajan / implementation-of-logistic-regression-model-to-predict-the-placement-status-of-student Goto Github PK

View Code? Open in Web Editor NEW

This project forked from akilamohan/implementation-of-logistic-regression-model-to-predict-the-placement-status-of-student

0.0 0.0 0.0 6 KB

License: BSD 3-Clause "New" or "Revised" License

implementation-of-logistic-regression-model-to-predict-the-placement-status-of-student's Introduction

Implementation of Logistic Regression Model to Predict the Placement Status of Student

Aim:

To write a program to implement the the Logistic Regression Model to Predict the Placement Status of Student.

Equipments Required:

  1. Hardware โ€“ PCs
  2. Anaconda โ€“ Python 3.7 Installation / Jupyter notebook

Algorithm:

  1. Get the data and use label encoder to change all the values to numeric.
  2. Drop the unwanted values,Check for NULL values, Duplicate values.
  3. Classify the training data and the test data.
  4. Calculate the accuracy score, confusion matrix and classification report.

Program:

Program to implement the the Logistic Regression Model to Predict the Placement Status of Student.
Developed by: Janani.S
RegisterNumber: 212222230049
import pandas as pd
data=pd.read_csv("Placement_Data.csv")
data.head()

data1=data.copy()
data1=data1.drop(["sl_no","salary"],axis=1)
data1.head()

data1.isnull().sum()
data1.duplicated().sum()

from sklearn.preprocessing import LabelEncoder
le=LabelEncoder()
data1["gender"]=le.fit_transform(data1["gender"])
data1["ssc_b"]=le.fit_transform(data1["ssc_b"])
data1["hsc_b"]=le.fit_transform(data1["hsc_b"])
data1["hsc_s"]=le.fit_transform(data1["hsc_s"])
data1["degree_t"]=le.fit_transform(data1["degree_t"])
data1["workex"]=le.fit_transform(data1["workex"])
data1["specialisation"]=le.fit_transform(data1["specialisation"])
data1["status"]=le.fit_transform(data1["status"])
data1

x=data1.iloc[:,:-1]
x
y=data1["status"]
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=0)
from sklearn.linear_model import LogisticRegression
lr=LogisticRegression(solver="liblinear") # A Library for Large Linear Classification
lr.fit(x_train,y_train)
y_pred=lr.predict(x_test)
print("Predicted values : ")
y_pred

from sklearn.metrics import accuracy_score
accuracy = accuracy_score(y_test,y_pred)
print("Accuracy : ")
accuracy

from sklearn.metrics import confusion_matrix
confusion=confusion_matrix(y_test,y_pred)
print("Confusion matrix:\n",confusion)

from sklearn.metrics import classification_report
classification_report1 = classification_report(y_test,y_pred)
print("Classification Report : ")
print(classification_report1)

lr.predict([[1,80,1,90,1,1,90,1,0,85,1,85]])

Output:

Dataset

Screenshot 2024-03-22 104100

Transformed Data

Screenshot 2024-03-22 104335

Null values

Screenshot 2024-03-22 104228

X values

Screenshot 2024-03-22 104439

Y values

Screenshot 2024-03-22 104523

Screenshot 2024-03-22 104603

Screenshot 2024-03-22 104646

Screenshot 2024-03-22 105013

Classification Report

Screenshot 2024-03-22 105104

Result:

Thus the program to implement the the Logistic Regression Model to Predict the Placement Status of Student is written and verified using python programming.

implementation-of-logistic-regression-model-to-predict-the-placement-status-of-student's People

Contributors

akilamohan avatar jananisoundararajan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.