Skip to content

Predict a home's appliance energy use ​

An energy manager who knows how much electricity the appliances of a building use, and when, can plan around it: shift loads, size a contract, or notice when use is far from what the conditions suggest. This guide trains a Fione model that predicts the energy used by the appliances of one house in each 10 minutes, from the readings of the house's sensors, the weather and the time. It goes from the download of an open dataset to a curl call of the served model.

This is an advanced guide. It is a regression, like the bike rental guide, which explains Fione's rating for numbers and how Order of the rows in time checks each model on later rows; read that first. This page shows what is new here: readings every 10 minutes, a model that ends up only a little better than a simple guess, and two random columns that the dataset's authors added on purpose, which show how far to trust a list of important inputs. Starting Fione from the published images and the general serving steps are in the practical guides overview.

The business question ​

In the data used here, the appliances of the house used between 10 and 1,080 Wh in 10 minutes, and half of the readings are 60 Wh or less (an average of 360 W over the 10 minutes). Use is low at night (48 Wh on average at 3:00) and highest in the early evening (190 Wh on average at 18:00), with short spikes: 1.5% of the readings are 500 Wh or more. A manager who can predict the use of each 10 minutes can act on it:

  • plan the expected load of the coming hours and days;
  • notice periods when use is far above what the conditions in the house suggest;
  • compare what a model expects with what the meter later shows.

The model trained here uses readings of the same 10 minutes, which serves the second and third; for the first, a forecast can only use what is known ahead, which a third run tests.

The model answers one question per 10 minutes: how many Wh will the appliances use? It returns a number, such as 76 Wh for midnight on a Friday in May.

Get the data ​

The data is the Appliances Energy Prediction dataset in the UCI Machine Learning Repository:

Attribution (UCI's citation): Candanedo, L. (2017). Appliances Energy Prediction [Dataset]. UCI Machine Learning Repository. https://doi.org/10.24432/C5VC8G. The UCI page names the paper that introduced it: L. Candanedo, V. Feldheim, Dominique Deramaix, "Data driven prediction models of energy use of appliances in a low-energy house", Energy and Buildings, Volume 140 (2017). It also links the authors' repository, https://github.com/LuisM78/Appliances-energy-prediction-data, with a description of the columns and their R scripts.

What we changed: we set the readings from 20 May 2016 on aside to try predictions on (see Prepare the CSV); no value was changed.

In an empty directory:

sh
curl -sSLO https://archive.ics.uci.edu/static/public/374/appliances+energy+prediction.zip
unzip appliances+energy+prediction.zip

The zip (11,979,507 bytes) holds one file, energydata_complete.csv (11,979,363 bytes): a comma-separated text file with Windows line endings, a header and 19,735 rows, 29 columns and no empty cells. Every field is in double quotes, and many numbers are padded with spaces inside the quotes or written with an exponent, such as " 60" and " 6.5999999999999996e+00". Fione reads them as numbers as they are: Data analysis shows 60 and 6.6.

The data ​

According to the UCI page, the rows are readings of a house every 10 minutes for about 4.5 months. Temperature and humidity were measured in the rooms by wireless sensors and averaged over each 10 minutes; the energy was logged every 10 minutes by meters; and the weather of the nearest airport station (Chièvres, Belgium), "hourly data (then interpolated)", was added by date and time. In the file, the readings run from 17:00 on 11 January 2016 to 18:00 on 27 May 2016, every 10 minutes without a gap.

ColumnWhat it holds
dateThe date and time, such as 2016-01-11 17:00:00
AppliancesThe answer: the energy used by the appliances in the 10 minutes, in Wh
lightsThe energy used by the light fixtures, in Wh
T1 to T9, RH_1 to RH_9The temperature (°C) and humidity (%) of one place each: kitchen, living room, laundry room, office, bathroom, outside on the north side (T6, RH_6), ironing room, a teenager's room and the parents' room
T_out, Press_mm_hg, RH_out, Windspeed, Visibility, TdewpointThe weather station: outside temperature (°C), pressure (mm Hg), humidity (%), wind speed (m/s), visibility (km) and dew point (°C)
rv1, rv2"Random variable 1" and "Random variable 2" (see below)

Appliances averages 98 Wh, with 79% of the readings at 100 Wh or less. The first reading of the file, as it is written:

csv
"date","Appliances","lights","T1","RH_1","T2","RH_2","T3","RH_3","T4","RH_4","T5","RH_5","T6","RH_6","T7","RH_7","T8","RH_8","T9","RH_9","T_out","Press_mm_hg","RH_out","Windspeed","Visibility","Tdewpoint","rv1","rv2"
"2016-01-11 17:00:00","  60","30","19.890000000000001","47.596666666666700","19.199999999999999","44.789999999999999","19.789999999999999","44.729999999999997","19.000000000000000","45.566666666666698","17.166666666666700","55.200000000000003"," 7.026666666666669947","84.2566666666667032","17.199999999999999","41.626666666666701","18.199999999999999","48.899999999999999","17.033333333333299","45.530000000000001"," 6.5999999999999996e+00","733.50000000000000"," 92.000000000000000"," 7.00000000000000000","63.0000000000000000"," 5.2999999999999998e+00","13.2754331571049988270","13.2754331571049988270"

Before training, look at three things.

First, rv1 and rv2. The UCI page says: "Two random variables have been included in the data set for testing the regression models and to filter out non predictive attributes (parameters)." They are random numbers between 0 and 50, unrelated to the house. They are not two different columns, though: in every row of the file, rv2 holds the same value as rv1. The authors' R script in the repository shows how they were made: each was drawn with runif between 0 and 50, after set.seed(1) both times, which gives the same numbers. Keep both checked: they are the test this guide uses in Read the results.

Second, when each value is known. Whether to keep a column depends on two things: is the value known at the moment you predict, and is it computed from the outcome? The sources describe the other columns as separate measurements (a meter, the room sensors, the weather station), not as values computed from Appliances, and Fione flags none of them. But lights and the room readings are measured over the same 10 minutes as the answer, so a model that uses them estimates the use of a period from the conditions of that same period: it does not forecast. The weather columns also describe the period itself; for a forecast you would only have a weather forecast. Some room readings may also move because of the appliances themselves (cooking may raise the kitchen's humidity, RH_1); that is our reading, not something the sources say. This guide keeps every column, and then compares it with a model that only uses what can be known ahead: the time and the weather.

Third, the order in time. As in the bike rental guide, the model will predict readings later than the ones it learns from, and this guide tells Fione to check each model on later readings. With readings every 10 minutes it matters even more: a reading checked at random sits between the readings 10 minutes before and after it, which the model has usually learned from and which are nearly the same.

Prepare the CSV ​

energydata_complete.csv needs no conversion. Check it has 19,736 lines:

sh
wc -l energydata_complete.csv

Then keep the last days apart, so that you can later predict readings the model never learned from: the header and the 1,117 readings from 20 May (a Friday) to 27 May 2016 in new-readings.csv, and train on the other 18,618 readings, 11 January to 19 May, in train.csv:

sh
grep -v '^"2016-05-2' energydata_complete.csv > train.csv
{ head -n 1 energydata_complete.csv; grep '^"2016-05-2' energydata_complete.csv; } > new-readings.csv

The readings set aside are the last rows of the file, later than every reading the model learns from. Keep Appliances in both files: the predictions page shows that the model does not use it, and you can compare each prediction with what happened.

Train the model ​

As for the bike rentals, Order of the rows in time is on Training settings, not on the guided Data analysis page.

  1. On Projects, create a project (we named it energy-consumption) and open it.
  2. Press Upload training data, choose train.csv and press Upload and analyze. Data analysis shows 18,618 rows, 29 columns and 0% empty cells.
  3. Choose Detailed under View in the account menu (your name, top right), then follow Advanced settings: every training parameter on Data analysis. Training settings opens.
  4. Under Column to predict, choose Appliances. Fione says "The values to predict are 0 or more and skewed. If your score is a relative error (such as RMSLE), set "Learning the target" to Logarithm."
  5. Under Prediction type, choose Regression.
  6. Under Which columns should the model learn from?, Fione has checked all 28 other columns and flagged none. It reads date as Date, lights as Category and the others as Number; in the file, lights holds only 8 different values, 0 to 70 in steps of 10. Leave them all checked, rv1 and rv2 included.
  7. Under Maximum run time (minutes), enter 10. Fione starts at 3, its recommendation for this size of data.
  8. Under Order of the rows in time, choose date.
  9. Keep Learning the target at As it is: we judge the model by its error in Wh.
  10. Press Start training.

Training settings for train.csv, with Appliances to predict, Regression, all 28 other columns checked, a maximum run time of 10 minutes and date as the order of the rows in time

Order of the rows in time is explained under the field: "Choose a column of dates or numbers that orders the rows in time to check each model on later rows than it learned from, as when predicting the future. The earliest part is only learned from, and derived features are not tried. When other inputs move with time too (a day number, a year), the column's own number, or the year and the seconds of a date, are not used as inputs; a notice says so." So the checked Add derived features further down does not apply to this run. In our run, the training job's page (Training job on the Overview tab of Open advanced details, then See details) listed what the setting did:

validating on 5 later parts of the data in order of 'date'; the first part is only learned from. It holds 3,103 rows (22 days), and each validation part holds 3,103 rows (22 days)

'date', the column that orders the rows in time, is not read as a number (or as the year and the seconds of a date): the rows to predict are later than all the rows the model learns from, so it would read their values as the latest period it knows. The inputs 'RH_6', 'T7', 'T9' move with it and carry the level over time

So the 129 days were cut, in date order, into 6 parts of 3,103 readings (about 22 days each), and each later part was predicted by models that learned only from the parts before it. The model does not use the running date; it reads the calendar and the clock in date (in Fione's code, the month, the day, the day of the week and of the year, the week and the hour; not the minutes: in our run, the same reading dated 0:00, 0:10 and 0:50 gave the same prediction).

Read the results ​

The Prediction summary of our run: 1 out of 5, typically off by about 88.4 against 102 for always guessing the average, with RH_1, T3 and RH_2 at the top of the most useful inputs

In our run:

  • Rating: 1 out of 5. "On rows it did not learn from, the model's predictions were typically off by about 88.4. Always guessing the average would be off by about 102."
  • Guide: "This model could not beat a simple guess yet. Check that the column to predict is the right one and that the input columns relate to it, then run again."
  • About this model: a blend of 4 models, 196 models tried, training time 5:46.
  • Most useful inputs: RH_1 13%, T3 12%, RH_2 10%, date 9%, lights 7%.

The rating is 1 − 88.4 / 102 ≈ 0.13, below the 0.2 of a second star (the bike guide explains the formula). The guide's text is the one Fione shows for every 1-star model (in Fione's code, it is chosen by the number of stars): this model does beat always guessing the average, but takes away only about 13% of its error. Press Open advanced details and open the Metrics tab, measured here "From the cross-validation predictions of 15,515 training rows." (all but the first part):

  • RMSE 88.4 Wh: the typical error, which large misses weigh heavily.
  • MAE 51.2 Wh: on average, the prediction for 10 minutes was about 51 Wh off.
  • Median absolute error 32.0 Wh: for half of the readings, the prediction was within 32 Wh.
  • R² 0.17: the model explains 17% of the variation.

The gap between these figures is the story of this data. Most readings are low and close to each other, and the model predicts them roughly; the short spikes, a few hundred Wh in one reading, are not foreseen from the time, the weather or the room readings, and they make the RMSE large. The Residuals part of the tab shows it: the largest errors, several hundred Wh, are all readings the model predicted too low (actual − predicted reaches over +700 Wh, against about −150 the other way).

Most useful inputs is captioned "The columns that moved the predictions most, as a share of all the columns' effect." Fione works this out on its own shortly after training (about 3 seconds after it in our run), by explaining the model's predictions on rows of the training data. Humidity in the kitchen (RH_1) and the living room (RH_2) and the laundry room's temperature (T3) come first, then date and lights. Until that explanation is done, the summary shows a different list instead, captioned "The columns the model relied on most, as a share of all it used." and based on the training's own measure; that list stays on the Importance tab, where date comes first with 55%, then lights with 8% and T3 with 5%. The two lists rank the inputs differently; the explanations guide says how each is computed.

What the random columns say ​

The summary lists 5 inputs, and the Importance and Explain tabs list 20. rv1 and rv2 are in neither: of the 28 inputs, they came 27th and 28th in both measures. In the share of the effect, rv2 had 0.47% and rv1 0.42%; in the training's measure, 0.17% and 0.15%. On the Explain tab, under How the prediction changes with one input, the Column list holds every input, with rv2 and rv1 at its end. The whole list with its shares is in the stored explanation that the REST API returns.

What this tells you:

  • A column of pure noise still gets a share above 0: on the rows it learns from, a model can find some pattern even in random numbers. Here it was under half a percent.
  • The inputs just above the random columns are not shown to be better than noise. Here Visibility came 26th, with 0.59% (0.25% in the training's measure), close to the random columns. That does not prove visibility is useless, but this run does not show that it helps.
  • The two random columns are identical, yet they got different shares. A share is not a precise measurement; we read the difference as two copies of one column splitting its effect between them in no fixed way.
  • The order can change from one run to another. In the comparison run below (the one whose check shuffles the readings), rv1 came 26th of 28 in the share of the effect (1.3%), above Visibility (1.1%), and 25th in the training's measure (1.8%), above T9 and Visibility; rv2 stayed last.

So before acting on an input's place in the list, for example to add or remove a sensor, compare it with a column you know is noise. If your data has none, you can add one yourself, as the authors did.

What the order in time changes ​

To see what the order in time changes with readings every 10 minutes, we trained a second model on the same train.csv, with the same inputs and run time, but with Order of the rows in time left at Not in time (shuffled parts). Its training job said: "'date' holds dates, and no time_column is given, so the validation shuffles the rows. If the model will predict rows later than the ones it learns from, the score is probably better than it will be; name that column as time_column to validate on later parts". Without a time column, Fione also tries derived features (it added some here) and, in Fione's code, reads the year and the seconds of date too. That model got 2 out of 5: "typically off by about 67.7" (MAE 33.2), with the guide "The model is a little better than guessing. More rows, more useful columns or a longer run may help."

On the readings of 20 to 27 May, which neither model learned from, the shuffled model was off by 113 Wh typically (RMSE) and 87 Wh on average (MAE). Always guessing the training average of 97 Wh would have been off by 110 and 61: the shuffled model did worse than that guess, and predicted 153 Wh on average for readings that averaged 110. Its summary had said 67.7. The model trained above had said 88.4, and was off by 104 (MAE 55) on the same readings: a little better than the guess, as its summary said. So in our run, the shuffled check promised a model better than the average and delivered one that was worse. One week is one check; still, for readings this close in time, judge a model by the order in time.

A model on what is known ahead ​

To see what the readings of the house add, we trained a third model like the first (order in time, 10 minutes), but with only date, the six weather-station columns, rv1 and rv2 checked: what a forecast could know in advance, if the weather were forecast. It got 1 out of 5: "typically off by about 89.5" (MAE 51.4), against 88.4 with every column. Its most useful inputs were date 66%, Press_mm_hg 7%, Windspeed 6%, T_out 5% and Tdewpoint 4%; rv1 and rv2 came 8th and 9th of 9. Without the house's columns that had moved with the date, its job gave no notice about date this time; in Fione's code, date is then also read as its seconds (and its year, which is 2016 throughout). On 20 to 27 May it was off by 100 Wh typically and 51 on average, about the same as the model with every column (104 and 55). In our run, then, the 19 columns measured at the house (lights, the rooms and the north side outside) hardly helped: the time and the weather gave about as good a prediction. This model used the recorded weather, not a forecast; with a forecast it is likely to do less well; how much depends on how good the forecast is.

Make predictions ​

Predict the 1,117 readings you set aside:

  1. On the Prediction summary, press Make predictions.
  2. Choose new-readings.csv and press Upload. Fione says "“new-readings” (1,117 rows) has every column the model needs. Choose what to put in the result." and marks Appliances as Not used by the model. Keep it checked under Columns in the result, to compare each prediction with what happened.
  3. Press Predict. Predictions shows 1,117 rows × 30 columns and Download predict_new-readings.csv.

The file's quoted, space-padded values are read as numbers here too. predict is the predicted use of the 10 minutes. Some of the 1,117 rows in our run, by their place in the file:

RowDate and timeDaypredict (Wh)Appliances (what happened, Wh)
12016-05-20 0:00Friday7640
1092016-05-20 18:00Friday11990
2032016-05-21 9:40Saturday96790
5412016-05-23 18:00Monday111160
9652016-05-26 16:40Thursday116850

Over the 1,117 readings, the prediction was off by 55 Wh on average (MAE), by 104 typically (RMSE), and within 31 Wh for half of them; always guessing the training average would have been off by 61 and 110. The predictions stayed between 70 and 141 Wh: 70 readings were 300 Wh or more (461 Wh on average), and for them the model predicted 111 Wh on average. Added up over the 8 days, it predicted 110 kWh against 122 kWh used, about 10% too low; per day, from 40% too low (Saturday 21 May) to 45% too high (Friday 20 May). Through the day, it predicted too much at night and too little in the late morning and the late afternoon. So read this model as an estimate of the usual level, not of the spikes: nothing in its inputs says when someone will start the oven or the washing machine.

Under the table, Why these predictions shows, for the first 5 rows, the columns that moved each prediction most, in Wh. For row 1 (midnight on Friday 20 May) it starts from an average prediction of 98.9; date lowers it by 17.1, T3 (24.5) raises it by 14.9, T9 (22.6) lowers it by 6.4, RH_1 (41.29) raises it by 4.3 and lights (0) lowers it by 3.7; the other 23 columns together lower it by 14.5, ending at 76.5 (the figures are rounded).

Serve it as an API ​

Under Serve it from your own system, press Download the serving bundle. Unpack it into a directory of its own and run the command shown on the card there, as in the overview. Use the name of your file; for our model:

sh
unzip fione-serving-Appliances-model-2026-11-28-11-04-24.zip -d fione-serving-Appliances-model-2026-11-28-11-04-24
cd fione-serving-Appliances-model-2026-11-28-11-04-24
docker run --rm -p 8081:8080 -v "$PWD/model:/model:ro" ghcr.io/codelibs/fione-serving:snapshot

In another terminal, ask which columns the model expects:

sh
curl -s localhost:8081/model
json
{"names":["date","lights","T1","RH_1","T2","RH_2","T3","RH_3","T4","RH_4","T5","RH_5","T6","RH_6","T7","RH_7","T8","RH_8","T9","RH_9","T_out","Press_mm_hg","RH_out","Windspeed","Visibility","Tdewpoint","rv1","rv2","Appliances"],
 "domains":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],
 "responseColumn":"Appliances","category":"Regression","nclasses":1,"nfeatures":28, ...}

The model needs all 28 inputs, rv1 and rv2 included: a row without rv2 gave an error ("missing columns: ['rv2']"). Send rows 1 and 109 of new-readings.csv, midnight and 18:00 on Friday 20 May 2016:

sh
curl -s -X POST localhost:8081/invocations -H 'Content-Type: application/json' -d '{"instances":[{"date":"2016-05-20 00:00:00","lights":0,"T1":23.29,"RH_1":41.29,"T2":21.68,"RH_2":41.79,"T3":24.5,"RH_3":39.29,"T4":23.1,"RH_4":40.59,"T5":22.2128571428571,"RH_5":59.88,"T6":9.46,"RH_6":38.3,"T7":23.0,"RH_7":36.59,"T8":24.04,"RH_8":44.798,"T9":22.6,"RH_9":42.9666666666667,"T_out":10.6,"Press_mm_hg":757.7,"RH_out":86.0,"Windspeed":3.0,"Visibility":40.0,"Tdewpoint":8.3,"rv1":12.134822830557823,"rv2":12.134822830557823},{"date":"2016-05-20 18:00:00","lights":10,"T1":23.5,"RH_1":45.6266666666667,"T2":23.5,"RH_2":42.878,"T3":24.6,"RH_3":41.2,"T4":23.7,"RH_4":43.2,"T5":23.9685714285714,"RH_5":87.2685714285714,"T6":20.26,"RH_6":1.0,"T7":23.2,"RH_7":40.09,"T8":23.2257142857143,"RH_8":48.6214285714286,"T9":22.6,"RH_9":44.2,"T_out":18.3,"Press_mm_hg":758.1,"RH_out":59.0,"Windspeed":5.0,"Visibility":40.0,"Tdewpoint":10.2,"rv1":37.0260440162383,"rv2":37.0260440162383}]}'
json
{"predictions":[{"value":76.48936023020836},{"value":119.28115825799321}]}

value is the predicted use in Wh: about 76 and 119, the same as predict for these rows under Make predictions.

In our run, sending the values as the file writes them (strings such as " 0" or " 1.0600000000000000e+01"), the date as 2016-05-20T00:00:00, or lights as "0" gave the same values, and so did adding Appliances to a row.

The served model gives no warning for a value outside what it learned from, and the prediction still changes. In the training rows, rv1 and rv2 lie between 0 and 50, T_out between −5 and 26.1 °C, and lights only holds 0 to 70 in steps of 10. For row 1:

  • rv1 and rv2 at 0, 13, 49 and 100 gave 76.6, 76.5, 74.6 and 72.7 (and 1,000 gave 72.7 again): any value of the random columns moves the prediction a little, by up to about 4 Wh here, inside the training range or not. A model meant for use is better trained without them, as the authors did in their R script: "Since rv1 and rv2 are not relevant, then removing them from the data sets".
  • T_out at 40 °C gave 59.8, and at −30 °C 91.2.
  • lights at 80 or at 5, values it never saw, gave 101.5 and 86.5.
  • The same reading dated in December 2016, a month it never saw, gave 59.6.

Before you rely on a prediction, check that each input lies in the range of the training data.

From an AI tool ​

AI tools such as Claude and Codex can do the same through Fione's MCP endpoint: upload the CSV, train, read the results and predict. Ask the tool to order the rows in time by date; propose_training_config takes it as time_column. Called directly over MCP for our dataset, after the file to predict had been uploaded, the proposal kept every column and left time_column empty; it warned that "the dates in column 'date' of the test data are all later than those of the training rows", and that setting time_column to it "validates later rows after earlier ones". Check it before you train. For a few readings, the predict tool takes rows like the two above and returns predict for each. Called directly over MCP for the model trained above, it returned the same values as the API above (76.49 and 119.28). How to connect a client and what to ask is in Run the AutoML loop from an AI tool with MCP, the proposal in Proposals, and the predict tool in Predicting new rows.