Example of logistic regression using German credit data

Open source German credit data has been utilized from the UCI machine learning repository to model logistic regression: https://archive.ics.uci.edu/ml/datasets/Statlog+(German+Credit+Data).

>>> import os 
>>> os.chdir("D:\\Book writing\\Codes\\Chapter 3") 
 
>>> import numpy as np 
>>> import pandas as pd 
 
>>> from sklearn.model_selection import train_test_split     
>>> from sklearn.metrics import accuracy_score,classification_report 
 
>>> credit_data = pd.read_csv("credit_data.csv") 

The following code describes the top five rows of the data:

>>> print (credit_data.head()) 

Altogether, we have ...

Get Statistics for Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.