Professional Documents
Culture Documents
AIM:
(a) Execute the Logistic Regression with the help of diabetes data set. Analyse the
result and identify how well the model performed on test set. Brief the steps that
you have followed for analyses the data set.
THEORY:
Logistic regression is a fundamental and widely used statistical method in machine learning for
binary classification tasks.
Logistic regression is a supervised machine learning algorithm used for classification tasks where
the goal is to predict the probability that an instance belongs to a given class or not.
Logistic regression aims to model the probability that an instance belongs to a particular class based on
one or more predictor variables. It's particularly useful when the dependent variable (target) is
categorical with two levels, commonly referred to as the binary classification problem.
For example, we have two classes Class 0 and Class 1 if the value of the logistic function for an input is
greater than 0.5 (threshold value) then it belongs to Class 1 it belongs to Class 0. It’s referred to as
regression because it is the extension of linear regression but is mainly used for classification problems.
On the basis of the categories, Logistic Regression can be classified into three types:
1. Binomial: In binomial Logistic regression, there can be only two possible types of the dependent
variables, such as 0 or 1, Pass or Fail, etc.
3. Ordinal: In ordinal Logistic regression, there can be 3 or more possible ordered types of
dependent variables, such as “low”, “Medium”, or “High”.
Load Data: Open Weka Explorer and load your dataset. Weka supports various file formats, such as
ARFF, CSV, and more.
1.Choose Logistic Regression Algorithm: Navigate to the "Classify" tab in Weka Explorer. Click on
the "Choose" button to select the logistic regression algorithm. In Weka, logistic regression is
implemented as the "Logistic" classifier under the "functions" category.
2. Split Data (optional): Optionally, split your dataset into training and testing sets to
evaluate the performance of the logistic regression model. First use 80% for training and
20% for testing. Second time, use 60% for training and 40% testing.
3. Run Logistic Regression: Once we have selected the logistic regression algorithm and
set the options, click on the "Start" button to run the logistic regression model on your
dataset.
4. Evaluate Results: After running the logistic regression model, evaluate its performance
using appropriate evaluation metrics. Weka provides tools for computing various
performance metrics such as accuracy, precision, recall, F1-score, ROC curve, and
AUCROC.
coefficients of the predictor variables, odds ratios, and any other relevant statistics.
Weka provides visualization tools and summary statistics to help interpret the results.