Spaces:
Runtime error
Runtime error
Edward Nagy
commited on
Fix model feature names
Browse files
app.py
CHANGED
@@ -15,11 +15,11 @@ model_dir = model.download()
|
|
15 |
model = joblib.load(model_dir + "/wine_class_model.pkl")
|
16 |
print("Model downloaded")
|
17 |
|
18 |
-
def wine_quality_class(
|
19 |
print("Calling function")
|
20 |
-
|
21 |
-
df = pd.DataFrame([[fixed_acidity, volatile_acidity, citric_acid, residual_sugar, chlorides, free_sulfur_dioxide, density, ph, sulphates, alcohol,
|
22 |
-
columns=['fixed_acidity','volatile_acidity','citric_acid','residual_sugar','chlorides','free_sulfur_dioxide','density','ph','sulphates','alcohol','
|
23 |
print("Predicting")
|
24 |
print(df)
|
25 |
# 'res' is a list of predictions returned as the label.
|
|
|
15 |
model = joblib.load(model_dir + "/wine_class_model.pkl")
|
16 |
print("Model downloaded")
|
17 |
|
18 |
+
def wine_quality_class(fixed_acidity, volatile_acidity, citric_acid, residual_sugar, chlorides, free_sulfur_dioxide, density, ph, sulphates, alcohol, wine_type_name):
|
19 |
print("Calling function")
|
20 |
+
type_white = 1.0 if wine_type_name == "white" else 0.0
|
21 |
+
df = pd.DataFrame([[fixed_acidity, volatile_acidity, citric_acid, residual_sugar, chlorides, free_sulfur_dioxide, density, ph, sulphates, alcohol, type_white]],
|
22 |
+
columns=['fixed_acidity','volatile_acidity','citric_acid','residual_sugar','chlorides','free_sulfur_dioxide','density','ph','sulphates','alcohol','type_white'])
|
23 |
print("Predicting")
|
24 |
print(df)
|
25 |
# 'res' is a list of predictions returned as the label.
|