change some column names to lowercase
Browse files
app.py
CHANGED
@@ -23,7 +23,13 @@ rose_url = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSGoi8okN1Fw6tY
|
|
23 |
|
24 |
def titanic(pclass, name, sex, age, sibsp, parch, ticket, fare, cabin, embarked):
|
25 |
df_pre = pd.DataFrame({"PassengerId":[-1], "Pclass": [pclass], "Name": [name], "Sex": [sex], "Age": [age], "SibSp": [sibsp], "Parch": [parch], "Ticket": [ticket], "Fare": [fare], "Cabin": [cabin], "Embarked": [embarked]})
|
|
|
|
|
|
|
26 |
df_post = feat_eng(df_pre)
|
|
|
|
|
|
|
27 |
# 'res' is a list of predictions returned as the label.
|
28 |
res = model.predict(df_post)[0]
|
29 |
# We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
|
|
|
23 |
|
24 |
def titanic(pclass, name, sex, age, sibsp, parch, ticket, fare, cabin, embarked):
|
25 |
df_pre = pd.DataFrame({"PassengerId":[-1], "Pclass": [pclass], "Name": [name], "Sex": [sex], "Age": [age], "SibSp": [sibsp], "Parch": [parch], "Ticket": [ticket], "Fare": [fare], "Cabin": [cabin], "Embarked": [embarked]})
|
26 |
+
namechanges = {("sex", "Sex"), ("age", "Age"), ("sibsp", "SibSp"), ("parch", "Parch"), ("embarked", "Embarked"), ("title", "Title")}
|
27 |
+
|
28 |
+
|
29 |
df_post = feat_eng(df_pre)
|
30 |
+
for tuple in namechanges:
|
31 |
+
df_post[tuple[0]] = df_post[tuple[1]]
|
32 |
+
print(df_post)
|
33 |
# 'res' is a list of predictions returned as the label.
|
34 |
res = model.predict(df_post)[0]
|
35 |
# We add '[0]' to the result of the transformed 'res', because 'res' is a list, and we only want
|