Data-driven approaches to maintenance policy definition: general framework and applications