A Data-Driven Approach to Predict Hourly Load Profiles From Time-of-Use Electricity Bills

The design of renewable-based and collective energy systems requires consumption data with fine temporal and spatial resolution. Despite the increasing deployment of smart meters, obtaining such data directly from measurements can still be challenging, particularly when attempting to gather historical data over a reasonable period for many end users. As a result, there is a need for models to simulate or predict these consumption data (e.g., hourly load profiles). Typically, these models rely on numerous specific and detailed observations, such as load type, household size for residential customers, or operating hours for commercial ones. However, gathering this level of detail becomes increasingly difficult as the number and diversity of end users increase. Therefore, this paper proposes a data-driven approach to predict hourly load profiles of heterogeneous end users using only their monthly time-of-use electricity bills as inputs. We create a training set using a limited number of hourly measurements from diverse categories of end users and, differently from other approaches aimed at classifying the end users, we develop a regression model to map monthly electricity bills to typical load profiles. Experimental results using one year of data from various end-user categories demonstrate an average normalized mean absolute error of approximately 26% for instantaneous consumption and less than 4% for time-of-use values. Comparative analysis with standard load profiles and a two-step data-driven approach based on classification reveals that our proposed method outperforms the others in terms of prediction accuracy and statistical metrics.


I. INTRODUCTION
The decarbonization of electricity will play a relevant role in the future, worldwide energy transition to transform the electricity grid into less carbon-intense or, potentially, carbon-free systems [1]. This transition will require more Renewable Energy Sources (RESs) to be integrated into the grid at both utility-scale and the small and local scale on a more dispersed perspective, as distributed generation [2]. The former, as large-size installations, usually participate in the wholesale markets, and hence their sizing does not dependent on local energy consumption. The latter solutions, instead, sustain local demand by increasing self-sufficiency The associate editor coordinating the review of this manuscript and approving it for publication was Reinaldo Tonkoski . and reducing supply costs in many fields of application, from the industrial [3] to the residential sectors [4].
Hence, RES-based distributed generation must be properly sized according to the energy demand, to make the installations affordable, profitable, and sustainable. Practically, the match between production and consumption at fine temporal resolution (at least hourly [5]) must be thoroughly assessed, e.g., through optimization [6], to avoid potential over-sizing or underestimation, regardless of the field of application.
For this reason, weather data are needed to estimate RES production through proper modeling of the active assets [7], while load (i.e., consumption) profiles of the local demand need to be identified [8]. This last task can become complex when the number and the typology of end users increase significantly, due to limited access to data measured by smart meters (SMs) and the consequent increase in the number of unobserved end users (i.e., whose consumption data cannot be collected at fine temporal resolution). In fact, collecting hourly (or sub-hourly) consumption data from SM can be challenging due to various factors, including privacy concerns and technical limitations. Privacy regulations often restrict the collection of granular consumption data, as they can reveal sensitive information about individuals' activities and habits. Moreover, the roll out of new SMs to allow measurements at fine temporal granularity for a large number of customers can be logistically demanding and time-consuming [9], [10]. Consequently, hourly consumption profiles are not always available. Energy bills, instead, provide aggregated consumption information and are typically already collected as part of standard billing procedures, making them readily available directly to the end users or suppliers. Despite being at a coarse temporal resolution, energy bills data provide valuable information for the analysis and prediction of load profiles, e.g., through data-driven modeling.
Unlike standard load profiles (SLPs) [11] or synthetically generated ones [12], data-driven approaches use measurements to build a model that relates attributes of the end users to their load profiles. This knowledge can then be extrapolated to predict load profiles of unobserved customers. Previous studies [13], [14] have utilized different attributes as input data. However, these approaches often require intensive and intrusive data collection, whereas the energy bill offers a potential solution by enabling models that can handle limited data [15].
Therefore, in this study, we propose a data-driven approach to predict the electricity load profiles of unobserved end users using only their electricity bills. Specifically, we leverage time-of-use (ToU) tariffs [16], [17], which divide the monthly bill based on varying consumption patterns throughout the day and week. Then, by applying a data-driven approach, our goal is to invert the relationship between the ToU consumption and the load profile that generated it. While it may be argued that different load profiles can result in the same energy bill, due to its integral nature, practical observations suggest a limited number of distinct consumption patterns [18]. We assume that these identifiable patterns are associated with different energy bills. Unlike classificationbased approaches [13], [14], [15], we utilize a regression model, specifically k-nearest neighbors (k-NN), to map energy bills to hourly load profiles.
Notwithstanding its limitations, the proposed approach is easily exploitable in contexts where managing a portfolio of end users is required, including unobservable ones. In fact, once the model is trained using a limited amount of measurements, it only utilizes aggregated data from monthly energy bills, which can be collected even for large numbers of heterogeneous end users. The fields of application of the approach extend beyond RES-based local energy systems to encompass the design and evaluation of Demand Response programs, identification of energy-saving opportunities, and creation of dedicated offers from energy suppliers.
The remaining sections are structured as follows. In Section II, we review the literature on load modeling, focusing on data-driven methods and presenting the related works and contributions of this study. Section III analyzes the load prediction from energy bills as an inverse problem. Section IV describes the implementation methods for the proposed approach and benchmark approaches from the literature. Section V discusses the data set used for testing the proposed approach. Section VI presents and compares the results obtained with benchmark approaches, discussing the strengths and limitations of the proposed approach. Finally, Section VII provides the conclusions of this work.

