i generated a model with random data like so: rca = ['High', 'Medium', 'Low'] cr = ['Positive',
Question:
i generated a model with random data like so:
rca = ['High', 'Medium', 'Low']
cr = ['Positive', 'Negative']
ms = ['Married', 'Single', 'Not Specified']
nod = ['No dependent', 'Less than two', 'More than two']
yoe = np.random.randint(0, 8, size=30)
mi = ['Very Low', 'Low', 'Moderate', 'High', 'Very High']
me = ['Very Low', 'Low', 'Moderate', 'High', 'Very High']
df = pd.DataFrame()
a = []
b = []
c = []
d = []
e = []
f = []
for i in range(30):
a.append(random.choice(rca))
b.append(random.choice(cr))
c.append(random.choice(ms))
d.append(random.choice(nod))
e.append(random.choice(mi))
f.append(random.choice(me))
df['Credit Rating'] = b
df['Requested credit amount'] = a
df['Marital status'] = c
df['Number of Dependents'] = d
df['Years of education after high school'] = yoe.tolist()
df['Monthly income'] = e
df['Monthly expense'] = f
with this data I am unable to fit logistic regression. Below is the error , please help in resolving
Practicing Statistics Guided Investigations For The Second Course
ISBN: 9780321586018
1st Edition
Authors: Shonda Kuiper, Jeff Sklar