Machine Learning and Coding Schemes for Fault and Cyber-attack Detection of Unmanned Aerial Vehicles