A consensus-based approach for structural resilience to earthquakes using machine learning techniques