====== predict ====== Host: **sg02.picalike.corpex-kunden.de** Port: **8555** Git: **playground_silvia** (maybe move it?) ===== Dependencies ===== * werkzeug * v3legacy.mongo.replica ===== Description ===== Provides an estimation of today's KPI to be shown in Visualytics graphs. It is called by /stats_clicks and /stats_checkouts. === in: === {"current": , "now": , "uid": } - current is the number of [clicks | checkouts | sessions] collected since 00:00 of the current day - now is the current time - uid is the shop id === out: === {"prediction": } ==== Details ==== The prediction in calculated as: current/factor. The factor is calculated according to the time of the day based on data contained in the “predFactors” collection in the Mongo Billing. The collection is updated at the end of every day by update_factors.py, currently running on dev01pdev (should we move it?). These updates are based on data collected every hour by todays_data.py, also running on dev01pdev, and stored in the collection “visitsToday” in the Mongo Billing. ===== Possible improvement ===== Create collections “clicksToday” and “checkoutsToday” for more accurate predictions? In this case, [clicks | checkouts | sessions] should be passed to the service and added as field to collection “predFactors”.