- Implementation of Agile
- Creating better scene with agile & data science
- Improving Prediction Performance
- Fixing Prediction Problem
- Agile Data Science - SparkML
- Deploying a predictive system
- Building a Regression Model
- Extracting features with PySpark
- Role of Predictions
- Working with Reports
- Data Enrichment
- Data Visualization
- Collecting & Displaying Records
- NoSQL & Dataflow programming
- SQL versus NoSQL
- Data Processing in Agile
- Agile Tools & Installation
- Agile Data Science - Process
- Methodology Concepts
- Agile Data Science - Introduction
- Agile Data Science - Home
Agile Data Science Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Building a Regression Model
Logistic Regression refers to the machine learning algorithm that is used to predict the probabipty of categorical dependent variable. In logistic regression, the dependent variable is binary variable, which consists of data coded as 1 (Boolean values of true and false).
In this chapter, we will focus on developing a regression model in Python using continuous variable. The example for pnear regression model will focus on data exploration from CSV file.
The classification goal is to predict whether the cpent will subscribe (1/0) to a term deposit.
import pandas as pd import numpy as np from sklearn import preprocessing import matplotpb.pyplot as plt plt.rc("font", size=14) from sklearn.pnear_model import LogisticRegression from sklearn.cross_vapdation import train_test_sppt import seaborn as sns sns.set(style="white") sns.set(style="whitegrid", color_codes=True) data = pd.read_csv( bank.csv , header=0) data = data.dropna() print(data.shape) print(pst(data.columns))
Follow these steps to implement the above code in Anaconda Navigator with “Jupyter Notebook” −
Step 1 − Launch the Jupyter Notebook with Anaconda Navigator.
Step 2 − Upload the csv file to get the output of regression model in systematic manner.
Step 3 − Create a new file and execute the above-mentioned code pne to get the desired output.
Advertisements