<jupyter_start><jupyter_text>Imports<jupyter_code>import pynncml as pnc 
from matplotlib import pyplot as plt<jupyter_output><empty_output><jupyter_text>Load OpenCML Dataset<jupyter_code>open_cml_dataset = pnc.read_open_cml_dataset('../dataset/open_cml.p') #  read OpenCML dataset<jupyter_output><empty_output><jupyter_text>Select Link and Plot link data<jupyter_code>link_index = 14
link_data = open_cml_dataset[link_index] # select a link
link_min_max=link_data.create_min_max_link(300)
link_data.plot() # plot link data
plt.show()<jupyter_output><empty_output><jupyter_text>Run rain estimation using constant baseline<jupyter_code>tsc = pnc.rain_estimation.two_step_network(1,pnc.neural_networks.RNNType.GRU) # init classification model
res,_ = tsc(link_min_max.as_tensor(constant_tsl=10),link_data.meta_data.as_tensor(),tsc.init_state()) # run classification method
rain=res[0,:,0]
wd=res[0,:,1]
plt.subplot(1, 2, 1)
plt.plot(link_min_max.time(), rain.detach().numpy().flatten())
plt.title('Rain Estimation')
plt.xlabel('Time')
pnc.change_x_axis_time_format('%H')
plt.grid()
plt.subplot(1, 2, 2)
plt.plot(link_min_max.time(), wd.detach().numpy().flatten())
plt.xlabel('Time')
plt.title('Classification')
pnc.change_x_axis_time_format('%H')
plt.ylabel(r'$\sigma_n$')
plt.grid()
plt.show()<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup