The Internet of Things (IoT) is gaining momentum in its quest to bridge the gap between the physical and the digital world. The main goal of the IoT is the creation of smart environments and self-aware things that help to facilitate a variety of next generation services. Huge volumes of data are expected to be collected by the connected sensors/things, which in traditional cases are processed centrally by large data centers in the core network that will inevitably lead to excessive trans-portation power consumption as well as added latency overheads. Instead, fog computing has been proposed by researchers from industry and academia to extend the capability of the cloud right to the point where the data is collected at the sensing layer. This way, primitive tasks that can be hosted in IoT sensors do not need to be sent all the way to the cloud for processing. In this paper, we propose energy efficient embedding of generic smart services over a cloud-fog network using a Mixed Integer Linear Programming (MILP) optimization model. We exploit virtualization in our framework to abstract Machine learning (ML) services that have multiple interconnected components such as Deep Neural Networks (DNN) layers. The different layers are composed into a set of VMs interconnected by virtual links. We study the single VM allocation solution and the multiple VM allocation solution at the IoT layer. The results showed that the latter solution is far more superior as a maximum power saving of 65% can be achieved.