This document is a master's thesis submitted by Jérémy Pouech at KTH Royal Institute of Technology in Stockholm, Sweden in 2015. The thesis proposes an algorithm to make failure detection and classification for industrial robots more generic and semi-automatic. The algorithm uses machine learning to analyze sensory data recorded during robot operations and learn to differentiate between success and failure scenarios. It clusters the training data using OPTICS clustering and extracts labels to learn a classification function to detect failures in new data. The goal is to allow operators without programming skills to teach failure detection to robots. The thesis applies this framework to detect failures in an assembly task performed by an ABB YuMi robot.