In [24]:
from __future__ import print_function, division
import matplotlib.pyplot as plt
import numpy as np
from experiment035 import gen_data, gen_unquantized_data
from nilmtk import DataSet, MeterGroup
In [25]:
dataset = DataSet('/data/mine/vadeec/merged/ukdale.h5')
elec = dataset.buildings[1].elec
APPLIANCES = ['boiler', 'television']
selected_meters = [elec[appliance] for appliance in APPLIANCES]
selected = MeterGroup(selected_meters)
In [26]:
# Generate a "validation" sequence whose cost we will compute
X_val, y_val = gen_unquantized_data(metergroup=selected, validation=False)
In [27]:
plt.plot(y_val[4,:,0])
plt.show()
In [12]:
y_val[0,:,0]
Out[12]:
In [28]:
plt.plot(X_val[4,:,1])
plt.show()
In [3]:
q = quantized(X)
In [7]:
X[0,3,:]
Out[7]:
In [31]:
import pandas as pd
from datetime import timedelta
FIRST_DAY = pd.Timestamp("2013-04-12")
start = FIRST_DAY + timedelta(days=605)
dataset.set_window(start, start+timedelta(days=1))
selected.plot()
plt.show()
In [8]:
q[0,3,:]
Out[8]:
In [11]:
where = np.where(q==1)[0][0]
if where > 5:
q[5:where] = 1
elif where < 5:
q[where:5] == 1
In [13]:
X
Out[13]:
In [3]:
plt.plot(y[0])
plt.show()
In [37]:
X[0]
Out[37]:
In [17]:
plt.plot(np.cumsum(y, axis=1)[0,:,:])
plt.show()
In [25]:
np.mean(((np.cumsum(y, axis=1) - np.cumsum(y+1, axis=1)) / 1000)**2)
Out[25]:
In [23]:
np.cumsum(y+0.6, axis=1)
Out[23]:
In [10]:
np.linspace(-1, 1, 11)
Out[10]:
In [11]:
np.histogram?
In [ ]: