Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -58,11 +58,13 @@ def predict_capacity():
|
|
| 58 |
|
| 59 |
# Convert to DataFrame
|
| 60 |
input_data = pd.DataFrame([sample])
|
|
|
|
| 61 |
data_set = input_data.copy() # optional backup
|
| 62 |
|
| 63 |
# Drop any IDs if your pipeline doesn’t need them
|
| 64 |
# input_data.drop(["Store_Id"], axis=1, inplace=True) # example
|
| 65 |
|
|
|
|
| 66 |
# Predict using the trained pipeline
|
| 67 |
prediction = pipeline.predict(input_data).tolist()[0]
|
| 68 |
|
|
@@ -116,6 +118,7 @@ def predict_capacity_batch():
|
|
| 116 |
|
| 117 |
# Convert list of dicts to DataFrame
|
| 118 |
input_data = pd.DataFrame(data_list)
|
|
|
|
| 119 |
|
| 120 |
# Predict using pipeline
|
| 121 |
predictions = pipeline.predict(input_data).tolist()
|
|
|
|
| 58 |
|
| 59 |
# Convert to DataFrame
|
| 60 |
input_data = pd.DataFrame([sample])
|
| 61 |
+
input_data["Date"] = pd.to_datetime(input_data["Date"]) # ⚡ convert to datetime
|
| 62 |
data_set = input_data.copy() # optional backup
|
| 63 |
|
| 64 |
# Drop any IDs if your pipeline doesn’t need them
|
| 65 |
# input_data.drop(["Store_Id"], axis=1, inplace=True) # example
|
| 66 |
|
| 67 |
+
|
| 68 |
# Predict using the trained pipeline
|
| 69 |
prediction = pipeline.predict(input_data).tolist()[0]
|
| 70 |
|
|
|
|
| 118 |
|
| 119 |
# Convert list of dicts to DataFrame
|
| 120 |
input_data = pd.DataFrame(data_list)
|
| 121 |
+
input_data["Date"] = pd.to_datetime(input_data["Date"]) # ⚡ convert to datetime
|
| 122 |
|
| 123 |
# Predict using pipeline
|
| 124 |
predictions = pipeline.predict(input_data).tolist()
|