Demand Response (DR) was proposed more than a decade ago to incentivise customers to shift their electricity usage from peak demand periods to off-peak demand periods and to curtail their electricity usage during peak demand periods. However, the lack of two-way communication infrastructure weakens the influence of DR and limits its applications. With the development of smart grid facilities (e.g. smart meters and the two-way communication infrastructure) that enable the interactions between the energy retailer and its customers, demand response shows great potential to reduce customers' bills, increase the retailer's profit and further stabilize the power systems. Given such a context, in this thesis we propose smart pricing based demand response programs to study the interactions between the energy retailer and its customers based on game-theory and machine learning techniques. We conduct the research in two different application scenarios: 1) For customers with home energy management system (HEMS) installed in their smart meters, the retailer will know the customers' energy consumption patterns by interacting with the HEMS. As a result, the smart pricing based demand response problem can be modelled as a Stackelberg game or bilevel optimization problem. Further, efficient solutions are proposed for the demand response problems and the existence of optimal solution to the Stackelberg game and the bilevel model is proved; 2) For customers without HEMS installed in their smart meters, the retailer will not know the energy consumption patterns of these customers and must learn customers' behaviour patterns via historical energy usage data. To realize this, two appliance-level machine learning algorithms are proposed to learn customers' consumption patterns. Further, distributed pricing algorithms are proposed for the retailer to solve the demand response problem effectively. Simulation results indicate the effectiveness of the proposed demand response models in both application scenarios.