saifhmb commited on
Commit
92d448c
·
unverified ·
1 Parent(s): daf1c79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -78,9 +78,13 @@ def welcome():
78
  # defining the function which will make the prediction using the data which the user inputs
79
  def prediction(AGE, INCOME, GENDER, MARITAL, NUMKIDS, NUMCARDS, HOWPAID, MORTGAGE, STORECAR, LOANS):
80
  #prediction = model.predict(sc.transform([[AGE, INCOME, GENDER, MARITAL, NUMKIDS, NUMCARDS, HOWPAID, MORTGAGE, STORECAR, LOANS]]))
81
- prediction = model.predict([[AGE, INCOME, GENDER, MARITAL, NUMKIDS, NUMCARDS, HOWPAID, MORTGAGE, STORECAR, LOANS]])
82
- print(prediction)
 
 
 
83
  print(prediction)
 
84
  return prediction
85
 
86
  # this is the main function in which we define our webpage
 
78
  # defining the function which will make the prediction using the data which the user inputs
79
  def prediction(AGE, INCOME, GENDER, MARITAL, NUMKIDS, NUMCARDS, HOWPAID, MORTGAGE, STORECAR, LOANS):
80
  #prediction = model.predict(sc.transform([[AGE, INCOME, GENDER, MARITAL, NUMKIDS, NUMCARDS, HOWPAID, MORTGAGE, STORECAR, LOANS]]))
81
+ dataset = pd.DataFrame([[AGE, INCOME, GENDER, MARITAL, NUMKIDS, NUMCARDS, HOWPAID, MORTGAGE, STORECAR, LOANS]], columns = ['AGE', 'INCOME', 'GENDER', 'MARITAL', 'NUMKIDS', 'NUMCARDS', 'HOWPAID', 'MORTGAGE', 'STORECAR', 'LOANS'])
82
+ ct = make_column_transformer([OneHotEncoder(), make_column_selector(dtype_include=object)], remainder = 'passthrough')
83
+ X_test = ct.fit_transform(dataset)
84
+ X_test = sc.transform(X_test)
85
+ prediction = model.predict(X_test)
86
  print(prediction)
87
+
88
  return prediction
89
 
90
  # this is the main function in which we define our webpage