II. LITERATURE REVIEW AND CONTRIBUTION A. LOAD MODELING
This work pertains to the field of energy use/load modeling [19], specifically focusing on the prediction of fine-resolution electricity consumption data for heterogeneous end users (residential, commercial, public offices).
Traditionally, SLPs obtained from measurement campaigns have been widely utilized. For example, the H0 SLP is employed by energy companies in Germany and Austria for residential customers [11], [12]. Similarly, non-residential customers are categorized and assigned an SLP based on their assumed energy usage and/or energy intensity [20], [21]. However, SLPs have faced criticism due to their reliance on outdated data, ignoring recent changes in consumption patterns, and overlooking variations within the same category [12], [20], [22]. Moreover, SLPs struggle to accurately capture consumption levels and dynamics at fine temporal and spatial resolutions [11], [23]. Nevertheless, SLPs continue to be widely used in industry and government bodies, such as the Italian Manager of Energy Services (GSE), which adopted SLPs for regulating end users under collective self-consumption and energy communities to address the absence of SM data [24].
Conversely, research has focused on modeling energy usage to generate synthetic load profiles. Various models, classified as bottom-up and top-down (sometimes hybrid), have been proposed [25]. Extensive reviews of these models have been conducted by Grandjean et al. [26] and Proedrou [12]. In essence, bottom-up models can produce accurate and highly resolved load profiles but require extensive and detailed input data, while top-down models can work with fewer, large-scale data, but they are generally more suitable for aggregate-level load profile modeling [12], [25]. 1 Recently, data-driven models have flourished in the literature thanks to the introduction of Advanced Metering Infrastructure, of which SMs are a key component [28], [29], [30]. These models typically treat hourly or sub-hourly energy consumption data from SMs as time series and employ 1 It is worth noting that Duque et al. [27] recently developed a probabilistic model using smart meter measurements to generate synthetic load profiles for individual households, conditioned on specific total yearly consumption values. VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply. data mining and machine learning techniques to extract knowledge from them [31]. While these models find applications in various areas such as fault and anomaly/bad data detection, and load forecasting [32], our focus is on the topic of load management [29], which encompasses building energy benchmarking and customer segmentation.

60502
A significant portion of the literature is focused on the latter field, which aims to group energy end users based on similar characteristics. One approach is to cluster buildings with similar energy usage patterns to identify energy-saving opportunities [33], [34], [35]. Another approach involves identifying groups of customers with similar consumption patterns, enabling the provision of tailored offers and the implementation of Demand Response programs to enhance energy system operation [13], [14], [15], [22]. Studies by Rasanen et al. [20], Mutanen et al. [36], and, more recently, Parks et al. [18] and Zhan et al. [37] demonstrate how data-driven methods analyzing SM data yield more accurate results compared to traditional approaches based on activity typology (e.g., residential, commercial, government) and energy use intensity.
Clustering SM consumption data is a common characteristic of these data-driven methods, which involves unsupervised learning [38] to identify groups with similar consumption patterns. Each group, or cluster, is then associated with a representative load profile (i.e., the cluster center). Chicco [28], Zhou et al. [39] and Rajabi et al. [21] provide comprehensive reviews of load profile clustering, covering the methodologies, steps, application to customer classification, and performance evaluation metrics. It is important to note that only a few cases include a post-clustering phase, which entails supervised learning [38] to develop models such as classifier systems or regressions for extrapolating the acquired knowledge to new (or unobservable) customers.

