In [1]:
from __future__ import print_function, division
import unittest
from os.path import join
from os import remove
import pandas as pd
from nilmtk.datastore import HDFDataStore
from nilmtk import DataSet
from nilmtk.disaggregate import CombinatorialOptimisation
In [3]:
filename = join("../../data/", 'co_test.h5')
dataset = DataSet(filename)
In [6]:
elec = dataset.buildings[1].elec
co = CombinatorialOptimisation()
co.train(elec)
mains = elec.mains()
pred = co.disaggregate_chunk(mains.load(sample_period=1).next())
In [19]:
gt = {}
for meter in elec.submeters().meters:
gt[meter] = meter.load(sample_period=1).next().squeeze()
In [22]:
gt = pd.DataFrame(gt)
In [23]:
gt.equals(pred)
Out[23]:
In [24]:
gt.head()
Out[24]:
In [27]:
pred.dtypes='float32'
In [ ]: