Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,8 @@ import random
|
|
6 |
import hopsworks
|
7 |
import joblib
|
8 |
import pandas as pd
|
|
|
|
|
9 |
|
10 |
|
11 |
project = hopsworks.login()
|
@@ -18,8 +20,6 @@ model_dir = model.download()
|
|
18 |
model = joblib.load(model_dir + "/titanic_model_RF.pkl")
|
19 |
|
20 |
def encode_features(df):
|
21 |
-
from sklearn.preprocessing import OneHotEncoder, LabelEncoder, StandardScaler
|
22 |
-
import pandas as pd
|
23 |
non_numeric_features = ['embarked', 'sex', 'deck', 'title', 'family_size_grouped']
|
24 |
for feature in non_numeric_features:
|
25 |
df[feature] = LabelEncoder().fit_transform(df[feature])
|
|
|
6 |
import hopsworks
|
7 |
import joblib
|
8 |
import pandas as pd
|
9 |
+
from sklearn.preprocessing import OneHotEncoder, LabelEncoder, StandardScaler
|
10 |
+
|
11 |
|
12 |
|
13 |
project = hopsworks.login()
|
|
|
20 |
model = joblib.load(model_dir + "/titanic_model_RF.pkl")
|
21 |
|
22 |
def encode_features(df):
|
|
|
|
|
23 |
non_numeric_features = ['embarked', 'sex', 'deck', 'title', 'family_size_grouped']
|
24 |
for feature in non_numeric_features:
|
25 |
df[feature] = LabelEncoder().fit_transform(df[feature])
|