taoshi-mbrown
commited on
Commit
•
8f8d8d2
1
Parent(s):
1a954ea
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,107 @@
|
|
1 |
---
|
2 |
license: mit
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
tags:
|
6 |
+
- bittensor
|
7 |
---
|
8 |
+
MIT License
|
9 |
+
|
10 |
+
Copyright (c) 2024 Taoshi Inc
|
11 |
+
|
12 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
13 |
+
of this software and associated documentation files (the "Software"), to deal
|
14 |
+
in the Software without restriction, including without limitation the rights
|
15 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
16 |
+
copies of the Software, and to permit persons to whom the Software is
|
17 |
+
furnished to do so, subject to the following conditions:
|
18 |
+
|
19 |
+
The above copyright notice and this permission notice shall be included in all
|
20 |
+
copies or substantial portions of the Software.
|
21 |
+
|
22 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
23 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
24 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
25 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
26 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
27 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
28 |
+
SOFTWARE.
|
29 |
+
|
30 |
+
# Background
|
31 |
+
|
32 |
+
The models provided here were created using open source modeling techniques
|
33 |
+
provided in https://github.com/taoshidev/time-series-prediction-subnet (TSPS).
|
34 |
+
They were achieved using the `runnable/miner_training.py`, and tested against
|
35 |
+
existing models in `runnable/miner_testing.py`.
|
36 |
+
|
37 |
+
> **Note**<br>
|
38 |
+
This model requires the Feature Set Creator (FSC) functionality added in the
|
39 |
+
latest release of the TSPS.
|
40 |
+
|
41 |
+
# Build Strategy
|
42 |
+
|
43 |
+
This section outlines the strategy used to build the models.
|
44 |
+
|
45 |
+
## Understanding Dataset Used
|
46 |
+
|
47 |
+
The dataset used to build the models can be generated using the
|
48 |
+
`runnable/generate_historical_data.py`. A lookback period between June 2023 and
|
49 |
+
January 2024 on the 5m interval was used to train the model. Recent data was
|
50 |
+
used because it more closely correlates to the current market and
|
51 |
+
macroeconomic conditions.
|
52 |
+
|
53 |
+
Testing data was used between January 2024 and February 2024 to determine the
|
54 |
+
performance of the models. This was tested using the `runnable/miner_testing.py`
|
55 |
+
file with live historical data sources.
|
56 |
+
|
57 |
+
|
58 |
+
## Understanding Model Creation
|
59 |
+
|
60 |
+
As of now, the model only uses the following features to predict:
|
61 |
+
- close
|
62 |
+
- high
|
63 |
+
- low
|
64 |
+
- volume
|
65 |
+
- time of day
|
66 |
+
- time of week
|
67 |
+
- time of month
|
68 |
+
|
69 |
+
Other features from a wide range of feature sources are being added to TSPS
|
70 |
+
infrastructure in the near future as improvements to the FSC.
|
71 |
+
|
72 |
+
A variety of windows and parameters were tested and eliminated. The final
|
73 |
+
strategy to derive this model was the following:
|
74 |
+
|
75 |
+
```
|
76 |
+
model = BaseMiningModel(
|
77 |
+
filename="model_v5_1.h5",
|
78 |
+
mode="w",
|
79 |
+
feature_count=7,
|
80 |
+
sample_count=500,
|
81 |
+
prediction_feature_count=1,
|
82 |
+
prediction_count=10,
|
83 |
+
prediction_length=100,
|
84 |
+
layers=[
|
85 |
+
[1024, 0],
|
86 |
+
[1024, 0.3],
|
87 |
+
],
|
88 |
+
learning_rate=0.000001,
|
89 |
+
dtype=Policy("mixed_float16"),
|
90 |
+
)
|
91 |
+
```
|
92 |
+
|
93 |
+
The LSTM model has two stacked layers with a 0.3 dropout rate.
|
94 |
+
|
95 |
+
## Understanding Training Decisions
|
96 |
+
|
97 |
+
Training was done with 500 samples per scenario and 128 scenarios per batch,
|
98 |
+
with 20 training epochs and 10 passes over the entire dataset. Additional
|
99 |
+
epochs and passes were not found to improve the model's predictions.
|
100 |
+
|
101 |
+
## Strategy to Predict
|
102 |
+
|
103 |
+
The strategy to predict 100 closes of data into the future was to use 10
|
104 |
+
predictions evenly spaced along the length of the prediction space, and then
|
105 |
+
linearly interpolating between each prediction. By doing so, the model could
|
106 |
+
learn to predict the general shape of the market movement, rather than
|
107 |
+
predicting all 100.
|