This is the general code for creating a logistic regression model.
In this Machine Learning Model we are able to predict a binary outcome. In this example code we use the Cars' specs dataset. We predict the cars Gear System - Automatic(1) or Manual(0) - (AM) from different independent variables.
Before getting started with the code, be sure that you have pandas, numpy, matplotlib and seaborn installed on your PC.
To install the above packages, open cmd and type pip install pandas
, pip install numpy
, pip install matplotlib
and
pip install seaborn
to install all the required packages.
Feel free to use the dataset I used i.e. cars.csv
.
The Python Notebook is well commented and has headings to make it more understandable. Take your time to browse through it.
Cheers!
### Code Description::
The following steps are followed in the notebook::
1) Importing libraries for exploratory Data Analysis & Data Visualization
2) importing Data
3) Exloratory Data Analysis & Visualization is performed
4) training and testing model selection
5) Importing machine learning algorithm i.e. linear regression
6) Finally values are predicted