Data-driven modeling and analysis of residential building energy consumption and demand flexibility