B. RELATED DATA-DRIVEN APPROACHES
The post-clustering phase serves two opposing aims: inferring the characteristics of buildings/end users from their load profiles (used as predictive attributes) [40], [41]; predicting the class (and, consequently, load profile) of new or unobservable customers based on a series of attributes. The latter problem, on which we focus, has received little attention in the literature according to previous studies [13], [15] and to our own review.
Typically, the classification of new customers and the assignment of representative profiles rely on specific attributes of the end users within each cluster. For instance, Viegas et al. [14] utilized survey data, such as the age and income of family members, and the number of appliances, along with a limited amount of SM measurements (0 to 10 weeks). In the case of unobserved end users, the classification solely relies on the available survey data. Vercamer et al. [13], instead, classified non-residential consumers based on internal company data (e.g., commercial code, number of employees), open data related to the municipality, and cartographic information (e.g., building size). Piscitelli et al. [15], on the other hand, classified commercial and industrial end users based on easily collectible data such as monthly consumption from energy bills and information on opening/closing and lunchtime hours. In contrast to the aforementioned methods, Granell et al. [42] employed a regression approach using k-NN to predict the hourly load profiles of new supermarkets in different market areas, considering the floor area.
Overall, previous models have been developed based on category-specific end user attributes or through extensive data collection procedures. However, these approaches may not be suitable when dealing with a large number of end users from diverse categories, as they can become cumbersome and inefficient.

C. CONTRIBUTION
This paper introduces different key contributions to the field of load modeling and, in particular, end user load profile prediction. By building upon the existing literature, we address the following aspects.

1) UTILIZATION OF ToU ENERGY BILLS
The analyzed state-of-the-art approaches often rely on end-user attributes that are category-specific or require intensive data collection, which can be cumbersome and impractical. Conversely, our approach utilizes only the ToU energy bill for load profile prediction. While Piscitelli et al. [15] also used energy bills, their approach incorporated additional data, specific to commercial and industrial customers. Furthermore, they focused solely on weekdays, while we consider a more comprehensive set of typical days (also including Saturdays, and holidays, according to the ToU tariffs described in Section III).

2) REGRESSION-BASED PREDICTION
Unlike classification-based approaches employed in previous works, we adopt a regression-based methodology to predict hourly load profiles. We frame the problem as an inverse one since the input (energy bill) and output (consumption profile) are linked by a direct analytical relationship. SLPs, commonly used in the industry and by government bodies [24], map energy bills to load profiles independently of the bill's characteristics. In other words, the same profile is indifferently adopted for all end users (within a predefined category), while re-scaling is used to preserve the total consumption (see Fig. 1a). Alternatively, clustering-classification approaches map different energy bills to distinct load profiles (i.e., the cluster centers) which can be seen as a ''discrete'' mapping (see Fig. 1b). In contrast, our approach leverages regression using k-NN, enabling a more continuous mapping between energy bills and load profiles (see Fig. 1c). In this way, similar ToU energy bills are mapped into similar load profiles, reflecting the supposed inverse relationship between the two quantities, which is described more in detail in Section III. VOLUME 11, 2023 FIGURE 1. Visual representation exemplifying different ways of mapping the energy bills (represented as points in the x-space) to their corresponding typical load profile (i.e., their image in the y-space), which is represented as a line (see Section III-A for the definitions of these elements). These three methods of mapping are compared in the paper: in (a) an SLP is used, and consequently the values of an energy bill can only change the total consumption ('magnitude') of the typical load profile while the shape corresponds to the SLP; differently, in (b), the x-space is divided into clusters, and hence depending on the values of the energy bill (i.e., the position of a point in the x-space), it is mapped by with a different typical load profile whose shape corresponds to the cluster center; finally, in (c), each point is considered individually and mapped in a more continuous way, in a regression-like approach, by means of k-NN.

3) TESTING DIVERSE END-USER CATEGORIES
We leverage the fact that our proposed approach provides a more versatile and scalable solution that can be applied to a wide range of end-user categories. Therefore, while previous studies focus on a single category, we test the proposed approach on different customer categories, involving residential, commercial, and public offices. We also provide a comparison with two benchmarks, respectively based on SLPs and the two steps clustering-classification approach identified in the literature.
In summary, these contributions advance the field of load modeling and prediction, in particular by providing a streamlined and data-driven approach that utilizes time-ofuse energy bills for regression-based load profile prediction.

