The power sector faces a considerable loss of energy both technical and non-technical. The non-technical losses are related with energy delivered but whose cost is not recovered. Several attempts have made to minimize this problem, however the problem has persisted. The application of data mining algorithms to commercial and technical databases allows us to have patterns of energy consumption which related with the social, economic and demographic information allows knowing the phenomena behind the losses of energy. The patterns will be useful to design a Bayesian model to predict losses of energy. The Bayesian model we are designing includes a wide spectrum of parameters and relationships which allows using minimal evidence to detect potential and early losses. Since there is a huge amount of data and sometimes it is incomplete, irrelevant or missing, we have evaluated several algorithms to prepare data and for select relevant data. In this paper, the framework and current results are presented.