... | ... | @@ -30,7 +30,35 @@ These locations are used for model training: |
|
|
- (52.2297, 21.0122) # Warsaw, Poland
|
|
|
|
|
|
|
|
|
these are the new locations with more variety of temperature ranges
|
|
|
|
|
|
- (48.3330, 16.6319), # Vienna, Austria
|
|
|
- (64.1355, -21.8954), # Reykjavik, Iceland
|
|
|
- (35.1667, 33.3667), # Nicosia, Cyprus
|
|
|
- (59.3293, 18.0686), # Stockholm, Sweden
|
|
|
- (41.3851, 2.1734), # Barcelona, Spain
|
|
|
- (55.6761, 12.5683), # Copenhagen, Denmark
|
|
|
- (37.9838, 23.7275), # Athens, Greece
|
|
|
- (53.3498, -6.2603), # Dublin, Ireland
|
|
|
- (50.0755, 14.4378), # Prague, Czech Republic
|
|
|
- (45.4408, 12.3155), # Venice, Italy
|
|
|
- (60.1695, 24.9354), # Helsinki, Finland
|
|
|
- (51.5074, -0.1278), # London, United Kingdom
|
|
|
- (40.4168, -3.7038), # Madrid, Spain
|
|
|
- (43.7102, 7.2620), # Nice, France
|
|
|
- (50.8503, 4.3517), # Brussels, Belgium
|
|
|
- (42.6977, 23.3219), # Sofia, Bulgaria
|
|
|
- (46.2044, 6.1432), # Geneva, Switzerland
|
|
|
- (44.4268, 26.1025), # Bucharest, Romania
|
|
|
- (52.2297, 21.0122), # Warsaw, Poland
|
|
|
- (37.0755, 15.2866), # Sicily, Italy, hottest in europe
|
|
|
- (67.5689, 49.3333), # Komi Republic, Russia, coldest in europe
|
|
|
- (41.6941, 49.9469), # Caspian Sea Shoreline, Russia, lowest altitude
|
|
|
- (43.3499, 42.4453), # Caucasus Mountains, Russia, highest altitude
|
|
|
- (81.8000, 25.0000), # Svalbard Archipelago, Norway, northernmost point in Europe
|
|
|
- (34.6000, 24.1000), # Gavdos Island, Greece, southernmost point in Europe
|
|
|
- (39.4550, -31.2720), # Azores, Portugal, westernmost point in Europe
|
|
|
- (67.9340, 68.7060) # Ural Mountains, Russia, easternmost point in Europe
|
|
|
|
|
|
and these for model validation:
|
|
|
|
... | ... | @@ -41,6 +69,8 @@ and these for model validation: |
|
|
- (56.9496, 24.1052), # Riga, Latvia
|
|
|
- (48.1486, 17.1077), # Bratislava, Slovakia
|
|
|
- (44.7871, 20.4572) # Belgrade, Serbia
|
|
|
- (55.7558, 37.6176) # Moscow, Russia
|
|
|
|
|
|
|
|
|
|
|
|
|
... | ... | @@ -65,6 +95,8 @@ After separating time index and feature engineering the dataframe consists of th |
|
|
- 'global_tilted_irradiance',
|
|
|
- 'lat',
|
|
|
- 'lon'
|
|
|
- 'alt'
|
|
|
after feedback I also fetched altitude of the locations from Open-Elevation API
|
|
|
|
|
|
**time**
|
|
|
- 'hour',
|
... | ... | @@ -123,4 +155,51 @@ After separating time index and feature engineering the dataframe consists of th |
|
|
- '365d_rolling_min',
|
|
|
- '365d_rolling_std'
|
|
|
|
|
|
Afterwards sequences for the model are created. |
|
|
Afterwards I normalize and scale the data with a MinMaxScaler.
|
|
|
|
|
|
|
|
|
|
|
|
With this code the sequences with sequence length = 6 and param = 'T2M' for the model are created.
|
|
|
```
|
|
|
X_train, y_train = [], []
|
|
|
for i in range(len(train_df) - sequence_length - hours_to_predict + 1):
|
|
|
X_train.append(train_df.iloc[i:(i + sequence_length)].values)
|
|
|
if include_target:
|
|
|
y_train.append(train_df.iloc[i + sequence_length:i + sequence_length + hours_to_predict][param].values)
|
|
|
if include_target:
|
|
|
X_train = np.array(X_train)
|
|
|
y_train = np.array(y_train)
|
|
|
|
|
|
# Reshape for ConvLSTM
|
|
|
X_train = X_train.reshape((X_train.shape[0], sequence_length, X_train.shape[2]))
|
|
|
```
|
|
|
Output of all_sequences[0][0][0]
|
|
|
|
|
|
```
|
|
|
array([[0.63587862, 0.65751672, 0.79055085, 0. , 0.67400501,
|
|
|
0.90413209, 0. , 0.21135455, 0.38957586, 0. ,
|
|
|
0. , 0.29095339, 0.47914441, 0.03654058, 0.95652174,
|
|
|
0.24383562, 0.23076923, 0.18181818, 0. , 0.25 ,
|
|
|
0.9330127 , 1. , 0.5 , 0.99988888, 0.51074899,
|
|
|
0.73202077, 0. , 0.12808288, 0.52656207, 0.63587862,
|
|
|
0.63587862, 0.63587862, 0.63587862, 0.63587862, 0.63587862,
|
|
|
0.65751672, 0.65751672, 0.5165877 , 0.54142189, 0. ,
|
|
|
0. , 0.63982648, 0.64717827, 0.66373074, 0.68086505,
|
|
|
0.76426509, 0.73619747, 0.73650485, 0.74377425, 0.44403896,
|
|
|
0.75644639, 0.83379982, 0.60455111, 0.45051796],
|
|
|
[2],
|
|
|
[3],
|
|
|
[4],
|
|
|
[5],
|
|
|
[0.62444538, 0.64383824, 0.77791441, 0. , 0.65537662,
|
|
|
0.90025098, 0. , 0.23389022, 0.3841674 , 0. ,
|
|
|
0. , 0.29095339, 0.47914441, 0.03654058, 0.13043478,
|
|
|
0.24657534, 0.23076923, 0.27272727, 0. , 0.85355339,
|
|
|
0.85355339, 0.9330127 , 0.25 , 1. , 0.50214255,
|
|
|
0.71990323, 0. , 0.12808288, 0.52720481, 0.62934533,
|
|
|
0.63587862, 0.63587862, 0.63587862, 0.63587862, 0.63587862,
|
|
|
0.62267959, 0.6090057 , 0.51184839, 0.55437695, 0. ,
|
|
|
0. , 0.63194027, 0.64175095, 0.6603341 , 0.67889608,
|
|
|
0.76425445, 0.73619747, 0.73650485, 0.74377425, 0.44403896,
|
|
|
0.75644639, 0.83379982, 0.60455111, 0.45051796]])
|
|
|
``` |