cderinbogaz / inpredo

Inpredo is a Deep Learning tool which looks into financial charts and predicts stock movements.
https://towardsdatascience.com/making-a-i-that-looks-into-trade-charts-62e7d51edcba
MIT License
159 stars 93 forks source link

Only buy #1

Closed munkh-erdene closed 4 years ago

munkh-erdene commented 4 years ago

Thanks for sharing knowledge, i have a question i got that result : Only buy

What shall i do?

Predicted answer: Buy

[1.0000000e+00 1.7195972e-25]

[[1.0000000e+00 1.7195972e-25]]

Label: sell

Predicted answer: Buy

[1.0000000e+00 4.2478185e-26]

[[1.0000000e+00 4.2478185e-26]]

Label: sell

Predicted answer: Buy

[9.9989498e-01 1.0502239e-04]

[[9.9989498e-01 1.0502239e-04]]

Label: sell

Predicted answer: Buy

[1.0000000e+00 1.8285746e-11]

[[1.0000000e+00 1.8285746e-11]]

Label: sell

Predicted answer: Buy

[1.0000000e+00 1.5805315e-20]

[[1.0000000e+00 1.5805315e-20]]

Label: sell

Predicted answer: Buy

[1.0000000e+00 1.3262541e-18]

[[1.0000000e+00 1.3262541e-18]]

Label: sell

Predicted answer: Buy

[1.0000000e+00 2.2895107e-16]

[[1.0000000e+00 2.2895107e-16]]

Label: sell

Predicted answer: Buy

[1.0000000e+00 7.0590938e-12]

[[1.0000000e+00 7.0590938e-12]]

Label: sell

Predicted answer: Buy

[1.000000e+00 8.698008e-14]

[[1.000000e+00 8.698008e-14]]

Label: sell

Predicted answer: Buy

[1.0000000e+00 1.8061724e-14]

[[1.0000000e+00 1.8061724e-14]]

True buy: 111

True sell: 0

False buy: 0

False sell: 122

no action: 0

Sell Precision: 0.0

Buy Precision 1.0

Recall: 0.47639484978540775

Precision: 0.47639484978540775

F-measure: 0.0

cderinbogaz commented 4 years ago

I think you haven't setup your training and validation datasets correctly. In your training and validation datasets there should be the exact amount of files in buy and sell directories. This is something you need to manually by deleting some random image files by hand. If your training dataset is imbalanced, then the ML model will be biased. This bias can create problems like this.

First of all it is crucial that you have a balanced dataset in all of your training and validation datasets. For example your buy and sell folder should have equal amount of images. When you first run the graphwerk.py script you will have a different amounts in both folders, first of all you need to equalise the number of samples manually in both folder. One way of doing this is manually deleting random samples from the folder with more images. After doing this you should take 20 percent of the data from the training folder and put it into the validation folder and make sure the amount of images are the same.

Ulixestoitaca commented 4 years ago

Hello, may I just ask if validation folder should have 2 sub-folders (buy and sell) as train folder does?

Thank you

cderinbogaz commented 4 years ago

Hello, Yes it should have 2 sub folders (buy and sell)

tackelua commented 4 years ago

Hi, my result is only sell My data train includes 2 folders buy and sell and quantity images is equal between 2 folders. I train with epochs = 2 Do something wrong? Thank you

Screen Shot 2020-09-22 at 18 01 31 Screen Shot 2020-09-22 at 18 01 37
tackelua commented 4 years ago

I run predict with data train -> the result still only sell

cderinbogaz commented 4 years ago

2 Epochs wouldn't be enough for training such model. I would suggest to go up to 1000 Epochs or less depending on how the model is converging.