mayersjd / MLStonks

Training neural networks to buy and sell stocks.
0 stars 0 forks source link

Optimize network parameters #7

Open mayersjd opened 3 years ago

mayersjd commented 3 years ago

This is partly a general ongoing issue, as each network will need to be optimized as we add it, but I had one thing in particular that could be rather large issue. It has to do with assigning only a binary value as an output (i.e. buy or sell). Consider the following:

  1. Our program assigns labels of 1/buy (0/sell) to a particular stock if it's value rises (falls) within a given time frame.
  2. Let's assume our network achieves 75% accuracy based on this metric (3/4 cases properly identified).
  3. Let us now assume that the 1 case that was incorrectly identified was assigned a 1 value, when it should have been a 0. And that the other three were all correctly assigned values of 1.
  4. Let us posit a situation where each of the correctly classified stocks appreciate in value by 1%, whereas the incorrectly classified stock depreciates in value by 10%.
  5. We now have a net loss of 7%, even though we correctly classified 75% of the stocks.

This means that our network needs to do more than just correctly classify a stock as appreciating or depreciating in value over a set time frame. It also needs to have some level of confidence as to how much a stock is going to appreciate or depreciate. Maybe not an exact percentage prediction, but it should be able to identify stocks that are going to appreciate more than others.