. Model Predictive Control is an energy ecient climate control strategy in buildings. However, the e ort associated with physics-based modelling seems to prevent widespread application in residential buildings. Applying machine-learning algorithms on historical data promises ecient generation of predictive models for control. In a recent experimental study, Data Predictive Control based on random forests and linear models outperformed a baseline controller during cooling season. In this paper, the approach is benchmarked against hysteresis control and conventional Model Predictive Control based on an RC-network model during heating season. Data Predictive Control shows promising results in terms of energy consumption and thermal comfort. 1. Introduction Model Predictive Control (MPC) is a well-established optimal control strategy. Several studies demonstrated its potential to reduce energy consumption without sacri cing thermal comfort in buildings [1, 2]. However, MPC is still not widely used in residential buildings, partly because of the e ort associated with the development of physics-based models [2]. Data-driven models could be an alternative to physics-based models as operational building data becomes more available thanks to the digitalization of the building sector. To be suitable for MPC, data- driven models need to achieve reasonable prediction accuracy while being simple enough to be used in an online optimization scheme. MPC with data-driven models is often called Data Predictive Control (DPC). Arti cial Neural Networks (ANN) have been used for various applications including MPC in buildings [3]. However, as ANN are generally non-linear in their nature, they have two main disadvantages. Foremost, there is no guarantee that an optimal solution is found within a feasible time when solving the MPC optimization problem. Furthermore, the computational cost to solve non-convex programs is signi cantly higher than that of convex programs. In [4], DPC based on Input Convex Neural Networks (ICNN) was deployed. Convexity in ICNN models is achieved by constraining the network parameters, structure, and activation functions. In [5], an approach based on regression trees (RT) and linear regression was introduced to solve a demand-response problem with DPC. By combining RT and linear regression, the model stays linear for a given disturbance with respect to the decision variables. In [6], the approach was further developed by using random forests (RF) instead of single RT which allows one to reduce the variance in the predictions. In [7], we adapted the DPC approach based on RF and linear models and deployed it in a real-life apartment during cooling season. Most studies about DPC are simulation-based while the study in [7] is conducted during the cooling season and does not compare with MPC. In this paper, DPC based on RF combined with linear models is applied in the real-life apartment Urban Mining & Recycling (UMAR) of the NEST demonstrator at Empa D ubendorf, Switzerland, during the heating season. Using the same models as in [7], we demonstrate the exibility of the approach to be applicable in the heating and cooling season. Furthermore, in four experiments we benchmark the DPC with a hysteresis controller (HC) and an MPC based on an RC-network model. The remaining article is structured as follows. In Section 2, the concept of MPC, and the applied modelling techniques are explained. In Section 3, the residential apartment used for the experiments is introduced and the controller setup is de ned. In Section 4, the performance of the DPC is compared to HC and conventional MPC in terms of comfort constraint violations and energy usage. In Section 5, the study is concluded and an outlook of future research directions is given. 2. Methodology 2.1. Model Predictive Control MPC is an optimal control strategy, where a sequence of optimal control inputs ufor a prediction horizon Nis calculated by minimizing a cost function while satisfying the system dynamics, state and input constraints. The optimization is executed repeatedly at discrete time steps kwhile only the rst optimal control input u kis applied to the system. Such an optimization scheme can be written as minimize x; uN1X j=0J(xk+j+1; uk+j; k+j+1) (1a) subject to xk+j+1=f(xk+j;uk+j;dk+j) (1b) (xk+j+1; uk+j)2XU (1c) 8j2[0; :::; N1]; wherex,u, anddare the states, inputs, and disturbances, respectively. The slack variable , which relaxes the state constraints, makes the optimization problem feasible at all time. To have theoretical guarantees for obtaining an optimal solution, the optimization problem in equation (1) must be convex, i.e. the cost function and constraint sets must be convex. The system modelling methods described in the following two sections ful ll this convexity requirement. 2.2. Random forest and linear regression model For DPC, we apply a modelling approach for the system dynamics in equation (1b) based on RF and linear regression, which was adapted in [7] from the original work of [6]. The introduced modelling process is separated into two steps. First, the RF is trained considering the non- controllable inputs Xd(e.g. weather conditions, past and current room temperatures, time variables). Afterwards, a linear model is tted for every leaf of all ntreetrees in the RF based on the corresponding data sets. By that, the model Y=fRF(Xd;Xc) is a linear function of the controllable inputs Xcfor a given disturbance Xd. For application in the MPC problem of equation (1), a model is trained for each step of the prediction horizon N. The online optimization is also separated into two steps. First, the non-controllable inputs Xdare fed to the RF to obtain the corresponding leaves and linear functions. Subsequently, the linear models are included in the optimization problem of equation (1b). For more details about the approach, the reader is refered to the original sources [6, 7]. 2.3. Resistor-capacitor network model The linear state-space model used in MPC is derived from the rst law of thermodynamics. The dynamics of the temperature Tof a single room can be described by mcpdT dt=X_Q; (2) wheremis the mass, cpthe speci c heat capacity, and _Qthe in- and outgoing heat ows. Here, we take into account heat ows between the room and the ambient _Qamb, the room and adjacent rooms _Qadj, gains from solar irradiation through the window _Qsoland from the heating system _Qheat. Internal gains caused by occupants and appliances are assumed to be negligible. _Qamb and _Qadjcan be expressed by a linear function of the form _Qamb=adj = (Tamb=adjT)=Ramb=adj withRbeing the thermal resistance between the two reservoirs. _Qsolis described by _Qsol= Awinsin(  0)cot( )1Ihor, whereAwinis the window area, the azimuth angle and the elevation angle of the sun, respectively, while 0denotes the orientation of the window and Ihorthe global irradiation measured on a horizontal surface. Gains from the heating system are calculated by _Qheat= _mcp(TsTr) with the mass ow _ m, supply and return temperature Ts andTr, respectively. By substituting these equations into (2), and applying time discretization, we obtain the system model to be used in equation (1b) Tk+1= kTk+ ambTamb+ adjTadj+ sol_Qsol+ heat_Qheat; (3) where the coecients  are estimated with least-squares regression on historical building data. 3. Case study 3.1. Experiment setup The residential apartment UMAR in the NEST demonstrator o ers a real-life test environment for new building technologies [8]. Figure 1 illustrates the oor plan of UMAR with its south- east facing, panoramic windows, and the adjacent oce SolAce. UMAR is equipped with N Bedroom I Living room Kitchen Bathroom II Bathroom I Entrance Bedroom II Utility room SolAce Figure 1. Floor plan of the residential apartment UMAR and the adjacent oce SolAce. water-based, radiant ceiling panels that can be used for heating and cooling. The mid- and low-temperature network of NEST supplies UMAR with the corresponding thermal energy via heat exchangers. With binary valves the heat distribution to the designated rooms can be controlled. Information about the building operation is collected through various sensors (e.g. temperature, humidity, etc.). These historical data and weather forecasts provided by Meteo Swiss are accessible from an SQL database via a REST API. The actuators in the building (e.g. valves) can be oversteered for research purposes via an OPC UA client. In our case study, we consider the two bedrooms only. Both bedrooms have identical oor area, window size and orientation, furniture, and heating equipment which allows for comparing di erent control strategies with limited systemic error sources. The only signi cant di erence between the two bedrooms is the adjacent oce SolAce next to bedroom II. SolAce acts as an improved insulation of the corresponding wall which causes a reduced heat demand in bedroom II. To address this issue, each experiment is executed twice switching the controllers after the rst experiment. 3.2. Controller setup Historical data generated by a rule-based controller over 10 months is used to train the RF-based and the RC-network model. As inputs Xdfor the RF training we take autoregressive terms and forecasts of the ambient temperature and the solar irradiation, autoregressive terms of the room temperature gradient and the temperature di erence to the adjacent rooms, the time of day and month of the year encoded with sine and cosine functions. Each RF consists of ntree= 200 trees with a minimum of 200 data samples per leaf. For both the DPC and MPC, a prediction horizon of 6 hours is applied with a sampling time of 30 minutes for DPC and 10 minutes for MPC, respectively. The sampling times for DPC and MPC were optimized with respect to the prediction accuracy during model validation. For Jin equation (1a) the quadratic stage cost functionJ=uk+jRuk+j+k+j+1withR= 1 and= 100 is chosen for DPC and MPC. The lower and upper comfort constraints are set at 23 °C and 25 °C, respectively, during the day (i.e. from 06:00 to 22:00). During the night the lower comfort bound is relaxed to 22 °C. The HC uses the same lower boundary as the DPC, while the upper boundary is 1 °C higher than the lower boundary, i.e. a hysteresis of 1 °C. 4. Results 4.1. DPC vs HC In a rst step, the DPC approach based on RF and linear models is compared to HC that acts as a benchmark. Figure 2 shows in the top plot the temperature trajectories of the DPC controlled room in solid blue and the HC controlled room in dashed orange. In the second plot, the control inputs are shown. The third plot depicts the cumulative energy consumption of each of the two rooms. The bottom plot shows the ambient temperature and solar irradiation over the course of the experiments. Initially, the DPC was implemented in bedroom I and HC in bedroom II (2019-11-06 to 2019-11-11). Subsequently, the arrangement was switched (2019-11- 15 to 2019-11-18). The rst gray shaded area on 2019-11-07 marks a period with open blinds in bedroom II while the ones in bedroom I were closed. Hence, the temperature of the room controlled by HC increased faster due to higher solar gains. The second gray shaded area on 2019-11-16 again depicts a situation where the blinds were open in bedroom II while the ones in bedroom I were closed resulting in higher solar gains for the DPC controlled room. During the third gray shaded area on 2019-11-17, the windows were open for a short period in both bedrooms simultaneously causing a sharp drop in room temperatures. In the rst experiment, the room controlled with DPC consumed 2.4% less energy than the room controlled by HC even though the bedroom II had higher solar gains. The cumulative constraint violations were 83.1% lower in the DPC controlled room than in the HC controlled one. After the change-over the DPC controlled room needed 50.7% less heating energy than the HC controlled room while the cumulative constraint violations were 42.4% lower. One notes that the constraint violations of the HC controlled rooms are mainly caused by a lack of predictability of changes in comfort constraints. The large di erence in energy savings between the two experiments is explained by the lower heat demand of bedroom II due to the adjacent oce SolAce. However, the energy consumption was reduced with DPC in both experiments while the thermal comfort was even increased. 22232425Troom [°C]DPC HC Constraints Ambient temperature Solar irradiation 0.00.51.0u [] 0.00.51.0u [] 11-06 1211-07 0011-07 1211-08 0011-08 1211-09 0011-09 1211-10 0011-10 1211-11 00 Timestamp [mm-dd hh]0510Tamb [°C] 11-16 00 11-16 12 11-17 00 11-17 12 11-18 00 11-18 12 Timestamp [mm-dd hh]0200400 Qsolar [W m2] Figure 2. Room temperature (1st), control input (2nd), cumulative control input (3rd), ambient temperature, and solar irradiation plots (4th) from benchmarking DPC against HC. 4.2. DPC vs MPC In a second set of experiments DPC was compared to MPC that acts as a benchmark. Figure 3 shows the signals analogous to Figure 2 with the di erence that MPC is marked in dashed green. First, DPC was implemented in bedroom II and MPC in bedroom I (2020-01-18 to 2020-01-28) and subsequently switched (2020-01-30 to 2020-02-09). During the experiments the blinds were open several times in both bedrooms on sunny days, as can be observed by the peaks in room temperature for example at noon on the three days 2020-01-19 to 2020-01-21. However, since the blinds were open in both rooms simultaneously the results are not a ected by these disturbances. As the control system is not able to in uence upper constraint violations directly (e.g. by closing the blinds), only lower constraint violations are considered in the performance evaluation. Marked gray, on 2020-01-24 and 2020-02-04 the communication to the actuators was interrupted. During this time a backup thermostat controller took over. Consequently, these periods are excluded in the performance evaluation. In the rst experiment, the room controlled with DPC consumed 21.4% less heating energy while the cumulative lower constraint violations are 23.4% lower than in the room controlled by the MPC. In the second experiment, the room controlled by MPC required 49.9% less heating energy than the room controlled by DPC. The large di erence in energy consumption is again explained by the lower heat demand of bedroom II. However, MPC also saved heating energy by staying closer to the lower bound as shown in the second experiment on 2020-02-02 and 2020-02-03 for example. Moreover, the MPC model predicts the in uence of the heating system more accurately resulting in a better timing to start heating which can be observed on 2020-02-01. The lower comfort constraints are met almost equally well by the DPC (0.08 Kh) and MPC (0.74 Kh) over the course of the second experiment. Altogether, DPC achieved a performance in these two experiments which comes close to the one of MPC in terms of energy consumption and thermal comfort. 22232425Troom [°C]DPC MPC Constraints Ambient temperature Solar irradiation 0.00.51.0u [] 0.00.51.0u [] 01-1801-1901-2001-2101-2201-2301-2401-2501-2601-2701-28 Timestamp [mm-dd]010Tamb [°C] 01-3001-3102-0102-0202-0302-0402-0502-0602-0702-0802-09 Timestamp [mm-dd]0250500 Qsolar [W m2] Figure 3. Room temperatures (1st), control inputs (2nd), cumulative control inputs (3rd), ambient temperature, and solar irradiation (4th) from benchmarking DPC against MPC. 5. Conclusion In this paper, we applied DPC based on RF and linear models in a real-life apartment during heating season. By that, the exibility of using the approach also during heating season was demonstrated. DPC outperformed HC in terms of heating energy consumption and thermal comfort in two experiments. In another two experiments, DPC achieved a performance close to that of conventional MPC based on an RC-network model. Further studies aim at conducting a large scale eld test with DPC in order to get statistical evidence of the promising performance.