III. INVERSE PROBLEM DESCRIPTION
We start by providing an overview of the ToU tariff scheme implemented in the Italian regulation [43] since we use a set of SM measurements of Italian end users for testing our approach. In particular, three different tariffs are defined for electricity (F1, F2, F3), respectively, for on-peak, midpeak, and off-peak hours, which are arranged as shown in Fig. 2. According to these ToU tariffs, three types of days can be identified, each characterized by a different subdivision of the hours into ToU tariffs: work days, from Monday to Friday; Saturdays; and Sundays/holidays (just 'holidays', in the followings).

A. DEFINITIONS 1) LOAD PROFILE
We refer to a load profile as a time series of the energy consumption over a sequence of uniformly-spaced time steps, which in this paper have an hourly resolution. We use an average, uniform power demand associated with the energy consumption in each time step while using the term 'energy' for other quantities with rougher granularity (e.g., daily or monthly).

2) AVERAGE LOAD PROFILE
An average load profile is the result of a time stepby-time step average between load profiles that have the same length and that share some feature(s). In this paper, we evaluate average load profiles on a monthly basis, for each day type (work days, Saturdays, holidays).

3) TYPICAL LOAD PROFILE
A typical load profile provides a condensed representation of the three average load profiles in a month, obtained by putting the latter in a sequence (see Fig. 3).

4) ENERGY BILL
An energy bill is a set of records of the energy consumption (rather than the expenditure) in the three ToU tariffs in one month. The components of the energy bill can be evaluated from a typical load profile, considering the ToU structure depicted in Fig. 2.

5) SPACES OF THE ENERGY BILLS AND TYPICAL LOAD PROFILES
An energy bill can be imagined as a point in a space with three dimensions, i.e., one for each ToU tariff: we call this the 'x-space'. Similarly, we define a space of the typical load profiles, the 'y-space', that has one dimension for each time step in the profile.

B. DIRECT AND INVERSE MAPPING
Given the definitions provided above, the calculation of the ToU energy bill from a typical load profile provides the direct analytical relationship between the two quantities. Fig. 4 provides a qualitative example of this relationship, while the mathematical details are reported in Section IV. On the other hand, the analysis of measured data shows that it is possible to invert this relationship. For instance, in Fig. 5, three different pairs of energy bills are shown in the x-space, FIGURE 2. ToU tariffs structure adopted in Italy. The central hours of work days are on-peak (tariff F1, in red); early morning and evening of work days (Monday-Friday) and day hours of Saturdays are mid-peak (tariff F2, in yellow); night, Sundays, and major holidays are off-peak hours (tariff F3, in green).

FIGURE 3.
Visual example of the averaging process and creation of a typical load profile in one month. A month-long load profile is first chunked into day-long sequences, which are arranged by day type (in red are the load profiles of all work days, in yellow those of all Saturdays, and in green holidays); then, an average load profile is evaluated for each day type; these profiles are finally put in a sequence to obtain the typical load profile (the blue, continuous line). [The data are from the data set described in Section V]. with the related typical load profiles in the y-space. These have been randomly chosen among the data available in the testing data set (described in Section V) in order to be pair-wise close in the bills space although from different end users. Despite some differences in the instantaneous consumption within the same ToU tariff time span, the profiles that share similar energy bills also share many similarities in the consumption patterns, e.g., the hours of peak and base load, the number of spikes in the consumption, and so on. In the following section, the methods to leverage this inverse relationship to build a model for the prediction of typical load profiles of unobservable end users are described.

A. NOTATION AND BASIC CALCULATIONS
A load profile is represented as a vector: whose elements P h are the average, constant power demand associated with the energy consumption E h in each time step t h , i.e., P h = E h / t h , where t h is one hour; and N h the length of the time series. Given a month-long load profile, it can be chunked into daily sequences, which can be arranged by day type (work days, Saturdays, holidays). We call L j the set of load profiles of all days in the month belonging to day type j. Then, VOLUME 11, 2023 the corresponding average load profilep j can be evaluated, as follows:p j = P j,h h=1,...,N h , where nd j is the size of the set L j , i.e., the number of days in the month of the j-th day type. We call J the set of the three average load profiles in a month. Then, the corresponding typical load profile, y, is represented as follows: Considering N h = 24 and |J | = 3, the length of the typical load profiles is N i = 72. An energy bill is also represented as a vector, whose elements E f are the monthly energy consumption in the three ToU tariffs F1, F2, F3 (N f = 3). Given a typical load profile y the elements E f of the associated energy bill vector x are calculated as follows: where δ f,j is a binary auxiliary variable, defined as follows: whose values, which depend on the hour and type of the day, can be directly obtained from Fig. 2.

