January 2020
Beginner to intermediate
372 pages
10h
English
Let's first make the necessary imports and get the data ready:
import pandas as pdfrom sklearn.model_selection import train_test_splitfrom sklearn.preprocessing import OneHotEncoder
data = pd.read_csv('creditApprovalUCI.csv')
X_train, X_test, y_train, y_test = train_test_split( data.drop(labels=['A16'], axis=1), data['A16'], test_size=0.3, random_state=0)
X_train['A4'].unique()
We see the unique values of A4 in the output of the preceding step:
array(['u', 'y', 'Missing', 'l'], dtype=object)
Read now
Unlock full access