Predictive maintenance for machines and systems