B. TRAINING DATA SET
The proposed approach requires a set of energy bills (x) and corresponding typical load profiles (y) pairs. We call these pairs the 'training data set', in compliance with the conventional naming in the field of machine learning. These {x, y} pairs can be obtained from an end user's year-long load profile, by: i. dividing the time series into month-long profiles; ii. repeating the steps in (2), (3) and (5) for each month.
Hence, twelve pairs (one per month) can be obtained from each end user's year-long load profile. Then, the training data set is organized in rows, each corresponding to one of these pairs. Data Normalization: The training data set contains data from heterogeneous end users, so they must be normalized to remove effects related to the total consumption ('magnitude'). Given a pair of x, y vectors, the elements of the energy bill are normalized so that they sum to 1. Hence, the elements Concerning the load profiles, usually min-max [28] or max normalization (e.g., in [37]) are performed to obtain time series values in the range 0-1, or z-standardization to obtain values with null mean and unitary standard deviation (e.g., [18]). In our case, we want to keep the relationship between the typical load profile and energy bill in (5). Therefore, the elementsŶ i of the normalized typical load profile,ŷ, are evaluated as follows: Hence, the resulting normalized typical load profiles have unitary total consumption in the month. When evaluating the normalized vectorsx andŷ, we perform a ''row-wise'' normalization of the training data set so that all samples can be compared with each other. Usually, also ''column-wise'' data normalization is required, to make the different features comparable to each other. This is not the case for the energy bill (and the typical load profile), whose single elements are already comparable with each other.

C. K-NN BASED PREDICTION
The training data set is used to predict the end users' typical load profiles from their monthly bills, by means of a k-NN algorithm. This is a well-known supervised learning method [44]. Unlike other algorithms, it does not have a training phase and it exploits the whole training data set in each prediction. The only parameter of the algorithm is the number of neighbors.
Given the training set of (x,ŷ) pairs, and a vectorx * whose correspondingŷ * is unknown, the algorithm works as follows.
i. Evaluate the distance betweenx * and all thex vectors in the training data set. The Euclidean distance is used. ii. Identify the neighbors, i.e., the elements in the training data set with a smaller distance fromx * . We call the sets of thex and of theŷ vectors of the neighbors, respectively, K x and K y . Their size |K| is equal to the number of neighbors. iii. Evaluate the prediction (ŷ pred ), as the element-byelement weighted average of the vectors in K y , as in (9): whereŷ k is the typical load profile of the k-th neighbor. iv. Setŷ * equal to the predictionŷ pred . This is the basic implementation of the algorithm, in which the neighbors have the same (uniform) weights However, neighbors could also have different weights, e.g., inversely proportional to the distance between theirx vector andx * [45]. Fig. 6 provides an outline of the process that leads to the k-NN-based prediction ofŷ * . After this procedure, y * is obtained by inverting (8), thus restoring the actual magnitude. However, despite the proximity of the neighbors in the x-space, the ''predicted'' energy bill, evaluated applying (5) to y * may not coincide with the original bill in the different ToU tariffs (see Fig. 6).

D. BENCHMARK APPROACHES
We present a general outline of the benchmark approaches against which we compare the proposed one.

1) STANDARD LOAD PROFILES
This method is based on the SLP evaluated for different categories of end users. In particular, we used the SLP adopted by the GSE in [24], defined for two categories, i.e., household and non-household (see Fig. 7). Given an end user with a monthly bill x * , the associated typical load profile y * is evaluated by: i. selecting a standard profile y ref according the end-user category; ii. multiplying the SLP by a scaling factor to match the actual total consumption in the month.

