rlyle31/PM-Prediction
0
AMETEK Service Opportunity Dashboard
Predicting Customer Preventive Maintenance and Service Agreement Adoption
Upload the "4. History Report โ AI Report" Excel file to generate a standalone HTML dashboard with three tabs:
All three tabs are derived from the same account and unit objects, so activity, pattern, due flag, streak and trend can never disagree between them.
Files
app.py injects the datasets between the header and the footer, so both templates must stay free of `</script>` and of any `JSON.parse` data declarations. A stray </script> closes the block early and everything after it renders as visible text on the page.
API Endpoints
GET /api/healthโ Health checkPOST /api/generateโ multipart upload, returns the HTML dashboardPOST /api/generate-jsonโ{file_base64, filename}โ{download_url, status}(used by Power Automate)GET /download/{filename}โ Serve a previously generated dashboard
Scoring summary
- PM1 annual โ PM5 5-year โ PM10/PCBR 10-year. PM10 and PCBR are tracked independently; PCBR is often deferred a year and bundled with a PM1.
- Pattern (Full Schedule / Milestone Only / No History) is a behavioural label only โ it never drives the recommendation.
- Recommendation defaults to PM1, escalating to a milestone only when that milestone is overdue or 4.5+ years have passed since the last major PM.
- Trend compares completed years only (2024 vs 2025) as a service rate. The current year is partial, so it counts as a positive signal but never as evidence of decline.
- Streak requires activity in the current or last year, so a historical run never reads as a current streak.
- Only rows carrying a Product Type are treated as assets โ the report also lists accounts with no in-scope equipment.
