Beispiel #1
0
                      callbacks,
                      epoch_size=20,
                      epoch_steps=100)

ml.save_model(model,'entersolar_model.h5')

output = ml.load_models('entersolar_model.h5')

import importlib
importlib.reload(ml)
start_idx = 0
length = 2000
target_names = target_output
y_pred, y_true,x,mse = ml.plot_comparison(x_test_scaled,y_test,y_scaler,
                                                       target_names,output,
                                                       start_idx = start_idx,
                                                       length=length,
                                                       verbose=True)



solar_pvwatts = helper.pv_data(coordinates=(lat,lon),solar_size_kw_dc = 1750,tilt=25)

index = pd.date_range(start='1/1/'+str(2018), periods=8760, freq='60T')

solar_pvwatts.index = index

solar_pvwatts = solar_pvwatts.resample('15T').asfreq()
#solar_pvwatts = solar_pvwatts.drop(columns={'month','day','hour'})

solar_pvwatts = solar_pvwatts.interpolate()
Beispiel #2
0
    target_output,
    batch_size=256,
    sequence_length=24,
    training_len=0.75,
    validation_len=0.225)

model = ml.train_model(model,
                       batch,
                       validation_data,
                       x_test_scaled,
                       y_test_scaled,
                       callbacks,
                       epoch_size=25,
                       epoch_steps=100)

ml.save_model(model, 'model.h5')

output = ml.load_models('model.h5')

import importlib
importlib.reload(ml)
start_idx = 0
length = 500
target_names = target_output
y_pred, y_true, x = ml.plot_comparison(x_test_scaled,
                                       y_test,
                                       y_scaler,
                                       target_names,
                                       output,
                                       length=length)
Beispiel #3
0
             callback_reduce_lr]


model.fit_generator(generator=batch,
                    epochs=15,
                    steps_per_epoch=100,
                    validation_data=validation_data,
                    callbacks=callbacks)

result = model.evaluate(x=np.expand_dims(x_test_scaled, axis=0),
                        y=np.expand_dims(y_test_scaled, axis=0))

start_idx = 0
length = 10000
target_names = target_output
y_pred, y_true,x = ml.plot_comparison(x_test_scaled,y_test,y_scaler,
                                                       target_names,model)


mse_vect = list()
for i in range(len(y_pred)):
    mse_vect.append((y_pred[i]-y_true[i])**2)

mse = sum(mse_vect)
plt.figure()
plt.plot(mse_vect)


data_size = 144
training_size = 144
new = np.array(data.solar_irradiance).reshape(8760,2)
new_expand = np.expand_dims(new,axis=0)