2) CLUSTERING-CLASSIFICATION
The detailed steps of this kind of procedure can be found in works like [13] and [14] and mainly [15], from which we borrowed this method, therefore we present here only an overview of the main steps and of the algorithms adopted for each task. The first step is the extraction of the representative load profiles from the training data set, through a clustering performed in the y-space (i.e., only the typical load profiles, y, are used). We use K-means, a well-known unsupervised learning algorithm that has been recently proven particularly effective in load profiles clustering [34]. The number of clusters is the only parameter of the algorithm. Based on the result of the clustering, the (x,ŷ) pairs in the training data set are divided into classes (i.e., the clusters), each with a representative load profile (i.e., the cluster center). Then, a classifier system can be trained using the elements of the energy billsx as features and the cluster label as targets. This supervised learning task is performed by means of a Decision Tree classifier, as in [15]. At the end of this procedure, a set of rules have been derived, based on which an energy bill can be assigned to one of these classes. When a typical load profileŷ * must be predicted from an end user's energy billx * , a class label is assigned based on the derived decision rules. Then, the cluster center is set as the representative load profile and (8) is inverted to add the magnitude effect so that the total consumption matches the actual energy bill.
In both previous cases, similarly to the proposed approach, while the total energy consumption matches the value in the energy bill, it is not guaranteed that the proportions between VOLUME 11, 2023 FIGURE 6. Graphical outline of the k-NN prediction process in the x and y-spaces (note that only two components of the bill are shown, to allow a two-dimensional representation of the x-space.). First, the training set composed of (x,ŷ) pairs is initialized. A test pair ofx * andŷ * vectors is also shown (normallyŷ * is unknown). To predictŷ pred fromx * , the k nearest neighbors (in the x-space) are evaluated and selected. Then,ŷ pred is evaluated as the element-by-element weighted average of the neighbors (in the y-space).
the different ToU components coincide. The latter depend indeed on the shape of the predicted load profile, which is imposed by the SLP/cluster centers.

E. VALIDATION
We validate our result using a test set of measured hourly consumption data. Therefore, we first predict typical load profiles using the described methods and then compare them with the real ones. Kohler et al. [25] provided an extensive review of metrics commonly used to compare predicted (or synthetic) and real load profiles, focusing on the difference between 'sameness' and 'similarity'. The former is the time step-by-time step equivalence between two time series. For instance, the mean squared error (MSE) and the mean absolute error (MAE) measure the sameness [25]. The similarity is a broader (and looser) concept that can be declined and assessed in different ways. Many metrics proposed in [25] to assess similarity focus on the statistics of the real and simulated profiles (e.g., minimum, median, and maximum values, standard deviation, and error on the duration curve). In the paper, they also propose metrics based on complexity, such as the number of peaks and the fractal dimension.
In this paper, we evaluate the normalized MAE (NMAE) and the Pearson coefficient (r) between the predicted and real load profiles to assess the sameness. We prefer the MAE over other error metrics, such as the MSE, because it directly quantifies the energy consumption that is allocated in the wrong time steps [42]. The r coefficient instead evaluates the linear correlation between two quantities. We also evaluate the ability of the methods to reconstruct the statistics of the data by measuring the NMAE between the duration curves of 60508 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply. [Elaboration of data from [24]].
the predicted and real typical load profiles [25]. We call this metric the duration curve error (DCE).
In all cases, even if we use an artificial profile of 72 hours, we consider the weight of each day type in one month (e.g. there are more work days than Saturdays). As to the NMAE, we perform a weighted average (on the number of days of each day type) of the metric evaluated on the single day type. In the case of the DCE, instead, we evaluate the duration curves of the equivalent month-long load profile by assigning to each day the average load profile of the related day type.
All methods guarantee that the actual total consumption in a month is respected by properly scaling the typical load profile. However, it is not guaranteed that the proportions between the consumption in the different ToU tariffs match the actual one. Therefore, we also evaluate the NMAE between the real and predicted energy bills. Similarly to the case of the load profiles, this metric measures how much of the total monthly consumption is allocated in the wrong tariff by the prediction (more details are reported in Section VI).

