chickenbenny / stock-prediction-with-gan-and-wgan Goto Github PK
View Code? Open in Web Editor NEWstock prediction with GAN and WGAN
License: MIT License
stock prediction with GAN and WGAN
License: MIT License
Hello, I would like to ask you if the Class VAE() in your code is used to extract 10 features and add them to the original features? I look forward to hearing from you!
Hello, I would like to ask why the loss function of the generator in your paper is almost horizontal, can you explain it in detail? I look forward to your reply!
I followed (copy/paste) the exact same code of wgan-gp_demo.ipynb with the same dataset as well, but I am getting worst result. Are you sure the code is updated? I'm getting RMSE:7.945424793070616 on testing dataset
Also, As you can see the trend of the prediction/actual seems much more similar to GAN or LSTM
The following code produces the data leakage FFT feature.
close_fft = np.fft.fft(np.asarray(data_combine['Close'].tolist()))
fft_df = pd.DataFrame({'fft':close_fft})
fft_df['absolute'] = fft_df['fft'].apply(lambda x: np.abs(x))
fft_df['angle'] = fft_df['fft'].apply(lambda x: np.angle(x))
plt.figure(figsize=(14, 7), dpi=100)
fft_list = np.asarray(fft_df['fft'].tolist())
for num_ in [3, 6, 9, 27, 81, 100]:
fft_list_m10= np.copy(fft_list); fft_list_m10[num_:-num_] = 0
data_combine[f'FT_{num_}components'] = np.fft.ifft(fft_list_m10)
plt.plot(np.fft.ifft(fft_list_m10), label='Fourier transform with {} components'.format(num_))
plt.plot(data_combine['Close'].values, label='Real')
Even an MLP model can have a good result in predicting the next day's up/down trend.
To provide FFT feature without data leakage. You will need to generate it by each bar.
such as :
for i in range(1, len(df)):
window = df[:i]['close']
index_data.append(df.index[i])
fft_close = np.fft.fft(window.values)
absolute = np.abs(fft_close)
angle = np.angle(absolute)
...
After this alteration, the model will perform very badly.
Hello, I would like to inquire about the code of HungChun Lin that is publicly available in your project.
In the WGAN-GP code
class GAN():
def train_step(self, data):
for _ in range(1):
for _ in range(3):
What do these two for loops represent?
Does a 1 inside the loop mean that there is only one variable to predict, and does a 3 mean that the sliding window is 3?
Looking forward to your reply, thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.