```
split = self.data['sold'].size - self.length
if (self.showGraph):
self.data.plot()
plt.show()
self.train = self.data[:split]
self.test = self.data[split:]
# trainDup = self.train
# self.train = trainDup.append(self.train)
self.scaler = MinMaxScaler()
self.trainS = self.scaler.fit_transform(self.train)
self.testS = self.scaler.transform(self.test)
self.batch_size = 1
self.trainGen = TimeseriesGenerator(self.trainS,targets=self.trainS,length=self.length,batch_size=1)
self.testGen = TimeseriesGenerator(self.testS,targets=self.testS,length=self.length-1,batch_size=1)
self.data.isnull()
batches = int(self.data['sold'].size / self.batch_size)
self.input_shape = (self.length,self.train.columns.values.size)
self.batch_input_shape = (self.batch_size,self.length,self.train.columns.values.size)
self.model = Sequential()
self.model.add(SimpleRNN(
12,return_sequences=False,input_shape=self.input_shape
))
self.model.add(Activation('relu'))
self.model.add(Dense(1))
self.model.add(Activation('relu'))
def loss(value,pred):
from sklearn.metrics import mean_absolute_error
return mean_absolute_error(value,pred)
self.model.compile(optimizer=Adam(learning_rate=0.001),loss='mse',metrics=['accuracy'])
print(self.model.summary())
```
Predictions Are Orange
Real Results Are Blue
Year Graph.
I have Tried LSTM,RNNsimple:
and many different varionts off these I have tried
1024-6 units I have tried dropout and without scaler I have changed batch_size used L2,L1 regualizers for fitting, I have changed the data from weekly,monthly,yearly,daily I have tried a duplicating technique to have 10000 data rows I have tried Using ANN, and batch_input_shape and so much more. But I can't find a soultion ATM.
My data count:
Daily = 1895
Yearly = 1895 / 365
Monthly = 1895 / 12
Weekly = 1895 / 7
Duplicated = 20100 AND I HAVE TRIED SHUFFLING.