V. CASE STUDY
We tested the proposed and benchmark approaches on a data set consisting of 114 end users of different types (i.e., household, DOM, and non-household, BTA), classes (i.e., levels of contractual power, see Table 1), and categories (see Fig. 8). The data were provided by a local energy supplier, who measured the hourly consumption for these end users over a time span of one year. The samples are mostly uniformly distributed among classes (around twelve end users each) and categories. The only exception is represented by the class DOM1, which is composed of only one user. For this reason, we created the class DOM12 by merging DOM1 into DOM2. Fig. 9 shows the statistics of the consumption in the typical load profiles of the end users in all months, divided by classes. In some cases, consumption patterns with good intra-cluster properties can be found in these classes. For instance, in BTA1, BTA4, BTA5, DOM3, and DOM4 the interquartile range (IQR) appears quite narrow and it follows the median value, while in other cases (e.g., BTA2) it is TABLE 1. Codes assigned to the end-user classes according to the type (household, DOM, and non-household, BTA) and level of contractual power at the point-of-delivery defined by the Italian Regulatory Authority for Energy, Networks and the Environment. rather wide. However, even when the IQR is narrow, the extreme values (min, max) can be far from the median and also have different shapes (e.g., BTA1 and BTA4). Finally, Fig. 10 shows the distribution of the three components of the energy bills in the end users, divided by classes. Again, there are cases (e.g., household end users) where the distributions are narrow, but also cases in which they are very dispersed, meaning that end users with very different energy bill composition (hence, consumption patterns) can be found in the same class.
The typical profiles and related energy bills were evaluated from raw data, therefore they have been analyzed in order to eliminate samples with evident inconsistencies or extreme outliers (e.g., time steps in which the consumption was more than five times higher than the average one). This procedure removed about 5% of the original samples: from 114 yearly load profiles, 1368 pairs could be obtained, and 1294 remained after data cleaning.
We used the data set for both testing and training the data-driven approach. Therefore, in order to assess the performance, we reconstructed the data set through a leaveone-out cross-validation [46], where the samples of one end user at a time served as testing while those of the other end users served as training data. Accordingly, the number of folds in the cross-validation procedure is equal to the total number of end users in the data set (i.e., 114, each consisting of around 12 profiles).
We implemented all the methods in Python and exploited the open-source library sklearn [47] for the K-means, Decision Tree classifier, and k-NN algorithms. We identified a number of clusters equal to 11 (for the clusteringclassification approach), and a number of neighbors equal to 9 (for the proposed k-NN) as those minimizing the average error on the predicted load profiles, while we used the default settings from sklearn for the training of the Decision Tree. Fig. 11 shows the distributions of the NMAE between the real and predicted data for the three methods tested. In particular, Fig. 11a shows the NMAE on the ToU components of the energy bill. Thanks to the procedure based on the proximity in the x-space, the k-NN method obtains the smallest error. In the case of the clustering-classification approach, the composition of the predicted energy bill is more ''rigid'' since it depends on the shape of the cluster centers. This effect is more pronounced in the SLP approach, where only two   shapes are possible (household and non-household). Fig. 11b shows the same error metric evaluated on the typical load profiles. In this case, the errors are larger since they are evaluated instantaneously time step by time step. Also in this case, the k-NN shows the best performance, allowing for an error reduction, on average, of 6.5% and 13.8% if compared,  respectively, to the clustering-classification and to the SLP approaches. Fig. 12 shows two different metrics evaluated on the reconstructed yearly load profiles of each end user. Fig. 12a reports the error between the real and predicted duration curves (DCE), while Fig. 12b shows the correlation coefficient between the two load profiles. The former measures the sameness of the statistics of the real and predicted load profiles. Therefore, the DCE is smaller than the NMAE on the typical load profiles. The correlation coefficient instead measures how the real and predicted profiles are linearly correlated. The k-NN approach shows the closest values to 1, which means perfect linear correlation. However, in certain cases, the values of r are significantly smaller than 1.

VI. RESULTS AND DISCUSSION
The radar plots in Fig. 13 show, respectively, the NMAE and r metrics between the real and predicted typical load profiles, divided by end-user classes. In the case of household end users, the performances of the SLP approach are comparable to those of the data-driven ones. However, the SLP reveals to be inadequate to characterize the load profiles of non-household end users, where instead the datadriven approaches, in particular the k-NN, show significantly better performance, comparable to the ones they obtain with the household end users. This means that an SLP is able to characterize the typical load profiles of household end users, where lower within-class variability is found (see Fig. 9). On the other hand, non-residential customers have more diversified consumption patterns, which a unique SLP fails to represent, while data-driven methods can better identify the different shapes based on the energy bill.
The radar plots in Fig. 14, where the NMAE and r are divided by day type, show that all methods perform significantly better on work days than on Saturdays and Sundays/holidays. This can be related to the fact that the consumption in work days is mostly under the ToU tariff F1, which does not appear in other day types. On the contrary, Sundays are completely in ToU tariff F3, which also belongs to night hours of work days and Saturdays therefore, it is more difficult to properly divide the consumption in F3 between the correct time steps.

