olivermueller commited on
Commit
95ec290
1 Parent(s): b7187da

Fine tuning

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -16,6 +16,9 @@ import graphviz as graphviz
16
  # load data
17
  data = pd.read_csv('german_credit_from_r.csv')
18
 
 
 
 
19
  # recode credit risk
20
  data['Credit_risk'] = data['Credit_risk'].map({'GOOD': 0, 'BAD': 1})
21
 
@@ -55,15 +58,20 @@ The dataset contains the following variables:
55
  - Job
56
  - Number of people being liable to provide maintenance for
57
  - Telephone
58
- - Foreign worker
59
- - Gender
60
  """
61
  )
62
  #st.divider()
63
 
64
  # header: data
65
  st.header('Data')
66
- data
 
 
 
 
 
 
67
  #st.divider()
68
 
69
  # header: predictors
 
16
  # load data
17
  data = pd.read_csv('german_credit_from_r.csv')
18
 
19
+ # remove vars
20
+ data.drop(['Foreign_worker', 'Gender'], axis=1, inplace=True)
21
+
22
  # recode credit risk
23
  data['Credit_risk'] = data['Credit_risk'].map({'GOOD': 0, 'BAD': 1})
24
 
 
58
  - Job
59
  - Number of people being liable to provide maintenance for
60
  - Telephone
61
+ - Credit risk (1 = bad, 0 = good)
 
62
  """
63
  )
64
  #st.divider()
65
 
66
  # header: data
67
  st.header('Data')
68
+ # move Credit_risk to the end
69
+ cols = data.columns.tolist()
70
+ cols.remove('Credit_risk')
71
+ cols.append('Credit_risk')
72
+ data = data[cols]
73
+ st.write('First 20 rows of the dataset:')
74
+ data.loc[1:20, :]
75
  #st.divider()
76
 
77
  # header: predictors