In [1]:
from neuralnilm.source import NILMTKSource
In [2]:
source = NILMTKSource(
filename='/data/mine/vadeec/merged/ukdale.h5',
appliances=['television', 'washer dryer', 'fridge freezer', 'dish washer'],
train_buildings=[1],
validation_buildings=[1],
window=("2013-04-01", "2013-05-01"),
sample_period=6,
seq_length=1500,
n_seq_per_batch=10
)
In [3]:
appliances, mains, time_of_day = source._gen_single_example()
In [7]:
import matplotlib.pyplot as plt
ax = appliances.plot()
mains.plot(ax=ax)
plt.show()
In [6]:
plt.plot(time_of_day)
plt.show()
In [27]:
print appliances.shape, mains.shape
In [18]:
mains[:1500].shape
Out[18]:
In [41]:
index = mains.index
In [76]:
import pandas as pd
SECS_PER_DAY = 60 * 60 * 24
index = index.tz_localize(None)
secs_into_day = (index.astype(int) / 1E9)[1000] % SECS_PER_DAY
secs_into_day / SECS_PER_DAY
Out[76]:
In [77]:
index[1000]
Out[77]:
In [78]:
mains.index[1000]
Out[78]:
In [29]:
elec = source.dataset.buildings[1].elec
In [31]:
elec.get_labels(appliances.columns)
Out[31]:
In [18]:
good_sections = elec.mains().good_sections()
In [19]:
good_sections[0].timedelta
Out[19]:
In [1]:
from neuralnilm.source import RealApplianceSource
import matplotlib.pyplot as plt
In [2]:
source = RealApplianceSource('/data/mine/vadeec/merged/ukdale.h5', ['fridge freezer', 'hair straighteners', 'television'],
max_input_power=800, max_output_power=150)
In [11]:
X, y = source._gen_data()
fig, axes = plt.subplots(2, sharex=True)
axes[0].plot(X[0,:,0])
axes[1].plot(y[0,:,0])
plt.show()
In [ ]: