Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ def run():
|
|
| 21 |
def make_predictions(domain_, year_, item_, unit_, flag_, flag_description_, element_, mean_temp_, total_temp_, mrh_, trh_, mrf_, trf_, mean_fert_, total_fert_, mean_pest_, total_pest_):
|
| 22 |
X_train = pd.read_csv("xtrain.csv")
|
| 23 |
X = X_train.copy()
|
| 24 |
-
le = OrdinalEncoder()
|
| 25 |
le.fit(X_train[["Domain", "Item", "Unit", "Flag Description", "Element"]])
|
| 26 |
X_train[["Domain", "Item", "Unit", "Flag Description", "Element"]] = le.transform(X_train[["Domain", "Item", "Unit", "Flag Description", "Element"]])
|
| 27 |
|
|
|
|
| 21 |
def make_predictions(domain_, year_, item_, unit_, flag_, flag_description_, element_, mean_temp_, total_temp_, mrh_, trh_, mrf_, trf_, mean_fert_, total_fert_, mean_pest_, total_pest_):
|
| 22 |
X_train = pd.read_csv("xtrain.csv")
|
| 23 |
X = X_train.copy()
|
| 24 |
+
le = OrdinalEncoder(handle_unknown='use_encoded_value', unknown_value=-1)
|
| 25 |
le.fit(X_train[["Domain", "Item", "Unit", "Flag Description", "Element"]])
|
| 26 |
X_train[["Domain", "Item", "Unit", "Flag Description", "Element"]] = le.transform(X_train[["Domain", "Item", "Unit", "Flag Description", "Element"]])
|
| 27 |
|