A. DISCUSSION
The general trend that emerged from the previous results is that data-driven methods can increase the performances of the prediction of typical load profiles from the ToU energy bill, with respect to SLPs. In fact, they can map the similarity   between bills (x) to the similarity between consumption patterns (y). This is particularly true for non-residential end users. Between the two ways of tackling the problem, i.e., the clustering-classification approach that creates a discrete mapping between the x and y-spaces, and the k-NN approach that tends to create a continuous mapping, the latter shows the best performances. As to the different metrics analyzed, worse performances are obtained when comparing the real and predicted data time step by time step, as opposed to the comparison between the statistics of the consumption or the ''coarse'' granularity data of the ToU bills. Concerning the latter comparison, it should be noted that more sophisticated scaling procedures could be implemented to guarantee that the predicted consumption in each ToU tariff matches the actual one (see for instance [48]). However, these procedures scale the profile with a different factor for each ToU tariff, and therefore they can introduce a distortion of the shape of the predicted load profile. In particular, they can give rise to unrealistic changes in consumption in the hours on the interface between different ToU tariffs.

B. LIMITATIONS AND FURTHER IMPROVEMENT
The proposed approach allows the prediction of typical load profiles from minimal data that can be easily obtained for a large number of customers, independently from the category of end users. In general, thanks to the k-NN regression, we obtained an average error of less than 4% on the monthly consumption in the different ToU tariffs and of around 26% on the predicted typical load profiles. This means that a quarter of the total consumption is allocated in the wrong time step. The smallest errors are obtained in the prediction of load profiles during work days, which are more frequent than other day types. It is up to the final user of the method to decide whether the compromise between accuracy and ease of data collection is acceptable. However, the proposed approach leaves room for further improvement. In particular,  given the size of our test data set, we deployed a single model for all end-user categories and all months/seasons. Different k-NN regressions could be used to predict the typical load profiles of end users from different categories/seasons when a richer data set is available (so to cover uniformly the spaces of the energy bills and typical load profiles). It should be noted that the further loss of detail related to the use of typical load profiles is not considered here. Finally, the methods have been tested on a set of end users located in the same geographical area, thus temperature-related effects are compensated by similar weather conditions. It is still to be assessed whether a single model or more models (hence, more data set) are needed to work with end users of different regions. Nonetheless, we believe that the proposed method provides a valid option for the prediction of a large number of different end users' load profiles when few input data are available.

VII. CONCLUSION
In this work, we proposed a data-driven approach to predict load profiles in typical days (work days, Saturdays, holidays) for end users of heterogeneous categories, and from few and easy-to-collect input data. In particular, we proposed a method that predicts typical load profiles based on the similarity between monthly time-of-use energy bills, using a k-nearest neighbors algorithm. We assessed the performances of the proposed method in comparison to two benchmarks: an approach based on Standard Load Profiles and a data-driven method based on the identification of similar load profiles (clustering) and of decision rules to assign new customers to one cluster, hence to its representative load profile, based on their time-of-use energy bill (classification).
All methods allow the prediction of typical load profiles of end user of different categories from a few input data (i.e., only the monthly bill). The results obtained on a data set of measured hourly consumption show that the methods have poorer performances on error metrics evaluating the sameness of the predicted load profiles to the real ones, while better performances are achieved in the error metrics that measure the statistics of the consumption (e.g., duration curve). The results also highlight that the proposed method outperforms the other ones basically in all error metrics and for each end-user category (with few exceptions).
In future works on the load profile prediction from electricity bills, the analysis of the results can be deepened both in terms of diversity of the similarity/sameness metrics and in terms of benchmark methods to further assess where the proposed method stands in terms of the trade-off between accuracy and ease of data collection. Furthermore, the adoption of multiple k-NN models to be used for different end-user categories and/or different seasons can be explored, if richer data set are available. Furthermore, it should be noticed that in this work we preferred to utilize well-known and easily-interpretable methods for our analysis. However, different and more advanced methods from the field of machine learning [38] could be explored to better assess the potentiality of the proposed approach.

DATA AND CODE AVAILABILITY
The processed data set used for training and testing the proposed and benchmark approaches is available at: https://github.com/cadema-PoliTO/Bill2Watt under CC-BY-NC 4.0 License. Upon publication, the code will eventually be made available under CC-BY-4.0 License at the same address.