B55MLExp1
B55MLExp1
Experiment No. 1
A.1 Aim:
A.2 Prerequisite:
Python Basic Concepts
A.3 Outcome:
Students will be able to implement Logistic Regression.
A.4 Theory:
Machine Learning, being a subset of Artificial Intelligence (AI), has been playing a dominant
role in our daily lives. Data science engineers and developers working in various domains
are widely using machine learning algorithms to make their tasks simpler and life easier.
Logistic regression
Sigmoid function, which produces an S-shaped curve. It always returns a probability value
between 0 and 1. The Sigmoid function is used to convert expected values to probabilities.
The function converts any real number into a number between 0 and 1. We utilize sigmoid to
translate predictions to probabilities in machine learning.The mathematically sigmoid
function can be
● In health care, logistic regression can be used to predict if a tumor is likely to be benign
or malignant.
● In the financial industry, logistic regression can be used to predict if a transaction is
fraudulent or not.
● In marketing, logistic regression can be used to predict if a targeted audience will respond
or not.
● It does not require too many computational resources as it’s highly interpretable
● There is no problem scaling the input features—It does not require tuning
● It gives a measure of how relevant a predictor (coefficient size) is, and its direction of
association (positive or negative)
PART B
(PART B : TO BE COMPLETED BY STUDENTS)
(Students must submit the soft copy as per following segments within two hours of the practical. The
soft copy must be uploaded on the Blackboard or emailed to the concerned lab in charge faculties at
the end of the practical in case the there is no Black board access available)
Logistic regression aims to solve classification problems. It does this by predicting categorical
outcomes. Logistic regression is a statistical method used for binary classification, predicting the
probability of a binary outcome based on predictor variables. It employs the logistic function to
transform predictions into probabilities between 0 and 1. Coefficients in logistic regression indicate
the change in log-odds of the outcome for a unit change in the predictor, considering other variables
in the model. Training involves maximizing the likelihood of observed data given the model
parameters. Evaluation metrics like accuracy and ROC curves assess model performance.
Assumptions include linearity between predictors and log-odds, independent errors, and minimal multi
co-linearity. Logistic regression is widely applied in fields such as healthcare, marketing, and finance
for tasks like disease prediction, customer behavior analysis, and risk assessment, owing to its
interpretability and effectiveness in predicting binary outcomes based on available data.
B.4 Conclusion:
(Students must write the conclusion as per the attainment of individual outcome listed above and
learning/observation noted in section B.3)
Logistic regression is a valuable method for predicting binary outcomes by modeling probabilities
using the logistic function. It offers interpretable results through coefficients that quantify the impact
of predictors on the outcome's likelihood. Despite its assumptions, such as linearity and independence
of errors, logistic regression finds widespread use in fields like healthcare, marketing, and finance for
tasks such as disease prediction, customer segmentation, and risk assessment. Its simplicity and
effectiveness, as measured by metrics like accuracy and ROC curves, underscore its importance in
making informed decisions based on categorical data.