Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,6 +60,8 @@ if dataset_choice == "Reliance Digital Order Complete Dataset":
|
|
| 60 |
url = "https://www.reliancedigital.in/"
|
| 61 |
st.write("Created using the clickstream order-completed data from [reliancedigital.com](%s)" % url)
|
| 62 |
st.write("An item is only recommended if it costs less than the chosen item.")
|
|
|
|
|
|
|
| 63 |
|
| 64 |
|
| 65 |
# Inject custom CSS for the tab headings
|
|
@@ -164,6 +166,8 @@ with tab2:
|
|
| 164 |
# Separate the sorted items into IDs and counts
|
| 165 |
item_ids = [item for item in corrected_fp_growth_results[query_id]]
|
| 166 |
item_counts = [corrected_fp_growth_results[query_id][item] for item in corrected_fp_growth_results[query_id]]
|
|
|
|
|
|
|
| 167 |
|
| 168 |
confidence_list = []
|
| 169 |
transactions_list_digital = []
|
|
@@ -191,11 +195,12 @@ with tab2:
|
|
| 191 |
count_info = f"Co-purchased {copurchase_count[index]}/{transactions_with_querry_item} times"
|
| 192 |
item_counts_info = f"item-count {item_counts[index]} "
|
| 193 |
confidence_info = f"Confidence: {round(confidence_list[index], 3)}"
|
|
|
|
| 194 |
|
| 195 |
# Use <br> to display each line separately
|
| 196 |
mid_section += f"""<div class="item">
|
| 197 |
<p style="font-size: 16px; font-weight: bold; white-space: normal; word-wrap: break-word;">{str(product_names[index])}</p>
|
| 198 |
-
<p>{count_info}<br>{confidence_info}<br
|
| 199 |
</div>"""
|
| 200 |
|
| 201 |
|
|
|
|
| 60 |
url = "https://www.reliancedigital.in/"
|
| 61 |
st.write("Created using the clickstream order-completed data from [reliancedigital.com](%s)" % url)
|
| 62 |
st.write("An item is only recommended if it costs less than the chosen item.")
|
| 63 |
+
st.write("Cost of chosen item:", str(round(item_costs_digital_data[query_id], 3)))
|
| 64 |
+
|
| 65 |
|
| 66 |
|
| 67 |
# Inject custom CSS for the tab headings
|
|
|
|
| 166 |
# Separate the sorted items into IDs and counts
|
| 167 |
item_ids = [item for item in corrected_fp_growth_results[query_id]]
|
| 168 |
item_counts = [corrected_fp_growth_results[query_id][item] for item in corrected_fp_growth_results[query_id]]
|
| 169 |
+
item_costs = [item_costs_digital_data.get(item, "cost missing") for item in corrected_fp_growth_results[query_id]]
|
| 170 |
+
|
| 171 |
|
| 172 |
confidence_list = []
|
| 173 |
transactions_list_digital = []
|
|
|
|
| 195 |
count_info = f"Co-purchased {copurchase_count[index]}/{transactions_with_querry_item} times"
|
| 196 |
item_counts_info = f"item-count {item_counts[index]} "
|
| 197 |
confidence_info = f"Confidence: {round(confidence_list[index], 3)}"
|
| 198 |
+
item_cost_info = f"Cost: {round(item_costs[index],3)}"
|
| 199 |
|
| 200 |
# Use <br> to display each line separately
|
| 201 |
mid_section += f"""<div class="item">
|
| 202 |
<p style="font-size: 16px; font-weight: bold; white-space: normal; word-wrap: break-word;">{str(product_names[index])}</p>
|
| 203 |
+
<p>{count_info}<br>{confidence_info}<br>{item_cost_info}</p>
|
| 204 |
</div>"""
|
| 205 |
|
| 206 |
|