Spaces:
Sleeping
Sleeping
app.py
#1
by
tanya17
- opened
app.py
CHANGED
@@ -124,7 +124,7 @@ def predict_lifecycle(Category, ProductName, Price, Rating, NumReviews, StockQua
|
|
124 |
return f"Error: {str(e)}"
|
125 |
|
126 |
# Load dataset for dynamic pricing
|
127 |
-
df_pricing = pd.read_csv("
|
128 |
|
129 |
# Encode categorical variables for dynamic pricing
|
130 |
label_encoders = {}
|
@@ -176,7 +176,7 @@ def predict_price(product_name, category, base_price, competitor_price, demand,
|
|
176 |
return f"Optimal Price: ₹{round(predicted_price, 2)}"
|
177 |
|
178 |
# Load dataset for product recommendation
|
179 |
-
df_recommendation = pd.read_csv("
|
180 |
|
181 |
# Preprocessing for product recommendation
|
182 |
categorical_features_recommendation = ['product_condition', 'category']
|
@@ -207,7 +207,7 @@ def recommend_products(category):
|
|
207 |
|
208 |
# Circular Economy Analytics Dashboard
|
209 |
def load_data():
|
210 |
-
return pd.read_csv("
|
211 |
|
212 |
def update_live_data():
|
213 |
df = load_data()
|
@@ -218,7 +218,7 @@ def update_live_data():
|
|
218 |
"NumReviews": np.random.randint(0, 1000)
|
219 |
}
|
220 |
df = df.append(new_entry, ignore_index=True)
|
221 |
-
df.to_csv("
|
222 |
|
223 |
def generate_dashboard():
|
224 |
df = load_data()
|
@@ -331,4 +331,6 @@ def live_update():
|
|
331 |
threading.Thread(target=live_update, daemon=True).start()
|
332 |
|
333 |
# Launch the app
|
334 |
-
app.launch()
|
|
|
|
|
|
124 |
return f"Error: {str(e)}"
|
125 |
|
126 |
# Load dataset for dynamic pricing
|
127 |
+
df_pricing = pd.read_csv("/content/dynamic_pricing_data_5000.csv") # Update this path with the correct one
|
128 |
|
129 |
# Encode categorical variables for dynamic pricing
|
130 |
label_encoders = {}
|
|
|
176 |
return f"Optimal Price: ₹{round(predicted_price, 2)}"
|
177 |
|
178 |
# Load dataset for product recommendation
|
179 |
+
df_recommendation = pd.read_csv("/content/synthetic_product_data_5000.csv") # Update this path with the correct one
|
180 |
|
181 |
# Preprocessing for product recommendation
|
182 |
categorical_features_recommendation = ['product_condition', 'category']
|
|
|
207 |
|
208 |
# Circular Economy Analytics Dashboard
|
209 |
def load_data():
|
210 |
+
return pd.read_csv("/content/synthetic_marketplace_data_2000.csv")
|
211 |
|
212 |
def update_live_data():
|
213 |
df = load_data()
|
|
|
218 |
"NumReviews": np.random.randint(0, 1000)
|
219 |
}
|
220 |
df = df.append(new_entry, ignore_index=True)
|
221 |
+
df.to_csv("/content/synthetic_marketplace_data_2000.csv", index=False)
|
222 |
|
223 |
def generate_dashboard():
|
224 |
df = load_data()
|
|
|
331 |
threading.Thread(target=live_update, daemon=True).start()
|
332 |
|
333 |
# Launch the app
|
334 |
+
app.launch()
|
335 |
+
|
336 |
+
|