Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
November 8, 2016
0.1
Update on my Progress
0.2
0.3
0.4
Loading data
0.5
0.6
In [3]: building_number = 2
0.7
This is the data used for trainng and testing the combinatorial optimization and markove hidden model aligorithm
I try to divide the given data into different kinds of applinace based on the amount of power
consumption
1.1
In [5]: elec.meters[1].when_on().next().head(10)
Out[5]: 2011-04-17 19:18:27-04:00
2011-04-17 19:18:28-04:00
True
True
2
2011-04-17 19:18:29-04:00
True
2011-04-17 19:18:30-04:00
True
2011-04-17 19:18:31-04:00
True
2011-04-17 19:18:32-04:00
True
2011-04-17 19:18:33-04:00
True
2011-04-17 19:18:34-04:00
True
2011-04-17 19:18:35-04:00
True
2011-04-17 19:18:54-04:00
True
Name: (power, apparent), dtype: bool
1.2
Select fridge
1.3
The energy consumed by each appliance can be expressed as a proportion of the households total
energy. Here we find the range of proportions for each fridge.
In [7]: fridges_restricted = MeterGroup(fridges.meters[:9])
In [8]: # How much energy does the largest-consuming fridge consume in kWh?
fridges.select(building=2).total_energy()
This is the fridge that used for training and testing the disaggregation algorithms
In [9]: we.set_window(start='2011-04-18',end='2011-04-22')
fridges.select(building=2).plot();
2.1
In [10]: we.set_window(start='2011-04-18',end='2011-04-22')
elec.mains().plot();
2.2
building2/elec/cache/meter3/
building2/elec/cache/meter4/
building2/elec/cache/meter5/
building2/elec/cache/meter6/
building2/elec/cache/meter7/
building2/elec/cache/meter8/
building2/elec/cache/meter9/
building2/elec/cache/meter10/
building2/elec/cache/meter11/
In [13]: elec.submeters().fraction_per_meter()
0.101074
0.074877
0.018925
0.074877
0.000000
0.301417
0.258510
0.170321
0.000000
2.3
Out[15]: MeterGroup(meters=
ElecMeter(instance=7, building=2, dataset='REDD', appliances=[Appliance(
ElecMeter(instance=9, building=2, dataset='REDD', appliances=[Appliance(
ElecMeter(instance=10, building=2, dataset='REDD', appliances=[Appliance
)
In [16]: top2=elec.submeters().select_top_k(k=2)
2.4
In [17]: # Train
co = CombinatorialOptimisation()
co.train(top2)
In this training stage of the combinatroial optimization, the algorithms uses cluster techniques to get the possible state of the appliance
cluster (data,max_num_cluster)
<IPython.core.display.HTML object>
3.1
appl
appl
appl
appl
appl
appl
appl
appl
3.2
The F1 score, commonly used in information retrieval, measures accuracy using the statistics
precision p and recall r. Precision is the ratio of true positives (tp) to all predicted positives (tp +
fp). Recall is the ratio of true positives to all actual positives (tp + fn). The F1 score is given by
- F-score = 2p*r/p+r
where
p= t*p/tp+fp,
r=t*p/tp+fn
The F1 metric weights recall and precision equally, and a good retrieval algorithm will maximize both precision and recall simultaneously. Thus moderately good performance on both will
be favored over extremely good performance on one and poor performance on the other.
F-Measure scores range from 0-100%. A score less than 15% means that your KantanMT engine is not performing optimally and a high level of post-editing will be required to finalise your
translations and reach publishable quality.
A score greater than 50% is a very good score and significantly less post-editing will be require
to achieve publishable translation quality.
In [22]: f1
Out[22]: Sockets
0.000000
Fridge
0.789888
dtype: float64
In [23]: elec.clear_cache()
Removed
Removed
Removed
Removed
Removed
Removed
Removed
Removed
Removed
Removed
building2/elec/cache/meter1/
building2/elec/cache/meter3/
building2/elec/cache/meter4/
building2/elec/cache/meter5/
building2/elec/cache/meter6/
building2/elec/cache/meter7/
building2/elec/cache/meter8/
building2/elec/cache/meter9/
building2/elec/cache/meter10/
building2/elec/cache/meter11/
building=2, dataset='REDD')
building=2, dataset='REDD')
building=2, dataset='REDD')
building=2, dataset='REDD')
building=2, dataset='REDD')
building=2, dataset='REDD')
building=2, dataset='REDD')
11
In [28]: f1
Out[28]: Sockets
0.000000
Fridge
0.999081
dtype: float64
From the disaggregation result for the fridge in the graph and also
from the f-score result (f1-co=0.79 and f1-fhmm=0.999) , we can see
that the markov hidden model is quite accurate eventhough it is more
complex than the combinatorial optimization.
and these days I am also studying on the Algorithms, till the next
tasks. . .
12