The Internet of Things is a fast emerging technology, however, there have been a significant number of security challenges that have hindered its adoption. This work explores the use of machine learning methods for anomaly detection in network traffic of an IoT network that is connected through a Software Defined Network (SDN). The use of SDN allows a hierarchical approach to machine learning with the aim of reducing the packet level processing of anomaly detection at the edge through applying additional centralised machine learning in the SDN controller. For the sake of evaluation, we compare several supervised classification algorithms using a publicly available dataset. The results support a decision-tree based approach and show that the proposed solution promises a considerable reduction in the per-packet processing at the network edge compared to a single stage classifier.