Over the recent years smart cities have been emerged as promising paradigm for a transition toward providing effective and real time smart services. Despite the great potential it brings to citizens' life, security and privacy issues still need to be addressed. Due to technology advances, large amount of data is produced, where machine learning methods are applied to learn meaningful patterns. In this paper a machine learning-based framework is proposed for detecting distributed Denial of Service (DDoS) attacks in smart cities. The proposed framework applies restricted Boltzmann machines to learn high-level features from raw data and on top of these learned features, a feed forward neural network model is trained for attack detection. The performance of the proposed framework is verified using a smart city dataset collected from a smart water plant. The results show the effectiveness of the proposed framework in detecting DDoS attacks.