- Discussion
- Useful Resources
- Quick Guide
- Summary
- Limitations
- Testing
- Building Classifier
- Splitting Data
- Preparing Data
- Restructuring Data
- Getting Data
- Setting up a Project
- Case Study
- Introduction
- Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Setting Up a Project
In this chapter, we will understand the process involved in setting up a project to perform logistic regression in Python, in detail.
Instalpng Jupyter
We will be using Jupyter - one of the most widely used platforms for machine learning. If you do not have Jupyter installed on your machine, download it from
. For installation, you can follow the instructions on their site to install the platform. As the site suggests, you may prefer to use Anaconda Distribution which comes along with Python and many commonly used Python packages for scientific computing and data science. This will alleviate the need for instalpng these packages inspanidually.After the successful installation of Jupyter, start a new project, your screen at this stage would look pke the following ready to accept your code.
Now, change the name of the project from Untitled1 to “Logistic Regression” by cpcking the title name and editing it.
First, we will be importing several Python packages that we will need in our code.
Importing Python Packages
For this purpose, type or cut-and-paste the following code in the code editor −
In [1]: # import statements import pandas as pd import numpy as np import matplotpb.pyplot as plt from sklearn import preprocessing from sklearn.pnear_model import LogisticRegression from sklearn.model_selection import train_test_sppt
Your Notebook should look pke the following at this stage −
Run the code by cpcking on the Run button. If no errors are generated, you have successfully installed Jupyter and are now ready for the rest of the development.
The first three import statements import pandas, numpy and matplotpb.pyplot packages in our project. The next three statements import the specified modules from sklearn.
Our next task is to download the data required for our project. We will learn this in the next chapter.
Advertisements